Example #1
0
 /**
  * Get the toolbar to render.
  *
  * @return  RToolbar
  */
 public function getToolbar()
 {
     $canDo = JabHelper::getActions($this->state->get('filter.category_id'));
     $user = JFactory::getUser();
     $firstGroup = new RToolbarButtonGroup();
     $secondGroup = new RToolbarButtonGroup();
     $thirdGroup = new RToolbarButtonGroup();
     if ($user->authorise('core.admin', 'com_jab.panel')) {
         $panel = RToolbarBuilder::createStandardButton('states.topanel', 'COM_JAB_CONTROL_PANEL_TITLE', '', 'icon-home', false);
         $firstGroup->addButton($panel);
         // Add / edit
         if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_jab', 'core.create')) > 0) {
             $new = RToolbarBuilder::createNewButton('state.add');
             $secondGroup->addButton($new);
         }
         if ($canDo->get('core.edit')) {
             $edit = RToolbarBuilder::createEditButton('state.edit');
             $secondGroup->addButton($edit);
         }
         // Publish / Unpublish
         if ($canDo->get('core.edit.state')) {
             $publish = RToolbarBuilder::createPublishButton('states.publish');
             $unpublish = RToolbarBuilder::createUnpublishButton('states.unpublish');
             $secondGroup->addButton($publish)->addButton($unpublish);
         }
         // Delete / Trash
         if ($canDo->get('core.delete')) {
             $delete = RToolbarBuilder::createDeleteButton('states.delete');
             $thirdGroup->addButton($delete);
         }
         // Preferences
         if ($canDo->get('core.admin')) {
             $options = RToolbarBuilder::createOptionsButton('com_jab');
             $thirdGroup->addButton($options);
         }
     }
     $toolbar = new RToolbar();
     $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup);
     return $toolbar;
 }
Example #2
0
 /**
  * Get the toolbar to render.
  *
  * @return  RToolbar
  */
 public function getToolbar()
 {
     $firstGroup = new RToolbarButtonGroup();
     $secondGroup = new RToolbarButtonGroup();
     if (!empty($this->contentElement)) {
         $delete = RToolbarBuilder::createDeleteButton('translations.delete');
         $firstGroup->addButton($delete);
         // Manage
         $manage = RToolbarBuilder::createStandardButton('translations.manageContentElement', JText::_('COM_REDCORE_TRANSLATIONS_MANAGE_CONTENT_ELEMENTS'), 'btn btn-primary', 'icon-globe', false);
         $secondGroup->addButton($manage);
     }
     $toolbar = new RToolbar();
     $toolbar->addGroup($firstGroup)->addGroup($secondGroup);
     return $toolbar;
 }
Example #3
0
 /**
  * Get the tool-bar to render.
  *
  * @return  RToolbar
  */
 public function getToolbar()
 {
     $user = JFactory::getUser();
     $firstGroup = new RToolbarButtonGroup();
     $secondGroup = new RToolbarButtonGroup();
     $thirdGroup = new RToolbarButtonGroup();
     $fourthGroup = new RToolbarButtonGroup();
     if ($user->authorise('core.create', 'com_tracks')) {
         $new = RToolbarBuilder::createNewButton('eventresult.add');
         $firstGroup->addButton($new);
         $addall = RToolbarBuilder::createStandardButton('eventresults.addall', 'COM_TRACKS_ADD_ALL', '', 'icon-plus', false);
         $firstGroup->addButton($addall);
     }
     if ($user->authorise('core.edit', 'com_tracks')) {
         $edit = RToolbarBuilder::createEditButton('eventresult.edit');
         $secondGroup->addButton($edit);
         $rank = RToolbarBuilder::createStandardButton('eventresults.saveranks', JText::_('COM_TRACKS_SAVE_RESULTS'), 'save-results', 'icon-save');
         $secondGroup->addButton($rank);
     }
     if ($user->authorise('core.delete', 'com_tracks')) {
         $delete = RToolbarBuilder::createDeleteButton('eventresults.delete');
         $fourthGroup->addButton($delete);
     }
     $toolbar = new RToolbar();
     $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup)->addGroup($fourthGroup);
     return $toolbar;
 }