eZ Publish  [4.0]
ezmoduleparamsoperator.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // Definition of eZModuleParamsOperator class
00004 //
00005 // Created on: <29-juli-2003 18:42:38 admin>
00006 //
00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00008 // SOFTWARE NAME: eZ Publish
00009 // SOFTWARE RELEASE: 4.0.x
00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00011 // SOFTWARE LICENSE: GNU General Public License v2.0
00012 // NOTICE: >
00013 //   This program is free software; you can redistribute it and/or
00014 //   modify it under the terms of version 2.0  of the GNU General
00015 //   Public License as published by the Free Software Foundation.
00016 //
00017 //   This program is distributed in the hope that it will be useful,
00018 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //   GNU General Public License for more details.
00021 //
00022 //   You should have received a copy of version 2.0 of the GNU General
00023 //   Public License along with this program; if not, write to the Free
00024 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00025 //   MA 02110-1301, USA.
00026 //
00027 //
00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00029 //
00030 
00031 /*
00032 If you want to have autoloading of this operator you should create
00033 a eztemplateautoload.php file and add the following code to it.
00034 The autoload file must be placed somewhere specified in AutoloadPath
00035 under the group TemplateSettings in settings/site.ini
00036 
00037 $eZTemplateOperatorArray = array();
00038 $eZTemplateOperatorArray[] = array( 'script' => 'templatemoduleparamsoperator.php',
00039                                     'class' => '$full_class_name',
00040                                     'operator_names' => array( 'module_params' ) );
00041 
00042 By using module_params you can ...
00043 
00044   Example:
00045 \code
00046 {module_params|wash}
00047 \endcode
00048 
00049 */
00050 
00051 
00052 class eZModuleParamsOperator
00053 {
00054     /*!
00055       Constructor, does nothing by default.
00056     */
00057     function eZModuleParamsOperator()
00058     {
00059     }
00060 
00061     /*!
00062      \return an array with the template operator name.
00063     */
00064     function operatorList()
00065     {
00066         return array( 'module_params' );
00067     }
00068     /*!
00069      \return true to tell the template engine that the parameter list exists per operator type,
00070              this is needed for operator classes that have multiple operators.
00071     */
00072     function namedParameterPerOperator()
00073     {
00074         return true;
00075     }
00076     /*!
00077      See eZTemplateOperator::namedParameterList
00078     */
00079     function namedParameterList()
00080     {
00081         return array( 'module_params' => array() );
00082     }
00083     /*!
00084      Executes the PHP function for the operator cleanup and modifies \a $operatorValue.
00085     */
00086     function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters )
00087     {
00088         switch ( $operatorName )
00089         {
00090             case 'module_params':
00091             {
00092                 $operatorValue = $GLOBALS['eZRequestedModuleParams'];
00093             } break;
00094         }
00095     }
00096 }
00097 ?>