Esempio n. 1
0
 /**
  * Slp view display method
  * @return void
  */
 function display($tpl = null)
 {
     // Include helper submenu
     SlpHelper::addSubmenu('slp');
     // Get data from the model
     $items = $this->get('Items');
     $pagination = $this->get('Pagination');
     $state = $this->get('State');
     $this->sortDirection = $state->get('list.direction');
     $this->sortColumn = $state->get('list.ordering');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Assign data to the view
     $this->items = $items;
     $this->pagination = $pagination;
     // Set the toolbar
     $this->addToolBar();
     // Show sidebar
     if (JVERSION >= '3.0.0') {
         $this->sidebar = JHtmlSidebar::render();
     }
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
Esempio n. 2
0
 /**
  * display task
  *
  * @return void
  */
 function display($cachable = false, $urlparams = false)
 {
     // set default view if not set
     JRequest::setVar('view', JRequest::getCmd('view', 'Slp'));
     // call parent behavior
     parent::display($cachable);
     // set view
     $view = strtolower(JRequest::getVar('view'));
     // Set the submenu
     SlpHelper::addSubmenu($view);
 }