Beispiel #1
0
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $categoryId = $this->state->get('filter.category_id');
     $this->category = new Userideas\Category\Category(JFactory::getDbo());
     $this->category->load($categoryId);
     if ($this->params->get('show_cat_tags', 0)) {
         $this->category->setTagsHelper(new JHelperTags());
         $this->tags = $this->category->getTags();
     }
     $this->comments = $this->get('Comments');
     $user = JFactory::getUser();
     $this->userId = $user->get('id');
     // Set permission state. Is it possible to be edited items?
     $this->canEdit = $user->authorise('core.edit.own', 'com_userideas');
     if (empty($this->category)) {
         $app = JFactory::getApplication();
         /** @var $app JApplicationSite */
         $app->enqueueMessage(JText::_('COM_USERIDEAS_ERROR_INVALID_CATEGORY'), 'notice');
         $app->redirect(JRoute::_('index.php', false));
         return;
     }
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     $this->commentsEnabled = $this->params->get('comments_enabled', 1);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->prepareDocument();
     parent::display($tpl);
 }
Beispiel #2
0
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $categoryId = $this->state->get("filter.category_id");
     jimport("userideas.category");
     $this->category = new UserIdeasCategory(JFactory::getDbo());
     $this->category->load($categoryId);
     $this->comments = $this->get("Comments");
     $this->userId = JFactory::getUser()->get("id");
     if (empty($this->category)) {
         $app = JFactory::getApplication();
         /** @var $app JApplicationSite */
         $app->enqueueMessage(JText::_("COM_USERIDEAS_ERROR_INVALID_CATEGORY"), "notice");
         $app->redirect(JRoute::_('index.php', false));
         return;
     }
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->version = new UserIdeasVersion();
     $this->prepareDocument();
     parent::display($tpl);
 }
Beispiel #3
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Beispiel #4
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $this->comments = $this->get("Comments");
     $this->userId = JFactory::getUser()->id;
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->version = new UserIdeasVersion();
     $this->prepareDocument();
     parent::display($tpl);
 }
Beispiel #5
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $this->comments = $this->get("Comments");
     $user = JFactory::getUser();
     $this->userId = $user->get("id");
     // Set permission state. Is it possible to be edited items?
     $this->canEdit = $user->authorise('core.edit.own', 'com_userideas');
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     $this->commentsEnabled = $this->params->get("comments_enabled", 1);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->prepareDocument();
     parent::display($tpl);
 }