Example #1
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   12.1
  * @throws  RuntimeException
  */
 public function render()
 {
     $this->items = $this->model->getIssues();
     $this->filterForm = $this->model->getFilterForm();
     $this->defaultTitle = JText::_('COM_MONITOR_ISSUES');
     $this->setLayout('default');
     $projectId = $this->model->getProjectId();
     if ($projectId !== null) {
         $this->buttons['new-issue'] = array('url' => 'index.php?option=com_monitor&task=issue.edit&project_id=' . $projectId, 'text' => 'COM_MONITOR_CREATE_ISSUE', 'title' => 'COM_MONITOR_CREATE_ISSUE', 'icon' => 'icon-new');
         $user = JFactory::getUser();
         if (!$user->guest) {
             $this->modelSubscription = new MonitorModelSubscription();
             $this->modelNotifications = new MonitorModelNotifications();
             if ($this->params->get('enable_notifications', 1)) {
                 $subscribed = $this->modelSubscription->isSubscriberProject($projectId, $user->id);
                 $task = $subscribed ? 'unsubscribe' : 'subscribe';
                 $this->buttons['subscribe'] = array('url' => 'index.php?option=com_monitor&task=project.' . $task . '&id=' . $projectId . '&return=' . base64_encode(JUri::getInstance()->toString()), 'text' => $subscribed ? 'COM_MONITOR_UNSUBSCRIBE_PROJECT' : 'COM_MONITOR_SUBSCRIBE_PROJECT', 'title' => $subscribed ? 'COM_MONITOR_UNSUBSCRIBE_PROJECT_DESC' : 'COM_MONITOR_SUBSCRIBE_PROJECT_DESC', 'icon' => $subscribed ? 'icon-star' : 'icon-star-empty');
             }
             $this->buttons['all-read'] = array('url' => 'index.php?option=com_monitor&task=project.read&id=' . $projectId, 'text' => 'COM_MONITOR_PROJECT_MARK_ALL_READ', 'title' => 'COM_MONITOR_PROJECT_MARK_ALL_READ_DESC', 'icon' => 'icon-eye');
         }
     }
     return parent::render();
 }