Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('_JEXEC') or die;
- class plgSystemDealershipManager extends JPlugin
- {
- public function __construct(&$subject, $config = array()){
- parent::__construct($subject, $config);
- $this->loadLanguage();
- }
- public function onAfterInitialise(){
- JLoader::register('modQuickIconHelper', JPATH_ADMINISTRATOR.'/modules/mod_quickicon/helper.php');
- // We get this by reference so we can add buttons to it
- $buttons =& modQuickIconHelper::getButtons();
- // Even if we use actions to limit which icons we show, we do not want to show some icons
- // if this user is a dealership manager, because they only manage a single dealership
- $user = JFactory::getUser();
- $params = $user->getParam('profile');
- if(!$params->dealership){
- $buttons[] = array(
- 'link' => JRoute::_('index.php?option=com_dealershipmanager&view=dealers'),
- 'image' => JURI::root(false).'/media/com_dealershipmanager/images/manager_48x48.png',
- 'text' => JText::_('PLG_SYSTEM_DEALERSHIPMANAGER_DEALERSHIPS'),
- 'access' => true
- );
- $buttons[] = array(
- 'link' => JRoute::_('index.php?option=com_dealershipmanager&view=import'),
- 'image' => JURI::root(false).'/media/com_dealershipmanager/images/import_48x48.png',
- 'text' => JText::_('PLG_SYSTEM_DEALERSHIPMANAGER_IMPORT'),
- 'access' => true
- );
- }
- $buttons[] = array(
- 'link' => JRoute::_('index.php?option=com_dealershipmanager&view=vehicles'),
- 'image' => JURI::root(false).'/media/com_dealershipmanager/images/cabriolet_48x48.png',
- 'text' => JText::_('PLG_SYSTEM_DEALERSHIPMANAGER_VEHICLES'),
- 'access' => array('core.manage', 'com_dealershipmanager')
- );
- $buttons[] = array(
- 'link' => JRoute::_('index.php?option=com_dealershipmanager&view=reports'),
- 'image' => JURI::root(false).'/media/com_dealershipmanager/images/reports_48x48.png',
- 'text' => JText::_('PLG_SYSTEM_DEALERSHIPMANAGER_REPORTS'),
- 'access' => array('core.manage', 'com_dealershipmanager')
- );
- $buttons[] = array(
- 'link' => JRoute::_('index.php?option=com_dealershipmanager&view=logs'),
- 'image' => JURI::root(false).'/media/com_dealershipmanager/images/logs_48x48.png',
- 'text' => JText::_('PLG_SYSTEM_DEALERSHIPMANAGER_LOGS'),
- 'access' => array('dealership.manage', 'com_dealershipmanager')
- );
- }
- }
Add Comment
Please, Sign In to add comment