eZ Publish  [4.0]
eztemplateautoload.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // Created on: <05-Oct-2002 21:27:11 amos>
00004 //
00005 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00006 // SOFTWARE NAME: eZ Publish
00007 // SOFTWARE RELEASE: 4.0.x
00008 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00009 // SOFTWARE LICENSE: GNU General Public License v2.0
00010 // NOTICE: >
00011 //   This program is free software; you can redistribute it and/or
00012 //   modify it under the terms of version 2.0  of the GNU General
00013 //   Public License as published by the Free Software Foundation.
00014 //
00015 //   This program is distributed in the hope that it will be useful,
00016 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 //   GNU General Public License for more details.
00019 //
00020 //   You should have received a copy of version 2.0 of the GNU General
00021 //   Public License along with this program; if not, write to the Free
00022 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00023 //   MA 02110-1301, USA.
00024 //
00025 //
00026 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00027 //
00028 
00029 /*! \file eztemplateautoload.php
00030 */
00031 
00032 // Operator autoloading
00033 
00034 $eZTemplateOperatorArray = array();
00035 
00036 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezurloperator.php',
00037                                     'class' => 'eZURLOperator',
00038                                     'operator_names' => array( 'ezurl', 'ezroot', 'ezdesign', 'ezimage', 'exturl',
00039                                                                'ezsys', 'ezhttp', 'ezhttp_hasvariable', 'ezini', 'ezini_hasvariable' ) );
00040 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezi18noperator.php',
00041                                     'class' => 'eZI18nOperator',
00042                                     'operator_names' => array( 'i18n', 'x18n' ) );
00043 
00044 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezalphabetoperator.php',
00045                                     'class' => 'eZAlphabetOperator',
00046                                     'operator_names' => array( 'alphabet' ) );
00047 
00048 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezdateoperatorcollection.php',
00049                                     'class' => 'eZDateOperatorCollection',
00050                                     'operator_names' => array( 'month_overview' ) );
00051 
00052 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezautolinkoperator.php',
00053                                     'class' => 'eZAutoLinkOperator',
00054                                     'operator_names' => array( 'autolink' ) );
00055 
00056 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezsimpletagsoperator.php',
00057                                     'class' => 'eZSimpleTagsOperator',
00058                                     'operator_names' => array( 'simpletags' ) );
00059 
00060 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/eztreemenuoperator.php',
00061                                     'class' => 'eZTreeMenuOperator',
00062                                     'operator_names' => array( 'treemenu' ) );
00063 
00064 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezcontentstructuretreeoperator.php',
00065                                     'class' => 'eZContentStructureTreeOperator',
00066                                     'operator_names' => array( 'content_structure_tree' ) );
00067 
00068 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezwordtoimageoperator.php',
00069                                     'class' => 'eZWordToImageOperator',
00070                                     'operator_names' => array( 'wordtoimage',
00071                                                                'mimetype_icon', 'class_icon', 'classgroup_icon', 'action_icon', 'icon',
00072                                                                'flag_icon', 'icon_info' ) );
00073 
00074 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezkerneloperator.php',
00075                                     'class' => 'eZKernelOperator',
00076                                     'operator_names' => array( 'ezpreference' ) );
00077 
00078 
00079 $eZTemplateOperatorArray[] = array( 'script' => 'lib/eztemplate/classes/eztemplatephpoperator.php',
00080                                     'function' => 'eZPHPOperatorInit',
00081                                     'operator_names_function' => 'eZPHPOperatorNameInit' );
00082 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezmoduleparamsoperator.php',
00083                                     'class' => 'eZModuleParamsOperator',
00084                                     'operator_names' => array( 'module_params' ) );
00085 
00086 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/eztopmenuoperator.php',
00087                                     'class' => 'eZTopMenuOperator',
00088                                     'operator_names' => array( 'topmenu' ) );
00089 
00090 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezpackageoperator.php',
00091                                     'class' => 'eZPackageOperator',
00092                                     'operator_names' => array( 'ezpackage' ) );
00093 
00094 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/eztocoperator.php',
00095                                     'class' => 'eZTOCOperator',
00096                                     'operator_names' => array( 'eztoc' ) );
00097 
00098 $eZTemplateOperatorArray[] = array( 'script' => 'kernel/common/ezmoduleoperator.php',
00099                                     'class' => 'eZModuleOperator',
00100                                     'operator_names' => array( 'ezmodule' ) );
00101 
00102 // Function autoloading
00103 
00104 $eZTemplateFunctionArray = array();
00105 $eZTemplateFunctionArray[] = array( 'function' => 'eZObjectForwardInit',
00106                                     'function_names' => array( 'attribute_edit_gui',
00107                                                                'attribute_view_gui',
00108                                                                'attribute_result_gui',
00109                                                                'attribute_pdf_gui',
00110                                                                'attribute_diff_gui',
00111                                                                'related_view_gui',
00112                                                                'node_view_gui',
00113                                                                'content_view_gui',
00114                                                                'content_pdf_gui',
00115                                                                'shop_account_view_gui',
00116                                                                'content_version_view_gui',
00117                                                                'collaboration_view_gui',
00118                                                                'collaboration_icon',
00119                                                                'collaboration_simple_message_view',
00120                                                                'collaboration_participation_view',
00121                                                                'event_edit_gui',
00122                                                                'event_view_gui',
00123                                                                'class_attribute_view_gui',
00124                                                                'class_attribute_edit_gui' ) );
00125 
00126 if ( !function_exists( 'eZPHPOperatorInit' ) )
00127 {
00128     function eZPHPOperatorInit()
00129         {
00130             //include_once( 'lib/eztemplate/classes/eztemplatephpoperator.php' );
00131             $ini = eZINI::instance( 'template.ini' );
00132             $operatorList = $ini->variable( 'PHP', 'PHPOperatorList' );
00133             return new eZTemplatePHPOperator( $operatorList );
00134         }
00135 }
00136 
00137 if ( !function_exists( 'eZPHPOperatorNameInit' ) )
00138 {
00139     function eZPHPOperatorNameInit()
00140         {
00141             $ini = eZINI::instance( 'template.ini' );
00142             $operatorList = $ini->variable( 'PHP', 'PHPOperatorList' );
00143             return array_keys( $operatorList );
00144         }
00145 }
00146 
00147 if ( !function_exists( 'eZObjectForwardInit' ) )
00148 {
00149     function eZObjectForwardInit()
00150         {
00151             //include_once( 'kernel/common/ezobjectforwarder.php' );
00152             $forward_rules = array(
00153                 'attribute_edit_gui' => array( 'template_root' => 'content/datatype/edit',
00154                                                'input_name' => 'attribute',
00155                                                'output_name' => 'attribute',
00156                                                'namespace' => 'ContentAttribute',
00157                                                'attribute_keys' => array( 'attribute_identifier' => array( 'contentclass_attribute_identifier' ),
00158                                                                           'attribute' => array( 'contentclassattribute_id' ),
00159                                                                           'class_identifier' => array( 'object', 'class_identifier' ),
00160                                                                           'class' => array( 'object', 'contentclass_id' ) ),
00161                                                'attribute_access' => array( array( 'edit_template' ) ),
00162                                                'use_views' => false ),
00163 
00164                 'attribute_pdf_gui' => array( 'template_root' => 'content/datatype/pdf',
00165                                               'input_name' => 'attribute',
00166                                               'output_name' => 'attribute',
00167                                               'namespace' => 'ContentAttribute',
00168                                               'attribute_keys' => array( 'attribute_identifier' => array( 'contentclass_attribute_identifier' ),
00169                                                                          'attribute' => array( 'contentclassattribute_id' ),
00170                                                                          'class_identifier' => array( 'object', 'class_identifier' ),
00171                                                                          'class' => array( 'object', 'contentclass_id' ) ),
00172                                               'attribute_access' => array( array( 'view_template' ) ),
00173                                               'use_views' => false ),
00174 
00175                 'attribute_view_gui' => array( 'template_root' => array( 'type' => 'multi_match',
00176                                                                          'attributes' => array( 'is_information_collector' ),
00177                                                                          'matches' => array( array( false,
00178                                                                                                     'content/datatype/view' ),
00179                                                                                              array( true,
00180                                                                                                     'content/datatype/collect' ) ) ),
00181                                                'render_mode' => false,
00182                                                'input_name' => 'attribute',
00183                                                'output_name' => 'attribute',
00184                                                'namespace' => 'ContentAttribute',
00185                                                'attribute_keys' => array( 'attribute_identifier' => array( 'contentclass_attribute_identifier' ),
00186                                                                           'attribute' => array( 'contentclassattribute_id' ),
00187                                                                           'class_identifier' => array( 'object', 'class_identifier' ),
00188                                                                           'class' => array( 'object', 'contentclass_id' ) ),
00189                                                'attribute_access' => array( array( 'view_template' ) ),
00190                                                'optional_views' => true,
00191                                                'use_views' => 'view' ),
00192 
00193                 'attribute_diff_gui' => array( 'template_root' => 'content/datatype/diff',
00194                                                'input_name' => 'attribute',
00195                                                'output_name' => 'attribute',
00196                                                'namespace' => 'ContentAttribute',
00197                                                'attribute_keys' => array( 'attribute_identifier' => array( 'contentclass_attribute_identifier' ),
00198                                                                           'attribute' => array( 'contentclassattribute_id' ),
00199                                                                           'class_identifier' => array( 'object', 'class_identifier' ),
00200                                                                           'class' => array( 'object', 'contentclass_id' ) ),                                               'attribute_access' => array( array( 'view_template' ) ),
00201                                                'attribute_access' => array( array( 'view_template' ) ),
00202                                                'use_views' => false ),
00203 
00204                 'attribute_result_gui' => array( 'template_root' => 'content/datatype/result',
00205                                                  'render_mode' => false,
00206                                                  'input_name' => 'attribute',
00207                                                  'output_name' => 'attribute',
00208                                                  'namespace' => 'CollectionAttribute',
00209                                                  'attribute_keys' => array( 'attribute_identifier' => array( 'contentclass_attribute_identifier' ),
00210                                                                             'attribute' => array( 'contentclassattribute_id' ),
00211                                                                             'class_identifier' => array( 'object', 'class_identifier' ),
00212                                                                             'class' => array( 'object', 'contentclass_id' ) ),
00213                                                  'attribute_access' => array( array( 'result_template' ) ),
00214                                                  'optional_views' => true,
00215                                                  'use_views' => 'view' ),
00216 
00217                 'related_view_gui' => array( 'template_root' => 'content/related',
00218                                              'input_name' => 'related_object',
00219                                              'output_name' => 'related_object',
00220                                              'namespace' => 'RelatedView',
00221                                              'attribute_keys' => array( 'object' => array( 'id' ),
00222                                                                         'class' => array( 'class_id' ),
00223                                                                         'section' => array( 'section_id' ),
00224                                                                         'class_identifier' => array( 'class_identifier' ) ),
00225                                              'attribute_access' => array(),
00226                                              'use_views' => 'view' ),
00227 
00228                 'shop_account_view_gui' => array( 'template_root' => "shop/accounthandlers",
00229                                                   'input_name' => 'order',
00230                                                   'output_name' => 'order',
00231                                                   'namespace' => 'ShopAccount',
00232                                                   'attribute_access' => array( array( 'account_view_template' ) ),
00233                                                   'use_views' => 'view' ),
00234 
00235                 'content_view_gui' => array( 'template_root' => 'content/view',
00236                                              'input_name' => 'content_object',
00237                                              'output_name' => 'object',
00238                                              'namespace' => 'ContentView',
00239                                              'attribute_keys' => array( 'object' => array( 'id' ),
00240                                                                         'class_group' => array( 'match_ingroup_id_list' ),
00241                                                                         'class' => array( 'contentclass_id' ),
00242                                                                         'section' => array( 'section_id' ),
00243                                                                         'class_identifier' => array( 'class_identifier' ) ),
00244                                              'attribute_access' => array(),
00245                                              'use_views' => 'view' ),
00246 
00247 
00248                 'content_pdf_gui' => array( 'template_root' => 'content/pdf',
00249                                              'input_name' => 'content_object',
00250                                              'output_name' => 'object',
00251                                              'namespace' => 'ContentView',
00252                                              'attribute_keys' => array( 'object' => array( 'id' ),
00253                                                                         'class' => array( 'contentclass_id' ),
00254                                                                         'section' => array( 'section_id' ),
00255                                                                         'class_identifier' => array( 'class_identifier' ) ),
00256                                              'attribute_access' => array(),
00257                                              'use_views' => 'view' ),
00258 
00259                 'content_version_view_gui' => array( 'template_root' => 'content/version/view',
00260                                                      'input_name' => 'content_version',
00261                                                      'output_name' => 'version',
00262                                                      'namespace' => 'VersionView',
00263                                                      'attribute_keys' => array( 'object' => array( 'contentobject_id' ),
00264                                                                                 'class' => array( 'contentobject', 'contentclass_id' ),
00265                                                                                 'section' => array( 'contentobject', 'section_id' ),
00266                                                                                 'class_identifier' => array( 'contentobject', 'class_identifier' ) ),
00267                                                      'attribute_access' => array(),
00268                                                      'use_views' => 'view' ),
00269 
00270                 'node_view_gui' => array( 'template_root' => 'node/view',
00271                                           'input_name' => 'content_node',
00272                                           'output_name' => 'node',
00273                                           'namespace' => 'NodeView',
00274                                           'constant_template_variables' => array( 'view_parameters' => array( 'offset' => 0 ) ),
00275                                           'attribute_keys' => array( 'node' => array( 'node_id' ),
00276                                                                      'object' => array( 'contentobject_id' ),
00277                                                                      'class' => array( 'object', 'contentclass_id' ),
00278                                                                      'section' => array( 'object', 'section_id' ),
00279                                                                      'class_identifier' => array( 'object', 'class_identifier' ),
00280                                                                      'class_group' => array( 'object','match_ingroup_id_list' ),
00281                                                                      'parent_node' => array( 'parent_node_id' ),
00282                                                                      'depth' => array( 'depth' ),
00283                                                                      'url_alias' => array( 'url_alias' ),
00284                                                                      'parent_class_identifier' => array( 'parent', 'class_identifier' ) ),
00285                                           'attribute_access' => array(),
00286                                           'use_views' => 'view' ),
00287 
00288                 'collaboration_view_gui' => array( 'template_root' => 'collaboration/handlers/view',
00289                                                    'input_name' => 'collaboration_item',
00290                                                    'output_name' => 'item',
00291                                                    'namespace' => 'Collaboration',
00292                                                    'attribute_keys' => array(),
00293                                                    'attribute_access' => array( array( 'type_identifier' ) ),
00294                                                    'use_views' => 'view' ),
00295 
00296                 'collaboration_icon' => array( 'template_root' => 'collaboration/handlers/icon',
00297                                                'input_name' => 'collaboration_item',
00298                                                'output_name' => 'item',
00299                                                'namespace' => 'Collaboration',
00300                                                'attribute_keys' => array(),
00301                                                'attribute_access' => array( array( 'type_identifier' ) ),
00302                                                'use_views' => 'view' ),
00303 
00304                 'collaboration_simple_message_view' => array( 'template_root' => 'collaboration/message/view',
00305                                                               'input_name' => 'collaboration_message',
00306                                                               'output_name' => 'item',
00307                                                               'namespace' => 'CollaborationMessage',
00308                                                               'attribute_keys' => array(),
00309                                                               'attribute_access' => array( array( 'message_type' ) ),
00310                                                               'use_views' => 'view' ),
00311 
00312                 'collaboration_participation_view' => array( 'template_root' => array( 'type' => 'multi_match',
00313                                                                                        'attributes' => array( 'is_builtin_type' ),
00314                                                                                        'matches' => array( array( true,
00315                                                                                                                   'collaboration/participation/view' ),
00316                                                                                                            array( false,
00317                                                                                                                   array( 'collaboration/participation/view/custom',
00318                                                                                                                          array( array( 'participant_type_string' ) ) ) ) ) ),
00319                                                              'input_name' => 'collaboration_participant',
00320                                                              'output_name' => 'item',
00321                                                              'namespace' => 'CollaborationParticipant',
00322                                                              'attribute_keys' => array(),
00323                                                              'attribute_access' => array( array( 'participant_type_string' ) ),
00324                                                              'use_views' => 'view' ),
00325 
00326                 'event_edit_gui' => array( 'template_root' => 'workflow/eventtype/edit',
00327                                            'input_name' => 'event',
00328                                            'output_name' => 'event',
00329                                            'namespace' => 'WorkflowEvent',
00330                                            'attribute_access' => array( array( 'workflow_type_string' ) ),
00331                                            'use_views' => false ),
00332 
00333                 'event_view_gui' => array( 'template_root' => 'workflow/eventtype/view',
00334                                            'input_name' => 'event',
00335                                            'output_name' => 'event',
00336                                            'namespace' => 'WorkflowEvent',
00337                                            'attribute_access' => array( array( 'workflow_type_string' ) ),
00338                                            'use_views' => false ),
00339 
00340                 'class_attribute_view_gui' => array( 'template_root' => 'class/datatype/view',
00341                                                      'input_name' => 'class_attribute',
00342                                                      'output_name' => 'class_attribute',
00343                                                      'namespace' => 'ClassAttribute',
00344                                                      'attribute_access' => array( array( 'data_type',
00345                                                                                          'information',
00346                                                                                          'string' ) ),
00347                                                      'use_views' => false ),
00348 
00349                 'class_attribute_edit_gui' => array( 'template_root' => 'class/datatype/edit',
00350                                                      'input_name' => 'class_attribute',
00351                                                      'output_name' => 'class_attribute',
00352                                                      'namespace' => 'ClassAttribute',
00353                                                      'attribute_access' => array( array( 'data_type',
00354                                                                                          'information',
00355                                                                                          'string' ) ),
00356                                                      'use_views' => false ) );
00357             return new eZObjectForwarder( $forward_rules );
00358         }
00359 }
00360 
00361 ?>