Skip to content
16 changes: 8 additions & 8 deletions e107_handlers/form_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3888,12 +3888,13 @@ public function button($name, $value, $action = 'submit', $label = '', $options
'.($label ?: LAN_NO_LABEL_PROVIDED).'
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu '.$options['class_ul'].'">
';
// Added class_ul to add classes to the UL tag
foreach($value as $k=>$v)
{
$text .= '<li class="dropdown-item">'.$v.'</li>';
// Added class_li to add classes to the LI tag and a small enhancement ;)
$text .= '<li class="dropdown-item '.$options['class_li'].($v == '--' || $v == 'divider'?'divider"><hr class="dropdown-divider">':'>'.$v).'</li>';
}

$text .= '
Expand All @@ -3902,11 +3903,8 @@ public function button($name, $value, $action = 'submit', $label = '', $options

return $text;
}



return $this->admin_button($name, $value, $action, $label, $options);

}

/**
Expand Down Expand Up @@ -4023,10 +4021,14 @@ public function admin_button($name, $value, $action = 'submit', $label = '', $op
$btype = 'button';
}

// added attributes for tooltip dispaly under BS
$attributes = [
'type' => $btype,
'name' => $name,
'value' => $value,
'data-toggle' => $options['data-toggle'],
'data-bs-toggle' => $options['data-bs-toggle'],
'title' => $options['title'],
];

if (isset($options['loading']) && ($options['loading'] == false))
Expand Down Expand Up @@ -4060,15 +4062,13 @@ public function admin_button($name, $value, $action = 'submit', $label = '', $op
$class .= ' ' . $this->getDefaultButtonClassByAction($action);
}


$options['class'] = $class;

if(empty($label))
{
$label = $value;
}


switch ($action)
{
case 'checkall':
Expand Down
Loading