public static function group()
 {
     if (self::$group_open) {
         self::$html[] = '</div>';
         self::$group_open = false;
     } else {
         self::$html[] = '<div class="btn-group">';
         self::$group_open = true;
     }
 }
示例#2
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $id = empty($this->item) || empty($this->item->id) ? null : $this->item->id;
     $access = PFprojectsHelper::getActions($id);
     $uid = JFactory::getUser()->get('id');
     if (!empty($id)) {
         $slug = $this->item->id . ':' . $this->item->alias;
         $return = base64_encode(PFprojectsHelperRoute::getDashboardRoute($slug));
         PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFprojectsHelperRoute::getProjectsRoute() . '&task=form.edit&id=' . $slug . '&return=' . $return)));
     }
     return PFToolbar::render();
 }
 /**
  * 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();
 }
示例#4
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFmilestonesHelper::getActions($this->item->id);
     $uid = JFactory::getUser()->get('id');
     $app = JFactory::getApplication();
     if ($this->item->id) {
         $slug = $this->item->id . ':' . $this->item->alias;
         $project_slug = $app->input->getCmd('filter_project');
         $return = base64_encode(PFmilestonesHelperRoute::getMilestoneRoute($slug, $project_slug));
         PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFmilestonesHelperRoute::getMilestonesRoute() . '&task=form.edit&id=' . $slug . '&return=' . $return)));
     }
     if (PFApplicationHelper::enabled('com_pftasks')) {
         PFToolbar::button(JText::sprintf('JGRID_HEADING_TASKLISTS_AND_TASKS', intval($this->item->lists), intval($this->item->tasks)), '', false, array('href' => JRoute::_(PFtasksHelperRoute::getTasksRoute($this->item->project_id, $this->item->id)), 'icon' => 'icon-chevron-right', 'class' => ''));
     }
     return PFToolbar::render();
 }
 /**
  * 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();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $options = array();
     $user = JFactory::getUser();
     $create_list = true;
     $create_ms = $user->authorise('core.create', 'com_pfmilestones');
     $options[] = array('text' => 'JSAVE', 'task' => $this->getName() . '.save');
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2NEW', 'task' => $this->getName() . '.save2new');
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2COPY', 'task' => $this->getName() . '.save2copy', 'options' => array('access' => $this->item->id > 0));
     if ($create_list || $create_ms) {
         $options[] = array('text' => 'divider');
     }
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2MILESTONE', 'task' => $this->getName() . '.save2milestone', 'options' => array('access' => $create_ms));
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2TASKLIST', 'task' => $this->getName() . '.save2tasklist', 'options' => array('access' => $create_list));
     PFToolbar::dropdownButton($options, array('icon' => 'icon-white icon-ok'));
     PFToolbar::button('JCANCEL', $this->getName() . '.cancel', false, array('class' => '', 'icon' => ''));
     return PFToolbar::render();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFrepoHelper::getActions('note', $this->item->id);
     $link = PFrepoHelperRoute::getRepositoryRoute($this->item->project_id, $this->item->dir_id, $this->item->path);
     $back_opts = array('access' => true, 'href' => $link);
     $edit_opts = array('access' => $access->get('core.edit'));
     PFToolbar::button('COM_PROJECTFORK_ACTION_BACK', '', false, $back_opts);
     PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', 'noteform.edit', false, $edit_opts);
     PFToolbar::filterButton($this->state->get('filter.isset'));
     return PFToolbar::render();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $options = array();
     $options[] = array('text' => 'JSAVE', 'task' => $this->getName() . '.save');
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2NEW', 'task' => $this->getName() . '.save2new');
     PFToolbar::dropdownButton($options, array('icon' => 'icon-white icon-ok'));
     PFToolbar::button('JCANCEL', $this->getName() . '.cancel', false, array('class' => '', 'icon' => ''));
     return PFToolbar::render();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $options = array();
     $options[] = array('text' => 'JSAVE', 'task' => $this->getName() . '.save');
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2NEW', 'task' => $this->getName() . '.save2new');
     $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2COPY', 'task' => $this->getName() . '.save2copy', 'options' => array('access' => $this->item->id > 0));
     if (PFApplicationHelper::enabled('com_pftasks') && JFactory::getUser()->authorise('core.create', 'com_pftasks')) {
         $options[] = array('text' => 'divider');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2TASKLIST', 'task' => $this->getName() . '.save2tasklist');
         $options[] = array('text' => 'COM_PROJECTFORK_ACTION_2TASK', 'task' => $this->getName() . '.save2task');
     }
     PFToolbar::dropdownButton($options, array('icon' => 'icon-white icon-ok'));
     PFToolbar::button('JCANCEL', $this->getName() . '.cancel', false, array('class' => '', 'icon' => ''));
     return PFToolbar::render();
 }
示例#10
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();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     PFToolbar::filterButton($this->state->get('filter.isset'));
     return PFToolbar::render();
 }
示例#12
0
文件: view.html.php 项目: MrJookie/pm
 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();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $options = array();
     $topic = $this->state->get($this->get('Name') . '.topic');
     $access = PFforumHelper::getReplyActions($this->item->id, $topic);
     if ($access->get('core.create')) {
         PFToolbar::button('JSAVE', $this->getName() . '.save', false, array('icon' => 'icon-white icon-ok'));
     }
     PFToolbar::button('JCANCEL', $this->getName() . '.cancel', false, array('class' => '', 'icon' => ''));
     return PFToolbar::render();
 }
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFtasksHelper::getActions($this->item->id);
     $uid = JFactory::getUser()->get('id');
     $slug = $this->item->id . ':' . $this->item->alias;
     PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFtasksHelperRoute::getTasksRoute() . '&task=taskform.edit&id=' . $slug)));
     return PFToolbar::render();
 }