Show select field for boolean parameters
This commit is contained in:
@@ -43,5 +43,19 @@ if (!function_exists('form_yesno')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('form_boolean')) {
|
||||||
|
/**
|
||||||
|
* Shows a boolean selection.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @param mixed $selected
|
||||||
|
* @param string $extra
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function form_boolean($name = '', $selected = array(), $extra = '') {
|
||||||
|
return form_dropdown($name, array('true' => _('True'), 'false' => _('False')), $selected, $extra);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* End of file MY_form_helper.php */
|
/* End of file MY_form_helper.php */
|
||||||
/* Location: ./application/helpers/MY_form_helper.php */
|
/* Location: ./application/helpers/MY_form_helper.php */
|
||||||
|
|||||||
@@ -101,8 +101,16 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?=$param['readable'];?></td>
|
<td><?=$param['readable'];?></td>
|
||||||
<td>
|
<td>
|
||||||
|
<?php
|
||||||
|
if ($param['type'] == 'boolean'):
|
||||||
|
?>
|
||||||
|
<?=form_boolean('param-'.$param['id'], (!empty($_POST['param-'.$param['id']]) ? $_POST('param-'.$param['id']) : (isset($copy_params[$i]['value'])) ? $copy_params[$i]['value'] : $param['default_value']), 'class="drop"')?>
|
||||||
|
<?php
|
||||||
|
else:
|
||||||
|
?>
|
||||||
<input type="text" name="param-<?=$param['id'];?>" class="long text" value="<?=(!empty($_POST['param-' . $param['id']]) ? $this->input->post('param-' . $param['id']) : (isset($copy_params[$i]['value'])) ? $copy_params[$i]['value'] : $param['default_value']);?>" />
|
<input type="text" name="param-<?=$param['id'];?>" class="long text" value="<?=(!empty($_POST['param-' . $param['id']]) ? $this->input->post('param-' . $param['id']) : (isset($copy_params[$i]['value'])) ? $copy_params[$i]['value'] : $param['default_value']);?>" />
|
||||||
<?php
|
<?php
|
||||||
|
endif;
|
||||||
if (!empty($param['description'])):
|
if (!empty($param['description'])):
|
||||||
?>
|
?>
|
||||||
<span class="form_info">
|
<span class="form_info">
|
||||||
|
|||||||
Reference in New Issue
Block a user