4 require_once
'Services/UIComponent/SplitButton/classes/class.ilButtonToSplitButtonMenuItemAdapter.php';
5 require_once
'Services/UIComponent/SplitButton/classes/class.ilSplitButtonItemDivider.php';
6 require_once
'Services/UIComponent/SplitButton/exceptions/class.ilSplitButtonException.php';
7 require_once
"Services/UIComponent/Button/classes/class.ilButtonBase.php";
41 $lng = $DIC->language();
53 return new self(self::TYPE_SPLIT);
61 $this->menu_items[] = $menu_item;
69 $key = array_search($menu_item, $this->menu_items);
71 unset($this->menu_items[
$key]);
80 return count($this->menu_items) > 0;
100 "Cannot set menu items, element at index '%s' is not of type 'ilSplitButtonItem'",
139 $tpl =
new ilTemplate(
'tpl.split_button.html',
true,
true,
'Services/UIComponent/SplitButton');
143 "Cannot render a split button without a default button" 151 $btn_classes[] =
'btn-primary';
153 $tpl->setVariable(
'BTN_CSS_CLASS', implode(
' ', $btn_classes));
157 $tpl->setCurrentBlock(
'separator');
158 $tpl->touchBlock(
'separator');
159 $tpl->parseCurrentBlock();
161 $tpl->setCurrentBlock(
'item');
162 $tpl->setVariable(
'CONTENT', $item->getContent());
163 $tpl->parseCurrentBlock();
166 $tpl->setCurrentBlock(
'items');
167 $tpl->parseCurrentBlock();
170 $tpl->setVariable(
'TXT_TOGGLE_DROPDOWN', $this->lng->txt(
'toggle_dropdown'));
special template class to simplify handling of ITX/PEAR