Generates a tabbable menu.
@param string $type the menu type.
@param array $tabs the tab configurations.
@param array $htmlOptions additional HTML attributes.
@return string the generated menu.
508189
public static function tabbable($type, $tabs, $htmlOptions = array())
    {
        self::addCssClass('tabbable', $htmlOptions);
        $placement = TbArray::popValue('placement', $htmlOptions);
        if (!empty($placement)) {
            self::addCssClass('tabs-' . $placement, $htmlOptions);
        }
        $menuOptions = TbArray::popValue('menuOptions', $htmlOptions, array());
        $contentOptions = TbArray::popValue('contentOptions', $htmlOptions, array());
        self::addCssClass('tab-content', $contentOptions);
        $panes = array();
        $items = self::normalizeTabs($tabs, $panes);
        $menu = self::nav($type, $items, $menuOptions);
        $content = self::tag('div', $contentOptions, implode('', $panes));
        $output = self::openTag('div', $htmlOptions);
        $output .= $placement === self::TABS_PLACEMENT_BELOW ? $content . $menu : $menu . $content;
        $output .= '</div>';
        return $output;
    }
1292586
public static function inlineList($items, $htmlOptions = array())
    {
        $listItems = array();
        Html::addCssClass($htmlOptions, 'inline-list');
        foreach ($items as $item) {
            $listItems[] = \CHtml::tag('li', $htmlOptions, $item);
        }

        if (!empty($listItems)) {
            return \CHtml::tag('ul', $htmlOptions, implode("\n", $listItems));
        }
    }
624432
protected function createTableBuilder(array $options = array(), $type = DataTableType::class)
    {
        return $this->get(DataTableFactory::class)->createBuilder($type, $options);
    }
316017
public function createForm($options = null) {
        if ($this->useTabbedForms) {
            $form = new \Gems_TabForm($options);
        } else {
            $form = parent::createForm($options);
            //$form = new \Gems_Form_TableForm($options);
        }

        return $form;
    }
1315846
public static function modalFooter($content, $htmlOptions = array())
    {
        self::addCssClass('modal-footer', $htmlOptions);
        return self::tag('div', $htmlOptions, $content);
    }
55832
protected static function dropdownToggle($type, $label, $htmlOptions)
    {
        self::addCssClass('dropdown-toggle', $htmlOptions);
        $label .= ' <b class="caret"></b>';
        $htmlOptions['data-toggle'] = 'dropdown';
        return self::btn($type, $label, $htmlOptions);
    }
153808
private function dispatchTabPreRenderEvent(TabInterface $tab, array $parameters): TabEvent
    {
        $tabEvent = new TabEvent();
        $tabEvent->setData($tab);
        $tabEvent->setParameters($parameters);

        $this->eventDispatcher->dispatch(TabEvents::TAB_PRE_RENDER, $tabEvent);

        return $tabEvent;
    }
558601
public static function progressBar($width = 0, $htmlOptions = array())
    {
        self::addCssClass('progress', $htmlOptions);
        $color = TbArray::popValue('color', $htmlOptions);
        if (!empty($color)) {
            self::addCssClass('progress-' . $color, $htmlOptions);
        }
        if (TbArray::popValue('striped', $htmlOptions, false)) {
            self::addCssClass('progress-striped', $htmlOptions);
        }
        if (TbArray::popValue('animated', $htmlOptions, false)) {
            self::addCssClass('active', $htmlOptions);
        }
        $barOptions = TbArray::popValue('barOptions', $htmlOptions, array());
        $content = TbArray::popValue('content', $htmlOptions);
        if (!empty($content)) {
            $barOptions['content'] = $content;
        }
        $content = self::bar($width, $barOptions);
        return self::tag('div', $htmlOptions, $content);
    }
591639
public static function buttonToolbar(array $groups, $htmlOptions = array())
    {
        if (!empty($groups)) {
            self::addCssClass('btn-toolbar', $htmlOptions);
            $parentOptions = array(
                'color' => TbArray::popValue('color', $htmlOptions),
                'size' => TbArray::popValue('size', $htmlOptions),
                'disabled' => TbArray::popValue('disabled', $htmlOptions)
            );
            $output = self::openTag('div', $htmlOptions);
            foreach ($groups as $groupOptions) {
                if (isset($groupOptions['visible']) && $groupOptions['visible'] === false) {
                    continue;
                }
                $items = TbArray::popValue('items', $groupOptions, array());
                if (empty($items)) {
                    continue;
                }
                // todo: consider removing the support for htmlOptions.
                $options = TbArray::popValue('htmlOptions', $groupOptions, array());
                if (!empty($options)) {
                    $groupOptions = TbArray::merge($options, $groupOptions);
                }
                $groupOptions = TbArray::copyValues(array('color', 'size', 'disabled'), $parentOptions, $groupOptions);
                $output .= self::buttonGroup($items, $groupOptions);
            }
            $output .= '</div>';
            return $output;
        }
        return '';
    }
1287583
public static function buttonGroup(array $buttons, $htmlOptions = array())
    {
        if (!empty($buttons)) {
            self::addCssClass('btn-group', $htmlOptions);
            if (TbArray::popValue('vertical', $htmlOptions, false)) {
                self::addCssClass('btn-group-vertical', $htmlOptions);
            }
            $toggle = TbArray::popValue('toggle', $htmlOptions);
            $name = TbArray::popValue('name', $htmlOptions);
            if (!empty($name) && substr($name, -2) !== '[]') {
                $name .= '[]';
            }
            if (in_array($toggle, array(self::BUTTON_TOGGLE_CHECKBOX, self::BUTTON_TOGGLE_RADIO))) {
                $htmlOptions['data-toggle'] = 'buttons';
                if (empty($name)) {
                    if ($toggle === self::BUTTON_TOGGLE_CHECKBOX) {
                        $name = 'checkbox[]';
                    } elseif ($toggle === self::BUTTON_TOGGLE_RADIO) {
                        $name = 'radio[]';
                    }
                }
            } else {
                $htmlOptions['data-toggle'] = $toggle;
            }
            $parentOptions = array(
                'color' => TbArray::popValue('color', $htmlOptions),
                'size' => TbArray::popValue('size', $htmlOptions),
                'disabled' => TbArray::popValue('disabled', $htmlOptions)
            );
            $output = self::openTag('div', $htmlOptions);
            foreach ($buttons as $buttonOptions) {
                if (isset($buttonOptions['visible']) && $buttonOptions['visible'] === false) {
                    continue;
                }
                // todo: consider removing the support for htmlOptions.
                $options = TbArray::popValue('htmlOptions', $buttonOptions, array());
                if (!empty($options)) {
                    $buttonOptions = TbArray::merge($options, $buttonOptions);
                }
                $buttonLabel = TbArray::popValue('label', $buttonOptions, '');
                $buttonOptions = TbArray::copyValues(array('color', 'size', 'disabled'), $parentOptions, $buttonOptions);
                TbArray::defaultValue('color', 'default', $buttonOptions);
                $items = TbArray::popValue('items', $buttonOptions, array());
                if (!empty($items)) {
                    $output .= self::buttonDropdown($buttonLabel, $items, $buttonOptions);
                } else {
                    if (in_array($toggle, array(self::BUTTON_TOGGLE_CHECKBOX, self::BUTTON_TOGGLE_RADIO))) {
                        // Put the "button" label back into its options and add a few label options as well
                        $buttonOptions['label'] = $buttonLabel;
                        self::addCssClass(
                            array('btn', 'btn-' . TbArray::getValue('color', $buttonOptions)),
                            $buttonOptions['labelOptions']
                        );

                        $checked = TbArray::popValue('checked', $buttonOptions, false);
                        if ($checked) {
                            self::addCssClass('active', $buttonOptions['labelOptions']);
                        }
                        if ($toggle === self::BUTTON_TOGGLE_CHECKBOX) { // BS3 toggle uses checkbox...
                            $output .= self::checkBox($name, $checked, $buttonOptions);
                        } elseif ($toggle === self::BUTTON_TOGGLE_RADIO) { // ...or BS3 toggle uses radio
                            $output .= self::radioButton($name, $checked, $buttonOptions);
                        }
                    } else {
                        $output .= self::linkButton($buttonLabel, $buttonOptions);
                    }
                }
            }
            $output .= '</div>';
            return $output;
        }
        return '';
    }
16005
public static function navbar($content, $htmlOptions = array())
    {
        self::addCssClass('navbar', $htmlOptions);
        $display = TbArray::popValue('display', $htmlOptions);
        if (!empty($display)) {
            self::addCssClass('navbar-' . $display, $htmlOptions);
        }
        $color = TbArray::popValue('color', $htmlOptions, 'default');
        if (!empty($color)) {
            self::addCssClass('navbar-' . $color, $htmlOptions);
        }
        $htmlOptions['role'] = 'navigation';
        $output = self::openTag('nav', $htmlOptions);
        $output .= $content;
        $output .= '</nav>';
        return $output;
    }
763550
public static function renderElement($type, $content, $options = [])
    {
        $tag = ArrayHelper::remove($options, 'tag', 'div');

        $class = ArrayHelper::remove($options, 'class');
        Html::addCssClass($options, 'ui ' . $class . ' ' . $type);

        return Html::tag($tag, $content, $options);
    }
298457
public function htmlsd($type = ENT_COMPAT)
    {
        $this->string = htmlspecialchars_decode($this->string, $type);

        return $this;
    }
702357
public function renderDropDownMenu($container = null, array $options = array())
    {
        $menu = $this->getNavigationMenu()->renderMenu($container, $options);
        $query = new Query($menu, strtolower(mb_detect_encoding($menu)));
        $uls = $query->execute('li>ul');

        /** @var \DOMElement $ul */
        foreach ($uls as $key => $ul) {
            $caret = $uls->getDocument()->createDocumentFragment();
            $caret->appendXML('<b class="caret" />');
            $index = $key+1;

            $this->addCss('dropdown-menu', $ul);
            $ul->setAttribute('role', 'menu');
            $ul->setAttribute('aria-labelledby', "drop{$index}");

            $li = $ul->parentNode;
            $this->addCss('dropdown', $li);

            $a = $li->firstChild;
            $this->addCss('dropdown-toggle', $a);
            $a->setAttribute('role', 'button');
            $a->setAttribute('data-toggle', 'dropdown');
            $a->setAttribute('href', '#');
            $a->setAttribute('id', "drop{$index}");
            $a->appendChild($caret);
        }

        return preg_replace('~<(?:!DOCTYPE|/?(?:html|body))[^>]*>\s*~i', '', $uls->getDocument()->saveHTML());
    }
1112298
public function tab($name, array $options = [])
    {
        if (!isset($options['label'])) {
            $options['label'] = 'form.tab_' . $name;
        }

        return parent::tab($name, $options);
    }
985002
protected function setup_tabs($options = array()) {
        global $CFG, $PAGE;
        $groupmode = groups_get_activity_groupmode($this->cm);

        if (empty($CFG->usecomments) || !has_capability('mod/wiki:viewcomment', $PAGE->context)){
            unset($this->tabs['comments']);
        }

        if (!has_capability('mod/wiki:editpage', $PAGE->context)){
            unset($this->tabs['edit']);
        }

        if ($groupmode and $groupmode == VISIBLEGROUPS) {
            $currentgroup = groups_get_activity_group($this->cm);
            $manage = has_capability('mod/wiki:managewiki', $this->modcontext);
            $edit = has_capability('mod/wiki:editpage', $PAGE->context);
            if (!$manage and !($edit and groups_is_member($currentgroup))) {
                unset($this->tabs['edit']);
            }
        }

        if (empty($options)) {
            $this->tabs_options = array('activetab' => substr(get_class($this), 10));
        } else {
            $this->tabs_options = $options;
        }

    }
839546
static function tab($tabName, $tabProperty) {
		/** @var Structure $s */
		$s = df_config_structure();
		if (!isset($s->_data['tabs'])) {
			$s->getTabs();
		}
		return dfa(dfa($s->_data['tabs'], $tabName, []), $tabProperty);
	}