/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { $user = JFactory::getUser(); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('Form'); $this->activeFilters = $this->get('ActiveFilters'); $this->state = $this->get('State'); // Ordering $this->ordering = array(); if ($this->items) { foreach ($this->items as &$item) { $this->ordering[0][] = $item->id; } } // Edit permission $this->canEdit = false; if ($user->authorise('core.edit', 'com_tracks')) { $this->canEdit = true; } // Edit state permission $this->canEditState = false; if ($user->authorise('core.edit.state', 'com_tracks')) { $this->canEditState = true; } parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('Form'); $this->activeFilters = $this->get('ActiveFilters'); $this->state = $this->get('State'); $this->function = JFactory::getApplication()->input->getCmd('function', 'jSelectProjectround'); parent::display($tpl); }
/** * Display the edit page * * @param string $tpl The template file to use * * @return string */ public function display($tpl = null) { $user = JFactory::getUser(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->canConfig = false; if ($user->authorise('core.admin', 'com_tracks')) { $this->canConfig = true; } // Display the template parent::display($tpl); }