Ejemplo n.º 1
0
 public function render()
 {
     $start = $this->module->params->get('start_level');
     $end = $this->module->params->get('end_level');
     $children = $this->module->params->get('show_children', 'active');
     $pages = $this->getObject('application.pages');
     $groups = $this->getObject('user')->getGroups();
     // Make sure that pages without an assigned group are also included.
     $groups[] = 0;
     $this->active = $pages->getActive();
     $this->pages = $pages->find(array('pages_menu_id' => $this->module->params->get('menu_id'), 'hidden' => 0, 'users_group_id' => $groups));
     foreach (clone $this->pages as $page) {
         $extract = false;
         // Extract if level is lower than start.
         if ($page->level < $start) {
             $extract = true;
         }
         // Extract if level is higher than end.
         if (!$extract && $end > $start && $page->level > $end) {
             $extract = true;
         }
         // Extract if path is not in the active branch.
         if (!$extract && $children == 'active' && $page->level > 1) {
             if (implode('/', $page->getParentIds()) != implode('/', array_slice(explode('/', $this->active->path), 0, count($page->getParentIds())))) {
                 $extract = true;
             }
         }
         if ($extract) {
             $this->pages->extract($page);
         }
     }
     $this->show_title = $this->module->params->get('show_title', false);
     $this->class = $this->module->params->get('class', 'nav');
     return parent::render();
 }
Ejemplo n.º 2
0
 public function render()
 {
     $this->name = $this->module->params->get('name');
     $this->usesecure = $this->module->params->get('usesecure');
     $this->show_title = $this->module->params->get('show_title', false);
     $this->allow_registration = $this->getObject('application.extensions')->users->params->get('allowUserRegistration');
     return parent::render();
 }
Ejemplo n.º 3
0
 public function render()
 {
     $this->form_class = $this->module->params->get('form_class', 'form-search');
     $this->input_class = $this->module->params->get('input_class', 'span2 search-query');
     $this->button_class = $this->module->params->get('button_class', 'btn');
     $this->placeholder = $this->module->params->get('placeholder', 'Search articles');
     $this->item_id = $this->module->params->get('item_id', null);
     return parent::render();
 }
Ejemplo n.º 4
0
 public function render()
 {
     $list = (array) $this->getObject('application')->getPathway()->items;
     $params = $this->module->params;
     if ($params->get('homeText')) {
         $item = new \stdClass();
         $item->name = $params->get('homeText', JText::_('Home'));
         $home = $this->getObject('application.pages')->getHome();
         $item->link = $this->getRoute($home->getLink()->getQuery() . '&Itemid=' . $home->id);
         array_unshift($list, $item);
     }
     $this->list = $list;
     return parent::render();
 }
Ejemplo n.º 5
0
 /**
  * Renders the views output
  *
  * @return string
  */
 public function render()
 {
     // Preparing the sort and direction model states.
     switch ($this->module->params->get('sort_by', 'newest')) {
         default:
         case 'newest':
             $sort = 'created_on';
             $direction = 'DESC';
             break;
         case 'oldest':
             $sort = 'created_on';
             $direction = 'ASC';
             break;
         case 'ordering':
             $sort = 'ordering';
             $direction = 'ASC';
             break;
     }
     // Prepare category state.
     $category = str_replace(' ', '', $this->module->params->get('category', ''));
     if ($category) {
         $category = explode(',', $category);
     }
     // Prepare section state.
     $section = str_replace(' ', '', $this->module->params->get('section', ''));
     if ($section) {
         $section = explode(',', $section);
     }
     // Get access id.
     $user = $this->getObject('user');
     $articles = $this->getObject('com:articles.model.articles')->set(array('access' => $user->isAuthentic(), 'published' => 1, 'limit' => $this->module->params->get('count', 5), 'sort' => $sort, 'direction' => $direction, 'section' => $section, 'category' => $category))->getRowset();
     $this->articles = $articles;
     $this->show_title = $this->module->params->get('show_title', false);
     // Set layout based on params.
     $this->setLayout($this->module->params->get('show_content', 0) ? 'articles' : 'links');
     return parent::render();
 }
Ejemplo n.º 6
0
 public function render()
 {
     $this->show_title = $this->module->params->get('show_title', false);
     $this->class = $this->module->params->get('class', false);
     return parent::render();
 }