mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Checkbox alignment fix
This commit is contained in:
parent
9baa5a601a
commit
750ac914a2
@ -605,7 +605,7 @@ class e_form
|
||||
* @param array or str
|
||||
* @example $frm->datepicker('my_field',time(),'type=date');
|
||||
* @example $frm->datepicker('my_field',time(),'type=datetime&inline=1');
|
||||
* @example $frm->datepicker('my_field',time(),'type=date&dateformat=yy-mm-dd');
|
||||
* @example $frm->datepicker('my_field',time(),'type=date&dateformat=yyyy-mm-dd');
|
||||
*
|
||||
* @url http://trentrichardson.com/examples/timepicker/
|
||||
*/
|
||||
@ -1825,7 +1825,6 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
$def_options['class'] = 'checkbox';
|
||||
unset($def_options['size'], $def_options['selected']);
|
||||
break;
|
||||
|
||||
|
@ -732,24 +732,37 @@ class user_class
|
||||
*/
|
||||
public function checkbox($treename, $classnum, $current_value, $nest_level, $opt_options = '')
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
|
||||
$classIndex = abs($classnum); // Handle negative class values
|
||||
$classSign = (substr($classnum, 0, 1) == '-') ? '-' : '';
|
||||
|
||||
if ($classIndex == e_UC_BLANK) return '';
|
||||
|
||||
$tmp = explode(',',$current_value);
|
||||
$chk = in_array($classnum, $tmp) ? " checked='checked'" : '';
|
||||
$style = "";
|
||||
|
||||
if ($nest_level == 0)
|
||||
{
|
||||
$style = " style='font-weight:bold'";
|
||||
}
|
||||
else
|
||||
elseif($nest_level > 1)
|
||||
{
|
||||
$style = " style='text-indent:".(1.2*$nest_level)."em'";
|
||||
$style = " style='text-indent:".(1.2 * $nest_level)."em'";
|
||||
}
|
||||
|
||||
$ucString = $this->class_tree[$classIndex]['userclass_name'];
|
||||
|
||||
if ($classSign == '-')
|
||||
{
|
||||
$ucString = str_replace('--CLASS--', $ucString, UC_LAN_INVERT);
|
||||
}
|
||||
|
||||
$checked = in_array($classnum, $tmp) ? true : false;
|
||||
return "<div {$style}>".$frm->checkbox($treename.'[]',$classSign.$classIndex,$checked,array('label'=> $ucString))."</div>\n";
|
||||
|
||||
|
||||
return "<div {$style}><input type='checkbox' class='checkbox' name='{$treename}[]' id='{$treename}_{$classSign}{$classIndex}' value='{$classSign}{$classIndex}'{$chk} />".$ucString."</div>\n";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user