function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'jvrelatives.php'; JvrelativesHelper::addSubmenu(JFactory::getApplication()->input->getCmd('view', 'log')); parent::display($cachable, $urlparams); return $this; }
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); }
protected function addToolBar() { JToolBarHelper::title(JText::_('COM_JVRELATIVES_ADMIN'), 'jvrelatives'); $canDo = JvrelativesHelper::getActions(); if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_jvrelatives'); } }
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); }
function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'jvrelatives.php'; $view = JFactory::getApplication()->input->getCmd('view', 'jvrelatives'); $layout = JFactory::getApplication()->input->getCmd('layout', 'default'); $id = JFactory::getApplication()->input->getInt('id'); // Check for edit form. if ($view == 'config' && $layout == 'edit' && !$this->checkEditId('com_jvrelatives.edit.config', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_jvrelatives&view=jvrelatives', false)); return false; } // route configs view back to dashboard if ($view == 'configs') { $this->setRedirect(JRoute::_('index.php?option=com_jvrelatives&view=jvrelatives', false)); return; } JvrelativesHelper::addSubmenu($view); parent::display($cachable, $urlparams); return $this; }
<div class="tab-pane active" id="common_relart"> <?php echo $this->loadTemplate('common_relart'); ?> </div> <div class="tab-pane" id="eopsob"> <?php echo $this->loadTemplate('eopsob'); ?> </div> <div class="tab-pane" id="advanced"> <?php echo $this->loadTemplate('advanced'); ?> </div> </div> </fieldset> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </div> </div> </form> <?php JvrelativesHelper::showFooter(); ?> </div>