Exemplo n.º 1
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFforumHelper::getActions();
     $state = $this->get('State');
     PFToolbar::button('COM_PROJECTFORK_ACTION_NEW', 'topicform.add', false, array('access' => $access->get('core.create')));
     $options = array();
     if ($access->get('core.edit.state')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_PUBLISH', 'task' => $this->getName() . '.publish');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_UNPUBLISH', 'task' => $this->getName() . '.unpublish');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_ARCHIVE', 'task' => $this->getName() . '.archive');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_CHECKIN', 'task' => $this->getName() . '.checkin');
     }
     if ($state->get('filter.published') == -2 && $access->get('core.delete')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_DELETE', 'task' => $this->getName() . '.delete');
     } elseif ($access->get('core.edit.state')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_TRASH', 'task' => $this->getName() . '.trash');
     }
     if (count($options)) {
         PFToolbar::listButton($options);
     }
     PFToolbar::filterButton($this->state->get('filter.isset'));
     return PFToolbar::render();
 }
Exemplo n.º 2
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $dir = $this->items['directory'];
     $access = PFrepoHelper::getActions('directory', $dir->id);
     if ($dir->id > 1) {
         $items = array();
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_NEW_FILE', 'task' => 'fileform.add', 'options' => array('access' => $access->get('core.create') && !defined('PFDEMO')));
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_NEW_DIRECTORY', 'task' => 'directoryform.add', 'options' => array('access' => $access->get('core.create')));
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_NEW_NOTE', 'task' => 'noteform.add', 'options' => array('access' => $access->get('core.create')));
         PFToolbar::dropdownButton($items);
         $items = array();
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_DELETE', 'task' => $this->getName() . '.delete', 'options' => array('access' => $access->get('core.delete')));
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_CHECKIN', 'task' => $this->getName() . '.checkin');
         if (count($items)) {
             PFToolbar::listButton($items);
         }
     }
     PFToolbar::filterButton($this->state->get('filter.isset'));
     return PFToolbar::render();
 }
Exemplo n.º 3
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFtasksHelper::getActions();
     $state = $this->get('State');
     $create = $access->get('core.create');
     if ($create) {
         $items = array();
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_NEW_TASK', 'task' => 'taskform.add');
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_NEW_TASKLIST', 'task' => 'tasklistform.add');
         PFToolbar::dropdownButton($items);
     }
     $items = array();
     if ($access->get('core.edit.state')) {
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_PUBLISH', 'task' => $this->getName() . '.publish');
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_UNPUBLISH', 'task' => $this->getName() . '.unpublish');
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_ARCHIVE', 'task' => $this->getName() . '.archive');
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_CHECKIN', 'task' => $this->getName() . '.checkin');
     }
     if ($state->get('filter.published') == -2 && $access->get('core.delete')) {
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_DELETE', 'task' => $this->getName() . '.delete');
     } elseif ($access->get('core.edit.state')) {
         $items[] = array('text' => 'COM_PROJECTFORK_ACTION_TRASH', 'task' => $this->getName() . '.trash');
     }
     if (count($items)) {
         PFToolbar::listButton($items);
     }
     PFToolbar::filterButton($this->state->get('filter.isset'));
     return PFToolbar::render();
 }
Exemplo n.º 4
0
 protected function getRevisionsToolbar()
 {
     $access = PFdesignsHelper::getActions($this->item->id);
     $options = array();
     if ($access->get('core.edit.state')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_PUBLISH', 'task' => 'revisions.publish');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_UNPUBLISH', 'task' => 'revisions.unpublish');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_ARCHIVE', 'task' => 'revisions.archive');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_CHECKIN', 'task' => 'revisions.checkin');
     }
     if ($this->state->get('filter.published') == -2 && $access->get('core.delete')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_DELETE', 'task' => 'revisions.delete');
     } elseif ($access->get('core.edit.state')) {
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_TRASH', 'task' => 'revisions.trash');
     }
     PFToolbar::clear();
     if (count($options)) {
         PFToolbar::listButton($options);
     }
     PFToolbar::filterButton($this->model_revisions->getState('filter.isset'));
     return PFToolbar::render();
 }