Created
July 23, 2015 03:31
-
-
Save asika32764/66134b3adfc8bb46174d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Part of Ezset project. | |
| * | |
| * @copyright Copyright (C) 2015 {ORGANIZATION}. All rights reserved. | |
| * @license GNU General Public License version 2 or later; | |
| */ | |
| namespace MyEzset\Listener\ModuleRedirect; | |
| /** | |
| * The ModuleRedirectListener class. | |
| * | |
| * @since {DEPLOY_VERSION} | |
| */ | |
| class ModuleRedirectListener extends \JEvent | |
| { | |
| /** | |
| * After Route Event. | |
| */ | |
| public function onAfterRoute() | |
| { | |
| $app = \JFactory::getApplication(); | |
| $input = $app->input; | |
| $option = $input->get('option'); | |
| $view = $input->get('view'); | |
| $task = $input->get('task'); | |
| if ($option == 'com_modules') | |
| { | |
| if ($task == 'module.save') | |
| { | |
| $redirect = \JUri::base(); | |
| $app->setUserState('mod_modules.save.return', $redirect); | |
| } | |
| if ($view == 'modules') | |
| { | |
| $redirect = $app->getUserState('mod_modules.save.return'); | |
| if ($redirect) | |
| { | |
| $app->setUserState('mod_modules.save.return', null); | |
| $app->redirect($redirect); | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment