TYPO3 API  SVNRelease
AbstractWidgetController.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This script belongs to the FLOW3 package "Fluid".                      *
00005  *                                                                        *
00006  * It is free software; you can redistribute it and/or modify it under    *
00007  * the terms of the GNU Lesser General Public License as published by the *
00008  * Free Software Foundation, either version 3 of the License, or (at your *
00009  * option) any later version.                                             *
00010  *                                                                        *
00011  * This script is distributed in the hope that it will be useful, but     *
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
00013  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
00014  * General Public License for more details.                               *
00015  *                                                                        *
00016  * You should have received a copy of the GNU Lesser General Public       *
00017  * License along with the script.                                         *
00018  * If not, see http://www.gnu.org/licenses/lgpl.html                      *
00019  *                                                                        *
00020  * The TYPO3 project - inspiring people to share!                         *
00021  *                                                                        */
00022 
00023 /**
00024  * This is the base class for all widget controllers.
00025  * Basically, it is an ActionController, and it additionally
00026  * has $this->widgetConfiguration set to the Configuration of the current Widget.
00027  *
00028  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
00029  * @api
00030  */
00031 abstract class Tx_Fluid_Core_Widget_AbstractWidgetController extends Tx_Extbase_MVC_Controller_ActionController implements t3lib_Singleton {
00032 
00033     /**
00034      * @var array
00035      */
00036     protected $supportedRequestTypes = array('Tx_Fluid_Core_Widget_WidgetRequest');
00037 
00038     /**
00039      * Configuration for this widget.
00040      *
00041      * @var array
00042      * @api
00043      */
00044     protected $widgetConfiguration;
00045 
00046     /**
00047      * Handles a request. The result output is returned by altering the given response.
00048      *
00049      * @param Tx_Extbase_MVC_RequestInterface $request The request object
00050      * @param Tx_Extbase_MVC_ResponseInterface $response The response, modified by this handler
00051      * @return void
00052      * @api
00053      */
00054     public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) {
00055         $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
00056         parent::processRequest($request, $response);
00057     }
00058 
00059     /**
00060      * @param Tx_Extbase_MVC_View_ViewInterface $view
00061      * @return void
00062      * @todo implement logic for overriding widget template paths (tx_extension.view.widget.<WidgetViewHelperClassName>.templateRootPath...)
00063      */
00064     protected function setViewConfiguration(Tx_Extbase_MVC_View_ViewInterface $view) {
00065         return;
00066     }
00067 }
00068 
00069 ?>