Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // no direct access
- defined( '_JEXEC' ) or die( 'Restricted access' );
- // import Joomla controller library
- jimport('joomla.application.component.controller');
- /**
- * General Controller of ReDJ component
- */
- class ReDJController extends JControllerAdmin
- {
- /**
- * @var string The default view.
- * @since 1.6
- */
- protected $default_view = 'redirects';
- /**
- * Display view
- *
- * @return void
- */
- public function display($cachable = false, $urlparams = false)
- {
- $input =JFactory::getApplication()->input;
- $view = $input->get('view', 'redirects');
- $layout = $input->get('layout', 'default');
- $id = $input->get('id');
- // Set the submenu
- require_once JPATH_COMPONENT.'/helpers/redj.php';
- ReDJHelper::addSubmenu($view);
- // Check for edit form
- if ($view == 'redirect' && $layout == 'edit' && !$this->checkEditId('com_redj.edit.redirect', $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_redj&view=redirects', false));
- return false;
- }
- else if ($view == 'page404' && $layout == 'edit' && !$this->checkEditId('com_redj.edit.page404', $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_redj&view=pages404', false));
- return false;
- }
- // Call parent behavior
- parent::display();
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement