Exemplo n.º 1
0
 public static function addSubmenu($in_view = 'jvrelatives')
 {
     $canDo = JvrelativesHelper::getActions();
     JHtmlSidebar::addEntry(JText::_('COM_JVRELATIVES_DASHBOARD'), 'index.php?option=com_jvrelatives&view=jvrelatives', $in_view == 'jvrelatives');
     if ($canDo->get('core.admin')) {
         JHtmlSidebar::addEntry(JText::_('COM_JVRELATIVES_CONFIGURATION'), 'index.php?option=com_jvrelatives&task=config.edit&id=1', $in_view == 'config');
     }
     JHtmlSidebar::addEntry(JText::_('COM_JVRELATIVES_LOG'), 'index.php?option=com_jvrelatives&view=log', $in_view == 'log');
     JHtmlSidebar::addEntry(JText::_('COM_JVRELATIVES_CLEARCACHE'), 'index.php?option=com_jvrelatives&task=clearcache', false);
     JHtmlSidebar::addEntry(JText::_('COM_JVRELATIVES_DELTHUMBS'), 'index.php?option=com_jvrelatives&task=delthumbs', false);
     $document = JFactory::getDocument();
     $document->addStyleDeclaration('.icon-48-jvrelatives {background-image: url(../media/com_jvrelatives/assets/images/icon-48x48.png);}');
     switch ($in_view) {
         case 'config':
             $title = JText::_('COM_JVRELATIVES_CONFIGURATION');
             break;
         case 'log':
             $title = JText::_('COM_JVRELATIVES_LOG');
             break;
         default:
             $title = JText::_('COM_JVRELATIVES_ADMIN');
             break;
     }
     $document->setTitle($title);
 }
Exemplo n.º 2
0
 protected function addToolBar()
 {
     JToolBarHelper::title(JText::_('COM_JVRELATIVES_ADMIN'), 'jvrelatives');
     $canDo = JvrelativesHelper::getActions();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_jvrelatives');
     }
 }
Exemplo n.º 3
0
 public function edit($key = null, $urlVar = null)
 {
     $canDo = JvrelativesHelper::getActions();
     if (!$canDo->get('core.admin')) {
         $this->setMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_jvrelatives&view=jvrelatives', false));
         return false;
     }
     return parent::edit($key, $urlVar);
 }