/** * Permet l'affichage en arbre dans le listing des zones * * @param Area $area * @param int $parent * @return string */ function showChildren($area, $itemsSlug, $items) { $areas = $area['__children']; echo !count($areas) ? '' : '<ul>'; foreach ($areas as $area) { echo '<li>'; /* S'il existe un item qui porte le meme slug qu'un menu, on utilise cet item */ if (in_array($area['slug'], $itemsSlug->getRawValue())) { /* On récupère la clé pour taper dans le 2e tableau */ $key = array_search($area['slug'], $itemsSlug->getRawValue()); /* On test si c'est un lien ou une page */ if ($items[$key]['type'] == 'link') { echo '<a class="top-menu" href="' . $items[$key]['url'] . '" title="' . $area['title'] . '">' . $area['name'] . '</a>'; } else { echo '<a class="top-menu" href="' . url_for('item_show', array('slug' => $items[$key]['slug'], 'sf_format' => 'html')) . '" title="' . $area['title'] . '">' . $area['name'] . '</a>'; } /* Sinon on affiche par défaut */ } else { echo '<a class="top-menu" href="' . url_for('article_by_category_list', array('category' => $area['slug'], 'sf_format' => 'html')) . '" title="' . $area['title'] . '">'; echo $area['name']; echo '</a>'; } showChildren($area, $itemsSlug, $items); echo '</li>'; } echo !count($areas) ? '' : '</ul>'; }
function showChildren($item, $level) { $class = array('operation', 'task', 'role'); $type = array(Yii::t('RbacuiModule.rbacui', 'operation'), Yii::t('RbacuiModule.rbacui', 'task'), Yii::t('RbacuiModule.rbacui', 'role')); echo '<div class="' . $class[$item->type] . ' level' . $level . '" title="' . $type[$item->type] . ': ' . $item->description . '">' . $item->name . '</div>'; $level++; foreach ($item->children as $name => $authItem) { showChildren($authItem, $level); } }
function showChildren($category, $prefix = "", &$allow_forum) { $kunena_db =& JFactory::getDBO(); $kunena_db->setQuery("SELECT id, name, parent FROM #__fb_categories WHERE parent='{$category}' AND published='1' ORDER BY ordering"); $forums = $kunena_db->loadObjectList(); check_dberror("Unable to load categories."); foreach ($forums as $forum) { if (in_array($forum->id, $allow_forum)) { echo "<option value=\"{$forum->id}\">{$prefix} {$forum->name}</option>"; } showChildren($forum->id, $prefix . "---", $allow_forum); } }
<?
?> " title="<?php echo $area['title']; ?> "> <strong><?php echo $area['name']; ?> </strong> <span><?php echo $area['baseline']; ?> </span> </a> <?php showChildren($area, $itemsSlug, $items); ?> </li> <?php } ?> </ul> <form id="responsive-nav" action="insert_action" method="post"> <?php $areas_responsive = $menus; ?> <select class="chzn-select"> <?php foreach ($areas_responsive as $area_responsive) {