Пример #1
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        ?>
        <li <?php if ($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses(); ?>"<?php endif; ?> <?php if ($item->hasCssId() && $this->args['roknavmenu_fusion_enable_current_id']): ?>id="<?php echo $item->css_id; ?>"<?php endif; ?>>
        <?php if ($item->getType() == 'menuitem') : ?>
        <a <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?>"<?php endif; ?> <?php if ($item->hasLink()): ?>href="<?php echo $item->getLink(); ?>"<?php endif; ?> <?php if ($item->hasTarget()): ?>target="<?php echo $item->getTarget(); ?>"<?php endif; ?> <?php if ($item->hasAttribute('onclick')): ?>onclick="<?php echo $item->getAttribute('onclick'); ?>"<?php endif; ?><?php if ($item->hasLinkAttribs()): ?> <?php echo $item->getLinkAttribs(); ?><?php endif; ?>>
    <?php if ($item->hasImage()): ?>
            <img alt="<?php echo $item->getAlias; ?>" src="<?php echo $item->getImage(); ?>"/><?php endif; ?>
        <span><?php echo $item->getTitle();?></span>
            </a>
    <?php elseif ($item->getType() == 'separator') : ?>
        <span <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?> nolink"<?php endif; ?>>
                <span><?php echo $item->getTitle();?></span>
            </span>
    <?php endif; ?>
        <?php if ($item->hasChildren()): ?>
        <ul class="level<?php echo intval($item->getLevel()) + 2; ?>">
            <?php foreach ($item->getChildren() as $child) : ?>
    <?php $this->renderItem($child, $menu); ?>
    <?php endforeach; ?>
            </ul>
    <?php endif; ?>
        </li>
        <?php

    }
Пример #2
0
    protected function renderItem(JoomlaRokMenuNode &$item, &$menu)
    {
        ?>
        <li <?php if ($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses(); ?>"<?php endif; ?> <?php if (null != $item->getCssId()): ?>id="<?php echo $item->getCssId(); ?>"<?php endif; ?>>
        <?php if ($item->getType() == 'menuitem') : ?>
        <a <?php if ($item->hasLinkClasses()): ?>class="<?php echo $item->getLinkClasses(); ?>"<?php endif; ?> <?php if ($item->hasLink()): ?>href="<?php echo $item->getLink(); ?>"<?php endif; ?> <?php if (null != $item->getTarget()): ?>target="<?php echo $item->getTarget(); ?>"<?php endif; ?> <?php if ($item->hasLinkAttribs()): ?> <?php echo $item->getLinkAttribs(); ?><?php endif; ?>>
    <?php if (null != $item->getImage()): ?>
                <img alt="<?php echo $item->getAlias();?>" src="<?php echo $item->getImage();?>"/><?php endif; ?>
        <span <?php if ($item->hasSpanClasses()): ?>class="<?php echo $item->getSpanClasses(); ?>"<?php endif; ?>><?php echo $item->getTitle();?></span>
            </a>
    <?php elseif ($item->getType() == 'separator') : ?>
        <span <?php if ($item->hasSpanClasses()): ?>class="<?php echo $item->getSpanClasses(); ?>"<?php endif; ?>><?php echo $item->getTitle();?></span>
    <?php endif; ?>
        <?php if ($item->hasChildren()): ?>
        <ul>
                <?php foreach ($item->getChildren() as $child) : ?>
    <?php $this->renderItem($child, $menu); ?>
    <?php endforeach; ?>
        </ul>
    <?php endif; ?>
        </li>
        <?php

    }
Пример #3
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {

        $item_params = new JParameter($item->getParams());
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('splitmenu_item_subtext','');
        if ($item_subtext=='') $item_subtext = false;
        else $item->addLinkClass('subtext');
        ?>
        <li <?php if($item->hasListItemClasses()) : ?>class="<?php echo $item->getListItemClasses()?>"<?php endif;?> <?php if($item->hasCssId() && $this->activeid):?>id="<?php echo $item->getCssId();?>"<?php endif;?>>
            <?php if ($item->getType() == 'menuitem') : ?>
                <a <?php if($item->hasLinkClasses()):?>class="<?php echo $item->getLinkClasses();?>"<?php endif;?> <?php if($item->hasLink()):?>href="<?php echo $item->getLink();?>"<?php endif;?> <?php if($item->hasTarget()):?>target="<?php echo $item->getTarget();?>"<?php endif;?> <?php if ($item->hasAttribute('onclick')): ?>onclick="<?php echo $item->getAttribute('onclick'); ?>"<?php endif; ?><?php if ($item->hasLinkAttribs()): ?> <?php echo $item->getLinkAttribs(); ?><?php endif; ?>>
                    <span>
                    <?php echo $item->getTitle();?>
                    <?php if (!empty($item_subtext)) :?>
                    <em><?php echo $item_subtext; ?></em>
                    <?php endif; ?>
                    </span>
                </a>
            <?php elseif($item->getType() == 'separator') : ?>
                <span <?php if($item->hasLinkClasses()):?>class="<?php echo $item->getLinkClasses();?> nolink"<?php endif;?>>
                    <span>
                    <?php echo $item->getTitle();?>
                    <?php if (!empty($item_subtext)) :?>
                    <em><?php echo $item_subtext; ?></em>
                    <?php endif; ?>
                    </span>
                </span>
            <?php endif; ?>
            <?php if ($item->hasChildren()): ?>
            <ul class="level<?php echo intval($item->getLevel())+2; ?>">
                <?php foreach ($item->getChildren() as $child) : ?>
                    <?php showItemSplitmenu($child, $menu); ?>
                <?php endforeach; ?>
            </ul>
            <?php endif; ?>
        </li>
        <?php
    }
Пример #4
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        global $gantry;
        $wrapper_css = '';
        $ul_css = '';
        $group_css = '';
        $item_params = new JParameter($item->getParams());
        //get columns count for children
        $columns = $item_params->get('fusion_columns', 1);
        //get custom image
        $custom_image = $item_params->get('fusion_customimage');
        $custom_class = $item_params->get('fusion_customclass');
        if ($custom_image && $custom_image != -1) {
            $item->addLinkClass('image');
        } else {
            $item->addLinkClass('bullet');
        }
        if ($custom_class != '') {
            $item->addListItemClass($custom_class);
        }
        $dropdown_width = $item_params->get('fusion_dropdown_width');
        $column_widths = explode(",", $item_params->get('fusion_column_widths'));
        if (trim($columns) == '') {
            $columns = 1;
        }
        if (trim($dropdown_width) == '') {
            $dropdown_width = 180;
        }
        $wrapper_css = ' style="width:' . trim($dropdown_width) . 'px;"';
        $col_total = 0;
        $cols_left = $columns;
        if (trim($column_widths[0] != '')) {
            for ($i = 0; $i < $columns; $i++) {
                if (isset($column_widths[$i])) {
                    $ul_css[] = ' style="width:' . trim($column_widths[$i]) . 'px;"';
                    $col_total += $column_widths[$i];
                    $cols_left--;
                } else {
                    $col_width = floor(intval((intval($dropdown_width) - $col_total) / $cols_left));
                    $ul_css[] = ' style="width:' . $col_width . 'px;"';
                }
            }
        } else {
            for ($i = 0; $i < $columns; $i++) {
                $col_width = floor(intval($dropdown_width) / $columns);
                $ul_css[] = ' style="width:' . $col_width . 'px;"';
            }
        }
        $grouping = $item_params->get('fusion_children_group');
        if ($grouping == 1) {
            $item->addListItemClass('grouped-parent');
        }
        $child_type = $item_params->get('fusion_children_type');
        $child_type = $child_type == '' ? 'menuitems' : $child_type;
        $distribution = $item_params->get('fusion_distribution');
        $manual_distribution = explode(",", $item_params->get('fusion_manual_distribution'));
        $modules = array();
        if ($child_type == 'modules') {
            $modules_id = $item_params->get('fusion_modules');
            $ids = is_array($modules_id) ? $modules_id : array($modules_id);
            foreach ($ids as $id) {
                if ($module = $this->getModule($id)) {
                    $modules[] = $module;
                }
            }
            $group_css = ' type-module';
        } elseif ($child_type == 'modulepos') {
            $modules_pos = $item_params->get('fusion_module_positions');
            $positions = is_array($modules_pos) ? $modules_pos : array($modules_pos);
            foreach ($positions as $pos) {
                $mod = $this->getModules($pos);
                $modules = array_merge($modules, $mod);
            }
            $group_css = ' type-module';
        }
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('fusion_item_subtext', '');
        if ($item_subtext == '') {
            $item_subtext = false;
        } else {
            $item->addLinkClass('subtext');
        }
        //sort out module children:
        if ($child_type != "menuitems") {
            $document =& JFactory::getDocument();
            $renderer = $document->loadRenderer('module');
            $params = array('style' => 'fusion');
            $mod_contents = array();
            foreach ($modules as $mod) {
                $mod_contents[] = $renderer->render($mod, $params);
            }
            $item->setChildren($mod_contents);
            $link_classes = explode(' ', $item->getLinkClasses());
            //replace orphan with daddy if needed
            if ($item->hasChildren() && in_array('orphan', $link_classes)) {
                $link_classes[array_search('orphan', $link_classes)] = 'daddy';
            }
            $item->setLinkClasses($link_classes);
        }
        ?>
        <li <?php 
        if ($item->hasListItemClasses()) {
            ?>
class="<?php 
            echo $item->getListItemClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasCssId() && $this->activeid) {
            ?>
id="<?php 
            echo $item->getCssId();
            ?>
"<?php 
        }
        ?>
>
            <?php 
        if ($item->getType() == 'menuitem') {
            ?>
            	<?php 
            $urlCheck = JRoute::_($this->curPageURL($item->getLink()), true);
            if ($urlCheck) {
                $activeToTop = ' active-to-top';
            } else {
                $activeToTop = '';
            }
            ?>
                <a <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses() . $activeToTop;
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasLink()) {
                ?>
href="<?php 
                echo $item->getLink();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasTarget()) {
                ?>
target="<?php 
                echo $item->getTarget();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasAttribute('onclick')) {
                ?>
onclick="<?php 
                echo $item->getAttribute('onclick');
                ?>
"<?php 
            }
            if ($item->hasLinkAttribs()) {
                ?>
 <?php 
                echo $item->getLinkAttribs();
            }
            ?>
>
                    <span>
                    <?php 
            if ($custom_image && $custom_image != -1) {
                ?>
                        <img src="<?php 
                echo $gantry->templateUrl . "/images/icons/" . $custom_image;
                ?>
" alt="<?php 
                echo $custom_image;
                ?>
" />
                    <?php 
            }
            ?>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    <?php 
            if ($item->getParent() == RokNavMenu::TOP_LEVEL_PARENT_ID && $item->hasChildren()) {
                ?>
                    <span class="daddyicon"></span>
                    <?php 
            }
            ?>
                    </span>
                </a>
            <?php 
        } elseif ($item->getType() == 'separator') {
            ?>
                <span <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
 nolink"<?php 
            }
            ?>
>
                    <span>
                        <?php 
            if ($custom_image && $custom_image != -1) {
                ?>
                            <img src="<?php 
                echo $gantry->templateUrl . "/images/icons/" . $custom_image;
                ?>
" alt="<?php 
                echo $custom_image;
                ?>
" />
                        <?php 
            }
            ?>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    <?php 
            if ($item->getParent() == RokNavMenu::TOP_LEVEL_PARENT_ID && $item->hasChildren()) {
                ?>
                    <span class="daddyicon"></span>
                    <?php 
            }
            ?>
                    </span>
                </span>
            <?php 
        }
        ?>

            <?php 
        if ($item->hasChildren()) {
            ?>
                <?php 
            if ($grouping == 0 or $item->getLevel() == 0) {
                if ($distribution == 'inorder') {
                    $count = sizeof($item->getChildren());
                    $items_per_col = intval(ceil($count / $columns));
                    $children_cols = array_chunk($item->getChildren(), $items_per_col);
                } elseif ($distribution == 'manual') {
                    $children_cols = $this->array_fill($item->getChildren(), $columns, $manual_distribution);
                } else {
                    $children_cols = $this->array_chunkd($item->getChildren(), $columns);
                }
                $col_counter = 0;
                ?>
                    <div class="fusion-submenu-wrapper level<?php 
                echo intval($item->getLevel()) + 2;
                ?>
 primary-overlay-<?php 
                global $gantry;
                echo $gantry->get('primary-overlay');
                if ($columns > 1) {
                    echo ' columns' . $columns;
                }
                ?>
"<?php 
                echo $wrapper_css;
                ?>
>
                        <?php 
                foreach ($children_cols as $col) {
                    ?>

                        <ul class="level<?php 
                    echo intval($item->getLevel()) + 2;
                    ?>
"<?php 
                    echo $ul_css[$col_counter++];
                    ?>
>
                            <?php 
                    foreach ($col as $child) {
                        ?>
                                <?php 
                        if ($child_type == 'menuitems') {
                            ?>
                                    <?php 
                            $this->renderItem($child, $menu);
                            ?>
                                <?php 
                        } else {
                            ?>
                                    <li>
                                        <div class="fusion-modules item">
                                        <?php 
                            echo $child;
                            ?>
                                        </div>
                                    </li>
                                <?php 
                        }
                        ?>
                            <?php 
                    }
                    ?>
                        </ul>

                        <?php 
                }
                ?>
                        <div class="drop-bot"></div>
                    </div>
                <?php 
            } else {
                ?>
                    <div class="fusion-grouped<?php 
                echo $group_css;
                ?>
">
                        <ol>
                            <?php 
                foreach ($item->getChildren() as $child) {
                    ?>
                                <?php 
                    if ($child_type == 'menuitems') {
                        ?>
                                    <?php 
                        $this->renderItem($child, $menu);
                        ?>
                                <?php 
                    } else {
                        ?>
                                    <li>
                                        <div class="fusion-modules item">
                                        <?php 
                        echo $child;
                        ?>
                                        </div>
                                    </li>
                                <?php 
                    }
                    ?>
                            <?php 
                }
                ?>
                        </ol>
                    </div>

                <?php 
            }
            ?>
            <?php 
        }
        ?>
        </li>
        <?php 
    }
Пример #5
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        $item_params = $item->getParams();
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('splitmenu_item_subtext', '');
        ?>
        <li id="<?php 
        echo $item->getCssId();
        ?>
">
            <?php 
        if ($item->getType() == 'menuitem') {
            ?>
                <a <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasLink()) {
                ?>
href="<?php 
                echo $item->getLink();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasTarget()) {
                ?>
target="<?php 
                echo $item->getTarget();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasAttribute('onclick')) {
                ?>
onclick="<?php 
                echo $item->getAttribute('onclick');
                ?>
"<?php 
            }
            if ($item->hasLinkAttribs()) {
                ?>
 <?php 
                echo $item->getLinkAttribs();
            }
            ?>
>
                    <span>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    </span>
                </a>
            <?php 
        } elseif ($item->getType() == 'separator') {
            ?>
                <a href="#" <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
 nolink"<?php 
            }
            ?>
><span <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
 nolink"<?php 
            }
            ?>
>
                    <span>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    </span>
                </span></a>
            <?php 
        }
        ?>
            <?php 
        if ($item->hasChildren()) {
            ?>
                    <ul class="level<?php 
            echo intval($item->getLevel()) + 2;
            ?>
">
                        <?php 
            foreach ($item->getChildren() as $child) {
                ?>
                            <?php 
                $this->renderItem($child, $menu);
                ?>
                        <?php 
            }
            ?>
                    </ul>
            <?php 
        }
        ?>
        </li>
        <?php 
    }
Пример #6
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        $item_params = $item->getParams();
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('splitmenu_item_subtext', '');
        if ($item_subtext == '') {
            $item_subtext = false;
        } else {
            $item->addLinkClass('subtext');
        }
        ?>
        <li <?php 
        if ($item->hasListItemClasses()) {
            ?>
class="<?php 
            echo $item->getListItemClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasCssId() && $this->activeid) {
            ?>
id="<?php 
            echo $item->getCssId();
            ?>
"<?php 
        }
        ?>
>
            <?php 
        if ($item->getType() == 'menuitem') {
            ?>
            	<?php 
            $urlCheck = JRoute::_($this->curPageURL($item->getLink()), true);
            if ($urlCheck) {
                $activeToTop = ' active-to-top';
            } else {
                $activeToTop = '';
            }
            ?>
                <a <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses() . $activeToTop;
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasLink()) {
                ?>
href="<?php 
                echo $item->getLink();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasTarget()) {
                ?>
target="<?php 
                echo $item->getTarget();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasAttribute('onclick')) {
                ?>
onclick="<?php 
                echo $item->getAttribute('onclick');
                ?>
"<?php 
            }
            if ($item->hasLinkAttribs()) {
                ?>
 <?php 
                echo $item->getLinkAttribs();
            }
            ?>
>
                    <span>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    <?php 
            if ($item->getParent() == 0 && $item->hasChildren()) {
                ?>
                    <span class="daddyicon"></span>
                    <?php 
            }
            ?>
					<?php 
            if ($item->getCssId()) {
                ?>
					<span class="arrow-indicator"></span>
					<?php 
            }
            ?>
                    </span>
                </a>
            <?php 
        } elseif ($item->getType() == 'separator') {
            ?>
                <span <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
 nolink"<?php 
            }
            ?>
>
                    <span>
                    <?php 
            echo $item->getTitle();
            ?>
                    <?php 
            if (!empty($item_subtext)) {
                ?>
                    <em><?php 
                echo $item_subtext;
                ?>
</em>
                    <?php 
            }
            ?>
                    <?php 
            if ($item->getParent() == 0 && $item->hasChildren()) {
                ?>
                    <span class="daddyicon"></span>
                    <?php 
            }
            ?>
                    </span>
                </span>
            <?php 
        }
        ?>
            <?php 
        if ($item->hasChildren()) {
            ?>
            <ul class="level<?php 
            echo intval($item->getLevel()) + 2;
            ?>
">
                <?php 
            foreach ($item->getChildren() as $child) {
                ?>
                    <?php 
                $this->renderItem($child, $menu);
                ?>
                <?php 
            }
            ?>
            </ul>
            <?php 
        }
        ?>
        </li>
        <?php 
    }
Пример #7
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        /** @var $gantry Gantry */
        global $gantry;
        $wrapper_css = '';
        $ul_css = '';
        $group_css = '';
        $item_params = $item->getParams();
        //get columns count for children
        $columns = $item_params->get('dropdown_columns', 1);
        //get custom image
        $custom_image = $item_params->get('dropdown_customimage');
        //get the custom icon
        $custom_icon = $item_params->get('dropdown_customicon');
        //get the custom class
        $custom_class = $item_params->get('dropdown_customclass');
        //add default link class
        $item->addLinkClass('item');
        if ($custom_image && $custom_image != -1) {
            $item->addLinkClass('image');
        }
        if ($custom_icon && $custom_icon != -1) {
            $item->addLinkClass('icon');
        }
        if ($custom_class != '') {
            $item->addListItemClass($custom_class);
        }
        $dropdown_width = intval(trim($item_params->get('dropdown_dropdown_width')));
        $column_widths = explode(",", $item_params->get('dropdown_column_widths'));
        if (trim($columns) == '') {
            $columns = 1;
        }
        if ($dropdown_width == 0) {
            $dropdown_width = 180;
        }
        $wrapper_css = ' style="width:' . $dropdown_width . 'px;"';
        $col_total = 0;
        $cols_left = $columns;
        if (trim($column_widths[0] != '')) {
            for ($i = 0; $i < $columns; $i++) {
                if (isset($column_widths[$i])) {
                    $ul_css[] = ' style="width:' . trim(intval($column_widths[$i])) . 'px;"';
                    $col_total += intval($column_widths[$i]);
                    $cols_left--;
                } else {
                    $col_width = floor(intval((intval($dropdown_width) - $col_total) / $cols_left));
                    $ul_css[] = ' style="width:' . $col_width . 'px;"';
                }
            }
        } else {
            for ($i = 0; $i < $columns; $i++) {
                $col_width = floor(intval($dropdown_width) / $columns);
                $ul_css[] = ' style="width:' . $col_width . 'px;"';
            }
        }
        $grouping = $item_params->get('dropdown_children_group');
        if ($grouping == 1) {
            $item->addListItemClass('grouped');
        }
        $child_type = $item_params->get('dropdown_children_type');
        $child_type = $child_type == '' ? 'menuitems' : $child_type;
        $distribution = $item_params->get('dropdown_distribution');
        $manual_distribution = explode(",", $item_params->get('dropdown_manual_distribution'));
        $modules = array();
        if ($child_type == 'modules') {
            $modules_id = $item_params->get('dropdown_modules');
            $ids = is_array($modules_id) ? $modules_id : array($modules_id);
            foreach ($ids as $id) {
                if ($module = $this->getModule($id)) {
                    $modules[] = $module;
                }
            }
            $group_css = ' type-module';
        } elseif ($child_type == 'modulepos') {
            $modules_pos = $item_params->get('dropdown_module_positions');
            $positions = is_array($modules_pos) ? $modules_pos : array($modules_pos);
            foreach ($positions as $pos) {
                $mod = $this->getModules($pos);
                $modules = array_merge($modules, $mod);
            }
            $group_css = ' type-module';
        }
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('dropdown_item_subtext', '');
        if ($item_subtext == '') {
            $item_subtext = false;
        } else {
            $item->addLinkClass('subtext');
        }
        //sort out module children:
        if ($child_type != "menuitems") {
            $document = JFactory::getDocument();
            $renderer = $document->loadRenderer('module');
            $params = array('style' => 'dropdown');
            $mod_contents = array();
            foreach ($modules as $mod) {
                $mod_contents[] = $renderer->render($mod, $params);
            }
            $item->setChildren($mod_contents);
            $link_classes = explode(' ', $item->getLinkClasses());
            $item->setLinkClasses($link_classes);
        }
        if ($item->getType() != 'menuitem') {
            $item->setLink('javascript:void(0);');
        }
        ?>
        <li <?php 
        if ($item->hasListItemClasses()) {
            ?>
class="<?php 
            echo $item->getListItemClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasCssId() && $this->activeid) {
            ?>
id="<?php 
            echo $item->getCssId();
            ?>
"<?php 
        }
        ?>
>

            <a <?php 
        if ($item->hasLinkClasses()) {
            ?>
class="<?php 
            echo $item->getLinkClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasLink()) {
            ?>
href="<?php 
            echo $item->getLink();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasTarget()) {
            ?>
target="<?php 
            echo $item->getTarget();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasAttribute('onclick')) {
            ?>
onclick="<?php 
            echo $item->getAttribute('onclick');
            ?>
"<?php 
        }
        if ($item->hasLinkAttribs()) {
            ?>
 <?php 
            echo $item->getLinkAttribs();
        }
        ?>
>

                <?php 
        if ($custom_image && $custom_image != -1) {
            ?>
                    <img class="menu-image" src="<?php 
            echo $gantry->templateUrl . "/images/icons/" . $custom_image;
            ?>
" alt="<?php 
            echo $custom_image;
            ?>
" />
                <?php 
        }
        ?>
                <?php 
        if ($custom_icon && $custom_icon != -1) {
            echo '<i class="' . $custom_icon . '">' . $item->getTitle() . '</i>';
        } else {
            echo $item->getTitle();
        }
        if (!empty($item_subtext)) {
            echo '<em>' . $item_subtext . '</em>';
        }
        ?>
                <?php 
        // Comment this out if you don't need a 1px bottom border fix
        if ($item->hasChildren()) {
            ?>
                <span class="border-fixer"></span>
                <?php 
        }
        ?>
            </a>


            <?php 
        if ($item->hasChildren()) {
            ?>

                <?php 
            if ($grouping == 0 or $item->getLevel() == 0) {
                if ($distribution == 'inorder') {
                    $count = sizeof($item->getChildren());
                    $items_per_col = intval(ceil($count / $columns));
                    $children_cols = array_chunk($item->getChildren(), $items_per_col);
                } elseif ($distribution == 'manual') {
                    $children_cols = $this->array_fill($item->getChildren(), $columns, $manual_distribution);
                } else {
                    $children_cols = $this->array_chunkd($item->getChildren(), $columns);
                }
                $col_counter = 0;
                ?>
                    <div class="dropdown <?php 
                if ($item->getLevel() > 0) {
                    echo 'flyout ';
                }
                echo 'columns-' . $columns . ' ';
                ?>
"<?php 
                echo $wrapper_css;
                ?>
>
                        <?php 
                foreach ($children_cols as $col) {
                    ?>
                        <div class="column col<?php 
                    echo intval($col_counter) + 1;
                    ?>
" <?php 
                    echo $ul_css[$col_counter++];
                    ?>
>
                            <ul class="l<?php 
                    echo $item->getLevel() + 2;
                    ?>
">
                                <?php 
                    foreach ($col as $child) {
                        ?>
                                    <?php 
                        if ($child_type == 'menuitems') {
                            ?>
                                        <?php 
                            $this->renderItem($child, $menu);
                            ?>
                                    <?php 
                        } else {
                            ?>
                                        <li class="modules">
                                            <div class="module-content">
                                                <?php 
                            echo $child;
                            ?>
                                            </div>
                                        </li>
                                    <?php 
                        }
                        ?>
                                <?php 
                    }
                    ?>
                            </ul>
                        </div>
                        <?php 
                }
                ?>
                    </div>

                <?php 
            } else {
                ?>

                    <ol class="<?php 
                echo $group_css;
                ?>
">
                        <?php 
                foreach ($item->getChildren() as $child) {
                    ?>
                            <?php 
                    if ($child_type == 'menuitems') {
                        ?>
                                <?php 
                        $this->renderItem($child, $menu);
                        ?>
                            <?php 
                    } else {
                        ?>
                                <li class="modules">
                                    <div class="module-content">
                                        <?php 
                        echo $child;
                        ?>
                                    </div>
                                </li>
                            <?php 
                    }
                    ?>
                        <?php 
                }
                ?>
                    </ol>

                <?php 
            }
            ?>
            <?php 
        }
        ?>
        </li>
        <?php 
    }
Пример #8
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        global $gantry;
        $wrapper_css = '';
        $item_params = $item->getParams();
        //add default link class
        $item->addLinkClass('item');
        $dropdown_width = intval(trim($item_params->get('dropdown_dropdown_width')));
        if ($dropdown_width == 0) {
            $dropdown_width = 180;
        }
        $wrapper_css = ' style="width:' . $dropdown_width . 'px;"';
        if ($item->getType() != 'menuitem') {
            $item->setLink('javascript:void(0);');
        }
        ?>
        <li <?php 
        if ($item->hasListItemClasses()) {
            ?>
class="<?php 
            echo $item->getListItemClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasCssId() && $this->activeid) {
            ?>
id="<?php 
            echo $item->getCssId();
            ?>
"<?php 
        }
        ?>
>

            <a <?php 
        if ($item->hasLinkClasses()) {
            ?>
class="<?php 
            echo $item->getLinkClasses();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasLink()) {
            ?>
href="<?php 
            echo $item->getLink();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasTarget()) {
            ?>
target="<?php 
            echo $item->getTarget();
            ?>
"<?php 
        }
        ?>
 <?php 
        if ($item->hasAttribute('onclick')) {
            ?>
onclick="<?php 
            echo $item->getAttribute('onclick');
            ?>
"<?php 
        }
        if ($item->hasLinkAttribs()) {
            ?>
 <?php 
            echo $item->getLinkAttribs();
        }
        ?>
>
                <?php 
        echo $item->getTitle();
        ?>
            </a>

            <?php 
        if ($item->hasChildren()) {
            ?>
			<div class="dropdown <?php 
            if ($item->getLevel() > 0) {
                echo 'flyout ';
            }
            ?>
" <?php 
            echo $wrapper_css;
            ?>
>
				<div class="column">
					<ul class="level<?php 
            echo intval($item->getLevel()) + 2;
            ?>
">
					<?php 
            foreach ($item->getChildren() as $child) {
                ?>
						<?php 
                $this->renderItem($child, $menu);
                ?>
					<?php 
            }
            ?>
					</ul>
				</div>
			</div>
            <?php 
        }
        ?>
 
        </li>
        <?php 
    }
Пример #9
0
    protected function renderItem(JoomlaRokMenuNode &$item, RokMenuNodeTree &$menu)
    {
        global $gantry;
        $item_params = $item->getParams();
        //not so elegant solution to add subtext
        $item_subtext = $item_params->get('splitmenu_item_subtext', '');
        if ($item_subtext == '') {
            $item_subtext = false;
        } else {
            $item->addLinkClass('subtext');
        }
        //get custom image
        $custom_image = $item_params->get('splitmenu_customimage');
        //get the custom icon
        $custom_icon = $item_params->get('splitmenu_customicon');
        //get the custom class
        $custom_class = $item_params->get('splitmenu_customclass');
        //add default link class
        $item->addLinkClass('item');
        if ($custom_image && $custom_image != -1) {
            $item->addLinkClass('image');
        }
        if ($custom_icon && $custom_icon != -1) {
            $item->addLinkClass('icon');
        }
        if ($custom_class != '') {
            $item->addListItemClass($custom_class);
        }
        if ($item_params->get('splitmenu_menu_entry_type', 'normal') == 'normal') {
            if ($item->getType() != 'menuitem') {
                $item->setLink('javascript:void(0);');
            }
            ?>
        <li <?php 
            if ($item->hasListItemClasses()) {
                ?>
class="<?php 
                echo $item->getListItemClasses();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasCssId() && $this->activeid) {
                ?>
id="<?php 
                echo $item->getCssId();
                ?>
"<?php 
            }
            ?>
>

                <a <?php 
            if ($item->hasLinkClasses()) {
                ?>
class="<?php 
                echo $item->getLinkClasses();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasLink()) {
                ?>
href="<?php 
                echo $item->getLink();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasTarget()) {
                ?>
target="<?php 
                echo $item->getTarget();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasAttribute('onclick')) {
                ?>
onclick="<?php 
                echo $item->getAttribute('onclick');
                ?>
"<?php 
            }
            if ($item->hasLinkAttribs()) {
                ?>
 <?php 
                echo $item->getLinkAttribs();
            }
            ?>
>

                <?php 
            if ($custom_image && $custom_image != -1) {
                ?>
                    <img class="menu-image" src="<?php 
                echo $gantry->templateUrl . "/images/icons/" . $custom_image;
                ?>
" alt="<?php 
                echo $custom_image;
                ?>
" />
                    <?php 
            }
            ?>
                <?php 
            if ($custom_icon && $custom_icon != -1) {
                echo '<i class="' . $custom_icon . '">' . $item->getTitle() . '</i>';
            } else {
                echo $item->getTitle();
            }
            if (!empty($item_subtext)) {
                echo '<em>' . $item_subtext . '</em>';
            }
            ?>
                </a>

            <?php 
            if ($item->hasChildren()) {
                ?>
            <ul class="level<?php 
                echo intval($item->getLevel()) + 2;
                ?>
">
                <?php 
                foreach ($item->getChildren() as $child) {
                    ?>
                    <?php 
                    $this->renderItem($child, $menu);
                    ?>
                <?php 
                }
                ?>
            </ul>
            <?php 
            }
            ?>
        </li>
		<?php 
        } else {
            $item->addListItemClass('menu-module');
            $module_id = $item_params->get('splitmenu_menu_module');
            $menu_module = $this->getModule($module_id);
            $document = JFactory::getDocument();
            $renderer = $document->loadRenderer('module');
            $params = array('style' => 'splitmenu');
            $module_content = $renderer->render($menu_module, $params);
            ?>
		<li <?php 
            if ($item->hasListItemClasses()) {
                ?>
class="<?php 
                echo $item->getListItemClasses();
                ?>
"<?php 
            }
            ?>
 <?php 
            if ($item->hasCssId() && $this->activeid) {
                ?>
id="<?php 
                echo $item->getCssId();
                ?>
"<?php 
            }
            ?>
>
			<?php 
            echo $module_content;
            ?>
		</li>
        <?php 
        }
    }