Changeset 108 for ez_publish/myutils/trunk/autoloads/myutils_operators.php
- Timestamp:
- 02/27/08 10:16:26 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ez_publish/myutils/trunk/autoloads/myutils_operators.php
r99 r108 40 40 { 41 41 /* Opérateurs */ 42 $this->Operators = array( 'path_to_path_array', 42 $this->Operators = array( 'is_debug_enabled', 43 'path_to_path_array', 43 44 'redirect', 44 45 'str_ireplace', … … 61 62 function namedParameterList() 62 63 { 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( 64 72 'url' => array( 'url' => 'string', 'required' => true, 'default' => '' ), 65 73 'type' => array( 'type' => 'integer', 'required' => false, 'default' => '301' ) 66 74 ), 67 75 68 'path_to_path_array' => array(69 'path' => array( 'url' => 'array', 'required' => true, 'default' => '' ),70 ),71 76 72 77 'str_ireplace' => array( … … 91 96 switch ( $operatorName ) 92 97 { 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': 94 106 $operatorValue = $this->redirect( $namedParameters['url'], 95 107 $namedParameters['type'] ); 96 108 break; 97 case 'path_to_path_array': 98 $operatorValue = $this->path2PathArray( $namedParameters['path'] ); 99 break; 109 100 110 case 'str_ireplace': 101 111 $operatorValue = $this->strIReplace( $namedParameters['search'], … … 103 113 $namedParameters['subject'] ); 104 114 break; 115 105 116 case 'str_replace': 106 117 $operatorValue = $this->strReplace( $namedParameters['search'], … … 117 128 * 118 129 * ###################################################################### */ 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 119 147 /** 120 148 * Converti un "path" en "path_array". … … 131 159 { 132 160 $path_array = array(); 161 if ( !is_array( $path ) ) 162 return array(); 163 133 164 foreach ( $path as $p ) 134 165 {
