/** * Languages menus * * @since 1.0 */ public static function langMenu() { if (count($langs = icl_get_languages('skip_missing=0&orderby=code')) == 0) { return; } $html = \Drone\HTML::ul(); $main = $html->addNew('li'); $sub = $main->addNew('ul'); foreach ($langs as $lang) { $li = $sub->addNew('li'); $a = $li->addNew('a')->href($lang['url'])->title($lang['native_name'])->add($lang['native_name'], \Drone\HTML::span()->class('flag-' . $lang['language_code'])); if ($lang['active']) { $li->class = 'current'; $main->insertNew('a')->href('#')->title($lang['native_name'])->add(\Drone\HTML::span()->class('flag-' . $lang['language_code']), \Drone\HTML::i()->class('icon-down-open')); } } echo $html->html(); }
protected function onShortcode($content, $code, \Drone\HTML &$html) { $html = HTML::i()->class('icon-' . $this->so('name')); if ($this->so('color')) { if ($this->so('color') == 'leading') { $html->addClass('color'); } else { $html->style .= 'color: ' . $this->so('color') . ';'; } } if ($this->so('size')) { $html->style .= 'font-size: ' . $this->so('size') . 'px;'; } if ($this->so('advanced/class')) { $html->addClass($this->so('advanced/class')); } if ($this->so('advanced/style')) { $html->style .= $this->so('advanced/style'); } }