Beispiel #1
0
 /**
  * Method to display a view.
  *
  * @param bool $cachable
  * @param bool $urlparams
  *
  * @internal param \If $boolean true, the view output will be cached
  * @internal param \An $array array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return    JController        This object to support chaining.
  * @since    1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php';
     // Load the submenu.
     ModulesHelper::addSubmenu(JFactory::getApplication()->input->getCmd('view', 'modules'));
     $view = JFactory::getApplication()->input->getCmd('view', 'modules');
     $layout = JFactory::getApplication()->input->getCmd('layout', 'default');
     $id = JFactory::getApplication()->input->getInt('id', null);
     // Check for edit form.
     if ($view == 'module' && $layout == 'edit' && !$this->checkEditId('com_roksprocket.edit.module', $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::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()), false));
         return false;
     }
     if (RokCommon_Session::get('roksprocket.' . $id, false)) {
         RokCommon_Session::clear('roksprocket.' . $id);
     }
     parent::display();
 }
Beispiel #2
0
<?php

/**
 * @version   $Id: roksprocket.php 10885 2013-05-30 06:31:41Z btowles $
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2016 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
include_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/legacy_class.php';
// no direct access
defined('_JEXEC') or die;
// Include dependancies
jimport('joomla.application.component.controller');
JTable::addIncludePath(JPATH_SITE . '/components/com_roksprocket/tables');
RokCommon_Composite::addPackagePath(RokSprocket::BASE_PACKAGE_NAME, dirname(__FILE__));
$controller = RokSprocketLegacyJController::getInstance('RokSprocket');
$app = JFactory::getApplication();
$input = $app->input;
$task = $input->get('task', null, 'CMD');
$controller->execute($task);
$controller->redirect();