1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

admin UI - consistent arguments of 'options' override methods

This commit is contained in:
secretr
2012-05-02 14:24:19 +00:00
parent b8ade88540
commit 5c973fb66f
2 changed files with 7 additions and 6 deletions

View File

@@ -502,7 +502,7 @@ class cron_admin_form_ui extends e_admin_form_ui
} }
// Override the default Options field. // Override the default Options field.
function options($field, $value, $attributes, $id) function options($parms, $value, $id, $attributes)
{ {
if($attributes['mode'] == 'read') if($attributes['mode'] == 'read')
@@ -905,7 +905,7 @@ class cron
<td style='width:30%'>Cron Password</td> <td style='width:30%'>Cron Password</td>
<td style='width:70%'> <td style='width:70%'>
" "
.$frm->password('cron_password', 100)." .$frm->password('cron_password', '', 100)."
</td> </td>
</tr> </tr>

View File

@@ -608,7 +608,7 @@ class e_form
foreach ($elements as $value => $label) foreach ($elements as $value => $label)
{ {
$label = defset($label, $label); $label = defset($label, $label);
$text[] = $this->radio($name, $value, $checked == $value)."".$this->label($label, $name, $value).(isset($help[$value]) ? "<div class='field-help'>".$help[$value]."</div>" : ''); $text[] = $this->radio($name, $value, (string) $checked === (string) $value)."".$this->label($label, $name, $value).(isset($help[$value]) ? "<div class='field-help'>".$help[$value]."</div>" : '');
} }
if(!$multi_line) if(!$multi_line)
return implode("&nbsp;&nbsp;", $text); return implode("&nbsp;&nbsp;", $text);
@@ -1316,13 +1316,14 @@ class e_form
if(isset($attributes['method']) && $attributes['method'] && method_exists($this, $attributes['method'])) if(isset($attributes['method']) && $attributes['method'] && method_exists($this, $attributes['method']))
{ {
$method = $attributes['method']; $method = $attributes['method'];
return $this->$method($parms, $value, $id); return $this->$method($parms, $value, $id, $attributes);
} }
elseif(method_exists($this, 'options')) elseif(method_exists($this, 'options'))
{ {
return $this->options($field, $value, $attributes, $id); //return $this->options($field, $value, $attributes, $id);
// return $this->options($parms, $value, $id); // breaks admin->cron 'options' column // consistent method arguments, fixed in admin cron administration
return $this->options($parms, $value, $id, $attributes); // OLD breaks admin->cron 'options' column
} }
} }