예제 #1
0
 public function display($tpl = null)
 {
     $this->app = JFactory::getApplication();
     $this->option = JRequest::getVar('option');
     $canDo = JHelperContent::getActions($this->option);
     $this->clearName = substr($this->option, 4);
     $this->view = str_replace(ucfirst($this->clearName) . 'View', '', get_class());
     $this->edit_view = strtolower(substr($this->view, 0, strlen($this->view) - 1));
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     ComponentHelper::addSubmenu($this->clearName);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     foreach ($this->items as &$item) {
         $item->order_up = true;
         $item->order_dn = true;
     }
     $this->addToolbar();
     if (!$canDo->get('core.show.giftcards') && !$canDo->get('core.show.groups')) {
         $this->app->redirect(JRoute::_('index.php?option=' . $this->option . '&view=searchs', false));
     }
     $this->sidebar = JHtmlSidebar::render();
     return parent::display($tpl);
 }
예제 #2
0
 public function display($tpl = null)
 {
     $this->option = JRequest::getVar('option');
     $this->clearName = substr($this->option, 4);
     $this->view = str_replace(ucfirst($this->clearName) . 'View', '', get_class());
     $this->edit_view = strtolower(substr($this->view, 0, strlen($this->view) - 1));
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     ComponentHelper::addSubmenu($this->clearName);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     foreach ($this->items as &$item) {
         $item->order_up = true;
         $item->order_dn = true;
     }
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     return parent::display($tpl);
 }