Example #1
0
     $section['icon'] = 'f009';
 }
 //if we are on the overview tab and we have group pages
 if ($section['name'] == 'overview' && count($this->pages) > 0) {
     $trueTab = strtolower(Request::getVar('active', 'overview'));
     $liClass = $trueTab != $this->tab ? '' : $liClass;
     if ($access == 'registered' && User::isGuest() || $access == 'members' && !in_array(User::get("id"), $this->group->get('members'))) {
         $item = "<li class=\"protected group-overview-tab\"><span data-icon=\"&#x{$section['icon']};\" class=\"disabled overview\">Overview</span>";
     } else {
         $item = "<li class=\"{$liClass} group-overview-tab\">";
         $item .= "<a class=\"overview\" data-icon=\"&#x{$section['icon']};\" title=\"{$this->group->get('description')}'s Overview Page\" href=\"{$link}\">Overview</a>";
     }
     // append pages html
     // only pass in the children of the root node
     // basically skip the overview page here
     $item .= \Components\Groups\Helpers\View::buildRecursivePageMenu($this->group, $this->pages[0]->get('children'));
 } else {
     if ($access == 'nobody') {
         $item = '';
     } elseif ($access == 'members' && !in_array(User::get('id'), $this->group->get('members'))) {
         $item = '<li class="protected members-only group-' . $class . '-tab" title="' . Lang::txt('This page is restricted to group members only!') . '">';
         $item .= '<span data-icon="&#x' . $section['icon'] . '" class="disabled ' . $class . '">' . $title . '</span>';
         $item .= '</li>';
     } elseif ($access == 'registered' && User::isGuest()) {
         $item = '<li class="protected registered-only group-' . $class . '-tab" title="' . Lang::txt('This page is restricted to registered hub users only!') . '">';
         $item .= '<span data-icon="&#x' . $section['icon'] . '" class="disabled ' . $class . '">' . $title . '</span>';
         $item .= '</li>';
     } else {
         //menu item meta data vars
         $metadata = isset($this->sectionsContent[$k]['metadata']) ? $this->sectionsContent[$k]['metadata'] : array();
         $meta_count = isset($metadata['count']) && $metadata['count'] != '' ? $metadata['count'] : '';