Skip to content
Snippets Groups Projects
Commit 7dec1709 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Checkbox - wartość domyślna

parent 005220ab
No related branches found
No related tags found
No related merge requests found
...@@ -666,9 +666,16 @@ class WPDesk_S214_Settings_1_3 { ...@@ -666,9 +666,16 @@ class WPDesk_S214_Settings_1_3 {
global ${$this->func . '_options'}; global ${$this->func . '_options'};
$name = ' name="' . $this->func . '_settings[' . $args['id'] . ']"'; $name = ' name="' . $this->func . '_settings[' . $args['id'] . ']"';
$checked = isset( ${$this->func . '_options'}[$args['id']] ) ? checked( 1, ${$this->func . '_options'}[$args['id']], false ) : '';
$html = '<input type="hidden"' . $name . ' value="-1" />'; if( isset( ${$this->func . '_options'}[$args['id']] ) ) {
$value = ${$this->func . '_options'}[$args['id']];
} else {
$value = isset( $args['std'] ) ? $args['std'] : '';
}
$checked = checked( 1, $value, false );
$html = '<input type="hidden"' . $name . ' value="0" />';
$html .= '<input type="checkbox" id="' . $this->func . '_settings[' . $args['id'] . ']"' . $name . ' value="1" ' . $checked . '/>&nbsp;'; $html .= '<input type="checkbox" id="' . $this->func . '_settings[' . $args['id'] . ']"' . $name . ' value="1" ' . $checked . '/>&nbsp;';
$html .= '<span class="description"><label for="' . $this->func . '_settings[' . $args['id'] . ']">' . $args['desc'] . '</label></span>'; $html .= '<span class="description"><label for="' . $this->func . '_settings[' . $args['id'] . ']">' . $args['desc'] . '</label></span>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment