Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // @see http://pastebin.com/Gn08KMN0 for TypoScript Code
- /* *
- * COPYRIGHT NOTICE *
- * *
- * (c) 2011 Tim Schoch <[email protected]> *
- * GSTALTIG GMBH *
- * All rights reserved *
- * *
- * This script is part of the TYPO3 project. The TYPO3 project is *
- * free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published *
- * by the Free Software Foundation; either version 2 of the License, *
- * or (at your option) any later version. *
- * *
- * The GNU General Public License can be found at *
- * http://www.gnu.org/copyleft/gpl.html. *
- * *
- * This script is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * This copyright notice MUST APPEAR in all copies of the script! *
- * */
- /**
- * Extended RequestBuilder that allows the same Plugin to be placed on the page more then once
- * if the switchableControllerActions are used to determine what actions can be displayed
- *
- * @package Gstbase
- * @subpackage MVC\Web
- */
- class Tx_Gstbase_MVC_Web_RequestBuilder extends Tx_Extbase_MVC_Web_RequestBuilder {
- /**
- * Extends the default Method allowing the same Plugin to be placed on the page more then once
- * if the switchableControllerActions are used to determine what actions can be displayed
- *
- * Original Description:
- * Returns the current actionName extracted from given $parameters.
- * If no action is specified, the defaultActionName will be returned.
- * If that's not available or the specified action is not defined in the current plugin, an exception is thrown.
- *
- * @param $controllerName
- * @param array $parameters
- * @return string
- * @throws t3lib_error_http_PageNotFoundException|Tx_Extbase_MVC_Exception|Tx_Extbase_MVC_Exception_InvalidActionName if the action could not be resolved
- */
- protected function resolveActionName($controllerName, array $parameters) {
- try{
- return parent::resolveActionName( $controllerName, $parameters );
- }
- catch( Exception $e ) {
- // catch «not allowed by this plugin» Exception only
- if( $e instanceof Tx_Extbase_MVC_Exception_InvalidActionName ) {
- unset( $parameters['action'] );
- return parent::resolveActionName( $controllerName, $parameters );
- }
- // forward other exceptions
- else {
- throw $e;
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement