Show
Ignore:
Timestamp:
02/27/08 10:16:26 (9 months ago)
Author:
llaumgui
Message:

maj

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ez_publish/myutils/trunk/autoloads/myutils_operators.php

    r99 r108  
    4040        { 
    4141                /* Opérateurs */ 
    42                 $this->Operators = array(       'path_to_path_array', 
     42                $this->Operators = array(       'is_debug_enabled', 
     43                                                                        'path_to_path_array', 
    4344                                                                        'redirect', 
    4445                                                                        'str_ireplace', 
     
    6162        function namedParameterList() 
    6263        { 
    63                  return array(  'redirect'                                              => array( 
     64                 return array(  'is_debug_enabled'                      => array( 
     65                                                                                                        ), 
     66 
     67                                                'path_to_path_array'                    => array( 
     68                                                                'path'                  => array( 'url'         => 'array', 'required' => true, 'default' => ''  ), 
     69                                                                                                        ), 
     70                 
     71                                                'redirect'                                              => array( 
    6472                                                                'url'                   => array( 'url'         => 'string', 'required' => true, 'default' => ''  ), 
    6573                                                                'type'                  => array( 'type' => 'integer', 'required' => false, 'default' => '301' ) 
    6674                                                                                                        ), 
    6775                                                                                                         
    68                                                 'path_to_path_array'                    => array( 
    69                                                                 'path'                  => array( 'url'         => 'array', 'required' => true, 'default' => ''  ), 
    70                                                                                                         ), 
    7176                 
    7277                                                'str_ireplace'                                  => array(        
     
    9196            switch ( $operatorName ) 
    9297            { 
    93                 case 'redirect': 
     98                case 'is_debug_enabled': 
     99                        $operatorValue = $this->isDebugEnabled(); 
     100                        break; 
     101 
     102                case 'path_to_path_array': 
     103                        $operatorValue = $this->path2PathArray(         $namedParameters['path'] ); 
     104                        break; 
     105                        case 'redirect': 
    94106                        $operatorValue = $this->redirect(       $namedParameters['url'], 
    95107                                                                                                $namedParameters['type'] ); 
    96108                        break; 
    97                 case 'path_to_path_array': 
    98                         $operatorValue = $this->path2PathArray(         $namedParameters['path'] ); 
    99                         break; 
     109 
    100110                        case 'str_ireplace': 
    101111                        $operatorValue = $this->strIReplace(    $namedParameters['search'], 
     
    103113                                                                                                        $namedParameters['subject'] ); 
    104114                        break; 
     115 
    105116                        case 'str_replace': 
    106117                        $operatorValue = $this->strReplace(     $namedParameters['search'], 
     
    117128         * 
    118129         * ###################################################################### */ 
     130         
     131        /** 
     132         * Retourne l'info si le débug est activé. 
     133         * Peut servir pour conditionner la feuille de style débug. 
     134         *        
     135         * @author Guillaume Kulakowski <guillaume_AT_llaumgui_DOT_com> 
     136         * @since 1.0 
     137         * 
     138         * @return boolean 
     139         */ 
     140        function isDebugEnabled() 
     141        { 
     142                return eZDebug::isDebugEnabled(); 
     143        } 
     144 
     145 
     146 
    119147        /** 
    120148         * Converti un "path" en "path_array". 
     
    131159        { 
    132160                $path_array     = array(); 
     161                if ( !is_array( $path ) ) 
     162                        return array(); 
     163 
    133164                foreach ( $path as $p ) 
    134165                {