public function onAfterInitialise() { // Make sure this is the back-end $app = JFactory::getApplication(); if (!in_array($app->getName(), array('administrator', 'admin'))) { return; } if (version_compare(JVERSION, '2.5.0', 'lt')) { $this->autoDisable(); return; } // Get the input variables $ji = new JInput(); $component = $ji->getCmd('option', ''); $task = $ji->getCmd('task', ''); $view = $ji->getCmd('view', ''); $backedup = $ji->getInt('is_backed_up', 0); // Perform a redirection on Joomla! Update download or install task, unless we have already backed up the site if ($component == 'com_joomlaupdate' && $task == 'update.install' && !$backedup) { // Get the backup profile ID $profileId = (int) $this->params->get('profileid', 1); if ($profileId <= 0) { $profileId = 1; } // Get the return URL $return_url = JUri::base() . 'index.php?option=com_joomlaupdate&task=update.install&is_backed_up=1'; // Get the redirect URL $token = JFactory::getSession()->getToken(); $redirect_url = JUri::base() . 'index.php?option=com_akeeba&view=backup&autostart=1&returnurl=' . urlencode($return_url) . '&profileid=' . $profileId . "&{$token}=1"; // Perform the redirection $app = JFactory::getApplication(); $app->redirect($redirect_url); } }
public function onAfterInitialise() { // Make sure this is the back-end $app = JFactory::getApplication(); if (!in_array($app->getName(), array('administrator', 'admin'))) { return; } // Get the input variables $ji = new JInput(); $component = $ji->getCmd('option', ''); $task = $ji->getCmd('task', ''); $view = $ji->getCmd('view', ''); $backedup = $ji->getInt('is_backed_up', 0); // Perform a redirection on Joomla! Update download or install task, unless we have already backed up the site if ($component == 'com_joomlaupdate' && $task == 'update.install' && !$backedup) { $return_url = JURI::base() . 'index.php?option=com_joomlaupdate&task=update.install&is_backed_up=1'; $redirect_url = JURI::base() . 'index.php?option=com_akeeba&view=backup&autostart=1&returnurl=' . urlencode($return_url); $app = JFactory::getApplication(); $app->redirect($redirect_url); } }
/** * Render action template * * @param string $tmpl Template file name to render * @return void */ public function render($tmpl, $data = array()) { $widgetName = $this->request->getCmd('widget'); $tmplFile = JSN_PATH_TPLFRAMEWORK_LIBRARIES . '/widget/tmpl/' . $widgetName . '/' . $tmpl . '.php'; if (!is_file($tmplFile) || !is_readable($tmplFile)) { throw new Exception('Template file not found: ' . $tmplFile); } // Extract data to seperated variables extract($data); // Start output buffer ob_start(); // Load template file include $tmplFile; // Send rendered content to client $this->responseContent = ob_get_clean(); }
echo JHTML::_('sliders.start', 'sliders', array('allowAllClose' => true, 'startOffset' => $this->active, 'startTransition' => true, true)); foreach ($tabs as $tab) { $title = $tab->title; echo JHTML::_('sliders.panel', $title, 'jfcpanel-panel-' . $tab->name); ?> <div style="float: left;"> <table><?php for ($i = 0; $i < count($link[$n]); $i++) { $href =& $link[$n][$i]; $title =& $label[$n][$i]; $image =& $limage[$n][$i]; $text =& $label[$n][$i]; $allowed = true; $data = JUri::getInstance($href)->getQuery(true); $jinput = new JInput($data); $task = $jinput->getCmd('task'); //$option = JRequest::getCmd('option'); if ($task != '' && $option == 'com_joomleague') { if (!JFactory::getUser()->authorise($task, 'com_joomleague')) { //display the task which is not handled by the access.xml //return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR').' Task: ' .$task); $allowed = false; } } if ($allowed) { echo '<tr><td><b><a href="' . $href . '" title="' . JText::_('JGLOBAL_AUTH_ACCESS_GRANTED') . '">' . $image . ' ' . $text . '</a></b></td></tr>'; } else { echo '<tr><td><span title="' . JText::_('JGLOBAL_AUTH_ACCESS_DENIED') . '">' . $image . ' ' . $text . '</span></td></tr>'; } } ?>
public function generateBodyClass() { $url = new JInput(); $itemid = $url->getVar('Itemid'); $menu = @$this->app->getMenu(); $active = @$menu->getActive(); $params = @$menu->getParams($active->id); $class = NULL; $class .= $this->get('style') == '-1' ? 'style-none' : $this->get('style'); $class .= ' align-' . $this->direction; $class .= ' page-id-' . (isset($active) ? $active->id : $menu->getDefault()->id); //Add class of homepage if it's home if ($menu->getActive() == $menu->getDefault()) { $class .= ' homepage '; } else { $view = $url->getWord('view'); $component = str_replace('_', '-', $url->getCmd('option')); $class .= ' ' . $component . '-' . $view; } $class .= ' ' . strtolower($this->browser->getBrowser()); $class .= $this->displayComponent() ? '' : ' com-disabled'; $class .= ' ' . $params->get('pageclass_sfx'); return 'class="' . $class . '"'; }