protected function addToolBar() { $state = $this->get('State'); $this->canDo = CommunitySurveysHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_COMMUNITYSURVEYS') . ': <small><small>[ ' . JText::_('COM_COMMUNITYSURVEYS_DASHBOARD') . ' ]</small></small>', 'logo.png'); if ($this->canDo->get('core.admin')) { JToolBarHelper::preferences(S_APP_NAME); } }
function display($tpl = null) { $model = $this->getModel(); $this->canDo = CommunitySurveysHelper::getActions(); $id = JRequest::getInt('id', 0); $result = $model->get_survey_responses($id); $this->assignRef('survey', $result->survey); $this->assignRef('responses', $result->responses); $this->assignRef('pagination', $result->pagination); $this->assignRef('lists', $result->lists); $this->addToolBar(); parent::display($tpl); }
protected function addToolBar() { $user = JFactory::getUser(); $this->state = $this->get('State'); $this->canDo = CommunitySurveysHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_COMMUNITYSURVEYS') . ': <small><small>[ ' . JText::_('COM_COMMUNITYSURVEYS_SURVEYS') . ' ]</small></small>', 'logo.png'); if ($this->canDo->get('core.admin')) { JToolBarHelper::preferences(S_APP_NAME); JToolBarHelper::divider(); } if (count($user->getAuthorisedCategories(S_APP_NAME, 'core.create')) > 0) { JToolBarHelper::addNew(); JToolBarHelper::custom('copy', 'copy', 'copy', 'Copy', true, false); } JToolBarHelper::custom('refresh', 'default', 'default', 'Refresh Hits', false, false); JToolBarHelper::divider(); if ($this->canDo->get('core.edit.state')) { JToolBarHelper::publish('surveys.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('surveys.unpublish', 'JTOOLBAR_UNPUBLISH', true); } if ($this->canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'surveys.delete', 'JTOOLBAR_DELETE'); } }