/** * Get the toolbar to render. * * @return RToolbar */ public function getToolbar() { $canDo = RedsourceHelpersAcl::getActions(); $user = JFactory::getUser(); $firstGroup = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); if ($user->authorise('core.admin', 'com_redsource')) { // Add / edit if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_redsource', 'core.create')) > 0) { $new = RToolbarBuilder::createNewButton('ctype.add'); $firstGroup->addButton($new); } if ($canDo->get('core.edit')) { $edit = RToolbarBuilder::createEditButton('ctype.edit'); $firstGroup->addButton($edit); } // Publish / Unpublish if ($canDo->get('core.edit.state')) { $publish = RToolbarBuilder::createPublishButton('ctypes.publish'); $unpublish = RToolbarBuilder::createUnpublishButton('ctypes.unpublish'); $firstGroup->addButton($publish)->addButton($unpublish); } // Delete / Trash if ($canDo->get('core.delete')) { $delete = RToolbarBuilder::createDeleteButton('ctypes.delete'); $secondGroup->addButton($delete); } } $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup); return $toolbar; }
/** * 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('project.add'); $firstGroup->addButton($new); $copy = RToolbarBuilder::createCopyButton('projects.copy'); $firstGroup->addButton($copy); } if ($user->authorise('core.edit', 'com_tracks')) { $edit = RToolbarBuilder::createEditButton('project.edit'); $secondGroup->addButton($edit); } if ($user->authorise('core.delete', 'com_tracks')) { $delete = RToolbarBuilder::createDeleteButton('projects.delete'); $fourthGroup->addButton($delete); } $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup)->addGroup($fourthGroup); return $toolbar; }
/** * Get the toolbar to render. * * @return RToolbar */ public function getToolbar() { $canDo = OpenHrmHelpersAcl::getActions($this->state->get('filter.country_id')); $user = JFactory::getUser(); $firstGroup = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); $thirdGroup = new RToolbarButtonGroup(); if ($user->authorise('core.admin', 'com_openhrm.panel')) { $new = RToolbarBuilder::createNewButton('employee.add'); $edit = RToolbarBuilder::createEditButton('employee.edit'); $firstGroup->addButton($new)->addButton($edit); $publish = RToolbarBuilder::createPublishButton('employees.published'); $unpublish = RToolbarBuilder::createPublishButton('employees.unpublished'); $secondGroup->addButton($publish)->addButton($unpublish); $delete = RToolbarBuilder::createDeleteButton('employees.delete'); $thirdGroup->addButton($delete); } $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup); return $toolbar; }
/** * 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; }
/** * Get the toolbar to render. * * @return RToolbar */ public function getToolbar() { if ($this->getLayout() == 'test') { return null; } $canDo = $this->getActions(); $user = JFactory::getUser(); $firstGroup = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); $thirdGroup = new RToolbarButtonGroup(); if ($user->authorise('core.admin', 'com_redcore')) { // Edit if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_redcore', 'core.create')) > 0) { $new = new RToolbarButtonStandard('COM_REDCORE_PAYMENT_CONFIGURATION_NEW_CONFIGURATION', 'payment_configuration.add', 'btn-success', 'icon-file-text', '', false); $firstGroup->addButton($new); } if ($canDo->get('core.edit')) { $edit = RToolbarBuilder::createEditButton('payment_configuration.edit'); $firstGroup->addButton($edit); } $new = new RToolbarButtonStandard('COM_REDCORE_PAYMENT_CONFIGURATION_TEST_CONFIGURATION', 'payment_configurations.test', '', 'icon-file-text', '', false); $secondGroup->addButton($new); // Delete / Trash if ($canDo->get('core.delete')) { $delete = RToolbarBuilder::createDeleteButton('payment_configurations.delete'); $thirdGroup->addButton($delete); } } $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup); return $toolbar; }
/** * Get the toolbar to render. * * @return RToolbar */ public function getToolbar() { $canDo = $this->getActions(); $group = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); $thirdGroup = new RToolbarButtonGroup(); $user = JFactory::getUser(); if ($user->authorise('core.admin', 'com_redcore')) { if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_redcore', 'core.create')) > 0) { $new = RToolbarBuilder::createNewButton('webservice.add'); $group->addButton($new); } if ($canDo->get('core.edit')) { $edit = RToolbarBuilder::createEditButton('webservice.edit'); $group->addButton($edit); $publish = RToolbarBuilder::createPublishButton('webservices.publish'); $unPublish = RToolbarBuilder::createUnpublishButton('webservices.unpublish'); $secondGroup->addButton($publish)->addButton($unPublish); } if ($canDo->get('core.delete')) { $delete = RToolbarBuilder::createDeleteButton('webservices.delete'); $thirdGroup->addButton($delete); } } $toolbar = new RToolbar(); $toolbar->addGroup($group)->addGroup($secondGroup)->addGroup($thirdGroup); return $toolbar; }
/** * Get the tool-bar to render. * * @todo The commented lines are going to be implemented once we have setup ACL requirements for Dummy * @return RToolbar */ public function getToolbar() { $user = JFactory::getUser(); $firstGroup = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); $thirdGroup = new RToolbarButtonGroup(); $new = RToolbarBuilder::createNewButton('object.add'); $firstGroup->addButton($new); $edit = RToolbarBuilder::createEditButton('object.edit'); $secondGroup->addButton($edit); $delete = RToolbarBuilder::createDeleteButton('objects.delete'); $thirdGroup->addButton($delete); $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup)->addGroup($thirdGroup); return $toolbar; }
/** * Get the toolbar to render. * * @return RToolbar */ public function getToolbar() { $canDo = $this->getActions(); $user = JFactory::getUser(); $firstGroup = new RToolbarButtonGroup(); $secondGroup = new RToolbarButtonGroup(); if ($user->authorise('core.admin', 'com_redcore')) { // Add / edit if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_redcore', 'core.create')) > 0) { $new = RToolbarBuilder::createNewButton('oauth_client.add'); $firstGroup->addButton($new); } if ($canDo->get('core.edit')) { $edit = RToolbarBuilder::createEditButton('oauth_client.edit'); $firstGroup->addButton($edit); } // Delete / Trash if ($canDo->get('core.delete')) { $delete = RToolbarBuilder::createDeleteButton('oauth_clients.delete'); $secondGroup->addButton($delete); } } $toolbar = new RToolbar(); $toolbar->addGroup($firstGroup)->addGroup($secondGroup); return $toolbar; }
/** * 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; }