function get_setting() {
global $CFG;
- return (isset($CFG->{$this->name}) ? $CFG->{$this->name} : $this->defaultsetting);
+ return (isset($CFG->{$this->name}) ? $CFG->{$this->name} : NULL);
}
function write_setting($data) {
}
function output_html() {
+ if ($this->get_setting() === NULL) {
+ $current = $this->defaultsetting;
+ } else {
+ $current = $this->get_setting();
+ }
return '<tr><td width="100" align="right" valign="top">' . $this->visiblename . '</td>' .
- '<td align="left"><input type="text" size="50" name="s_'. $this->name .'" value="'. $this->get_setting() .'" /></td></tr>' .
+ '<td align="left"><input type="text" size="50" name="s_'. $this->name .'" value="'. $current .'" /></td></tr>' .
'<tr><td> </td><td align="left">' . $this->description . '</td></tr>';
}
}
function output_html() {
+ if ($this->get_setting() === NULL) {
+ $current = $this->defaultsetting;
+ } else {
+ $current = $this->get_setting();
+ }
return '<tr><td width="100" align="right" valign="top">' . $this->visiblename . '</td>' .
- '<td align="left"><input type="checkbox" size="50" name="s_'. $this->name .'" value="1" ' . ($this->get_setting() == true ? 'checked="checked"' : '') . ' /></td></tr>' .
+ '<td align="left"><input type="checkbox" size="50" name="s_'. $this->name .'" value="1" ' . ($current == true ? 'checked="checked"' : '') . ' /></td></tr>' .
'<tr><td> </td><td align="left">' . $this->description . '</td></tr>';
}
}
function output_html() {
+ if ($this->get_setting() === NULL) {
+ $current = $this->defaultsetting;
+ } else {
+ $current = $this->get_setting();
+ }
$return = '<tr><td width="100" align="right" valign="top">' . $this->visiblename . '</td><td align="left"><select name="s_' . $this->name .'">';
foreach ($this->choices as $key => $value) {
- $return .= '<option value="' . $key . '"' . ($key == $this->get_setting() ? ' selected="selected"' : '') . '>' . $value . '</option>';
+ $return .= '<option value="' . $key . '"' . ($key == $current ? ' selected="selected"' : '') . '>' . $value . '</option>';
}
$return .= '</select></td></tr><tr><td> </td><td align="left">' . $this->description . '</td></tr>';
return $return;
}
function output_html() {
+ //TO DO: fix handling of default values here!
$setvalue = $this->get_setting();
if (!is_array($setvalue)) {
$setvalue = array(0,0);
}
function output_html() {
+ //TO DO: fix handling of default values here!
$currentsetting = $this->get_setting();
if (!is_array($currentsetting)) {
$currentsetting = array();
}
function output_html() {
+ //TO DO: fix handling of default values here!
$currentsetting = $this->get_setting();
if (!is_array($currentsetting)) {