Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezmodule.php
Go to the documentation of this file.
1 <?php
35 class eZModule
36 {
37 public $ViewActionParameters;
42 const STATUS_IDLE = 0;
43
48 const STATUS_OK = 1;
49
54 const STATUS_FAILED = 2;
55
60 const STATUS_REDIRECT = 3;
61
66 const STATUS_RERUN = 4;
67
72 const HOOK_STATUS_OK = 0;
73
78 const HOOK_STATUS_CANCEL_RUN = 1;
79
84 const HOOK_STATUS_FAILED = 2;
85
92 public $Functions;
93
104 public $Module;
105
110 public $Name;
111
117 public $Path;
118
126 public $ExitStatus;
127
133 public $ErrorCode;
134
140 public $RedirectURI;
141
147 public $RedirectStatus;
148
154 public $Title;
155
161 public $HookList;
162
169 public $ViewActions;
170
176 public $ViewResult;
177
183 public $ViewParameters;
184
190 public $OriginalParameters;
191
197 public $OriginalViewParameters;
198
204 public $NamedParameters;
205
211 public $OriginalUnorderedParameters;
212
218 public $UserParameters;
219
226 public $UIContext;
227
234 public $UIComponent;
235
242 public $UIComponentMatch;
243
244 public static $useExceptions;
245 public $FunctionList;
246 public $NavigationParts;
247
248
261 public function __construct( $path, $file, $moduleName, $checkFileExistence = true )
262 {
263 $this->initialize( $path, $file, $moduleName, $checkFileExistence);
264 }
265
280 function initialize( $path, $file, $moduleName, $checkFileExistence = true )
281 {
282 if ( $checkFileExistence === false || file_exists( $file ) )
283 {
284 unset( $FunctionList );
285 unset( $Module );
286 unset( $ViewList );
287 include( $file );
288 $this->Functions = $ViewList;
289 if ( isset( $FunctionList ) and
290 is_array( $FunctionList ) and
291 count( $FunctionList ) > 0 )
292 {
293 ksort( $FunctionList, SORT_STRING );
294 $this->FunctionList = $FunctionList;
295 }
296 else
297 {
298 $this->FunctionList = array();
299 }
300 if ( empty( $Module ) )
301 {
302 $Module = array( "name" => "null",
303 "variable_params" => false,
304 "function" => array() );
305 }
306 $this->Module = $Module;
307 $this->Name = $moduleName;
308 $this->Path = $path;
309 $this->Title = "";
310 $this->UIContext = 'navigation';
311 $this->UIComponent = $moduleName;
312
313 $uiComponentMatch = 'module';
314 if ( isset( $this->Module['ui_component_match'] ) )
315 {
316 $uiComponentMatch = $this->Module['ui_component_match'];
317 }
318 $this->UIComponentMatch = $uiComponentMatch;
319
320 foreach( $this->Functions as $key => $dummy)
321 {
322 $this->Functions[$key]["uri"] = "/$moduleName/$key";
323 }
324 }
325 else
326 {
327 $this->Functions = array();
328 $this->Module = array( "name" => "null",
329 "variable_params" => false,
330 "function" => array() );
331 $this->Name = $moduleName;
332 $this->Path = $path;
333 $this->Title = "";
334 $this->UIContext = 'navigation';
335 $this->UIComponent = $moduleName;
336 $this->UIComponentMatch = 'module';
337 }
338 $this->HookList = array();
339 $this->ExitStatus = self::STATUS_IDLE;
340 $this->ErrorCode = 0;
341 $this->ViewActions = array();
342 $this->OriginalParameters = null;
343 $this->UserParameters = array();
344
345 // Load in navigation part overrides
346 $ini = eZINI::instance( 'module.ini' );
347 $this->NavigationParts = $ini->variable( 'ModuleOverrides', 'NavigationPart' );
348 }
349
356 function uri()
357 {
358 return "/" . $this->Name;
359 }
360
373 function functionURI( $function )
374 {
375 if ( $this->singleFunction() or
376 $function == '' )
377 return $this->uri();
378 if ( isset( $this->Functions[$function] ) )
379 return $this->Functions[$function]["uri"];
380 else
381 return null;
382 }
383
392 function title()
393 {
394 return $this->Title;
395 }
396
404 function setTitle( $title )
405 {
406 $this->Title = $title;
407 }
408
419 function setCurrentName( $name )
420 {
421 $this->Name = $name;
422 foreach( $this->Functions as $key => $dummy )
423 {
424 $this->Functions[$key]["uri"] = "/$name/$key";
425 }
426 }
427
437 function setCurrentView( $name )
438 {
439 $GLOBALS['eZModuleCurrentView'] = $name;
440 }
441
446 function singleFunction()
447 {
448 return count( $this->Functions ) == 0;
449 }
450
457 function uiContextName()
458 {
459 return $this->UIContext;
460 }
461
469 function uiComponentName()
470 {
471 return $this->UIComponent;
472 }
473
483 function setUIContextName( $context )
484 {
485 $this->UIContext = $context;
486 }
487
497 function setUIComponentName( $component )
498 {
499 $this->UIComponent = $component;
500 }
501
509 function exitStatus()
510 {
511 return $this->ExitStatus;
512 }
513
523 function setExitStatus( $stat )
524 {
525 $this->ExitStatus = $stat;
526 }
527
536 function errorCode()
537 {
538 return $this->ErrorCode;
539 }
540
548 function setErrorCode( $errorCode )
549 {
550 $this->ErrorCode = $errorCode;
551 }
552
560 function errorModule()
561 {
562 if ( !isset( $GLOBALS['eZModuleGlobalErrorModule'] ) )
563 $GLOBALS['eZModuleGlobalErrorModule'] = array( 'module' => 'error',
564 'view' => 'view' );
565 return $GLOBALS['eZModuleGlobalErrorModule'];
566 }
567
576 function setErrorModule( $moduleName, $viewName )
577 {
578 $GLOBALS['eZModuleGlobalErrorModule'] = array( 'module' => $moduleName,
579 'view' => $viewName );
580 }
581
593 function handleError( $errorCode, $errorType = false, $parameters = array(), $userParameters = false )
594 {
595 if ( self::$useExceptions && $errorType === "kernel" )
596 {
597 switch ( $errorCode )
598 {
599 case eZError::KERNEL_MODULE_NOT_FOUND:
600 throw new ezpModuleNotFound( $parameters["module"] );
601
602 case eZError::KERNEL_MODULE_DISABLED:
603 if ( $parameters["check"]["view_checked"] )
604 throw new ezpModuleViewDisabled( $parameters["check"]['module'], $parameters["check"]['view'] );
605
606 throw new ezpModuleDisabled( $parameters["check"]['module'] );
607
608 case eZError::KERNEL_MODULE_VIEW_NOT_FOUND:
609 throw new ezpModuleViewNotFound( $parameters["check"]['module'], $parameters["check"]['view'] );
610
611 case eZError::KERNEL_ACCESS_DENIED:
612 throw new ezpAccessDenied;
613
614 //case eZError::KERNEL_MOVED:
615 // @todo ?
616
617 case eZError::KERNEL_NOT_AVAILABLE:
618 case eZError::KERNEL_NOT_FOUND:
619 throw new ezpContentNotFoundException( "" );
620
621 case eZError::KERNEL_LANGUAGE_NOT_FOUND:
622 throw new ezpLanguageNotFound;
623 }
624 }
625
626 if ( !$errorType )
627 {
628 eZDebug::writeWarning( "No error type specified for error code $errorCode, assuming kernel.\nA specific error type should be supplied, please check your code.", __METHOD__ );
629 $errorType = 'kernel';
630 }
631 $errorModule = $this->errorModule();
632
633 $module = self::findModule( $errorModule['module'], $this );
634
635 if ( $module === null )
636 {
637 return false;
638 }
639
640 $result = $module->run( $errorModule['view'], array( $errorType, $errorCode, $parameters, $userParameters ) );
641 // The error module may want to redirect to another URL, see error.ini
642 if ( $this->exitStatus() != self::STATUS_REDIRECT and
643 $this->exitStatus() != self::STATUS_RERUN )
644 {
645 $this->setExitStatus( self::STATUS_FAILED );
646 $this->setErrorCode( $errorCode );
647 }
648 return $result;
649 }
650
668 function redirect( $moduleName, $viewName, $parameters = array(),
669 $unorderedParameters = null, $userParameters = false,
670 $anchor = false )
671 {
672 $module = self::exists( $moduleName );
673 if ( $module )
674 {
675 return $this->redirectModule( $module, $viewName, $parameters,
676 $unorderedParameters, $userParameters, $anchor );
677 }
678 else
679 {
680 eZDebug::writeError( 'Undefined module: ' . $moduleName, __METHOD__ );
681 }
682 return false;
683 }
684
698 function redirectToView( $viewName = '', $parameters = array(),
699 $unorderedParameters = null, $userParameters = false,
700 $anchor = false )
701 {
702 return $this->redirectModule( $this, $viewName, $parameters,
703 $unorderedParameters, $userParameters, $anchor );
704 }
705
723 function redirectModule( $module, $viewName, $parameters = array(),
724 $unorderedParameters = null, $userParameters = false,
725 $anchor = false )
726 {
727 $uri = $this->redirectionURIForModule( $module, $viewName, $parameters,
728 $unorderedParameters, $userParameters, $anchor );
729 $this->redirectTo( $uri );
730 return true;
731 }
732
748 function redirectionURI( $moduleName, $viewName, $parameters = array(),
749 $unorderedParameters = null, $userParameters = false,
750 $anchor = false )
751 {
752 $module = self::exists( $moduleName );
753 if ( $module )
754 {
755 return $this->redirectionURIForModule( $module, $viewName, $parameters,
756 $unorderedParameters, $userParameters, $anchor );
757 }
758 else
759 eZDebug::writeError( 'Undefined module: ' . $moduleName, __METHOD__ );
760 return false;
761 }
762
770 function currentRedirectionURI()
771 {
772 $module = $this;
773 $viewName = self::currentView();
774 $parameters = $this->OriginalViewParameters;
775 $unorderedParameters = $this->OriginalUnorderedParameters;
776 $userParameters = $this->UserParameters;
777 return $this->redirectionURIForModule( $module, $viewName, $parameters,
778 $unorderedParameters, $userParameters );
779 }
780
793 function redirectCurrent()
794 {
795 $this->redirectTo( $this->currentRedirectionURI() );
796 }
797
814 function redirectionURIForModule( $module, $viewName, $parameters = array(),
815 $unorderedParameters = null, $userParameters = false,
816 $anchor = false )
817 {
818 if ( $viewName == '' )
819 $viewName = self::currentView();
820 $uri = $module->functionURI( $viewName );
821 $uri .= '/';
822 $viewParameters = $module->parameters( $viewName );
823 $parameterIndex = 0;
824 $unorderedURI = '';
825 $hasUnorderedParameter = false;
826 if ( $unorderedParameters !== null )
827 {
828 $unorderedViewParameters = $module->unorderedParameters( $viewName );
829 if ( is_array( $unorderedViewParameters ) )
830 {
831 foreach ( $unorderedViewParameters as $unorderedViewParameterName => $unorderedViewParameterVariable )
832 {
833 if ( isset( $unorderedParameters[$unorderedViewParameterVariable] ) )
834 {
835 $unorderedURI .= $unorderedViewParameterName . '/' . $unorderedParameters[$unorderedViewParameterVariable] . '/';
836 $hasUnorderedParameter = true;
837 }
838 }
839 }
840 }
841
842 if( !isset( $viewParameters ) )
843 $viewParameters = array(); // prevent PHP warning below
844
845 foreach ( $viewParameters as $viewParameter )
846 {
847 if ( !isset( $parameters[$parameterIndex] ) )
848 {
849 // We don't show a warning anymore since some parameters can be optional
850 // In future versions we will need required and optional parameters
851 // for modules and give warnings for required ones.
852 // eZDebug::writeWarning( "Missing parameter(s) " . implode( ', ', array_slice( $viewParameters, $parameterIndex ) ) .
853 // " in view '$viewName'", 'eZModule::redirect' );
854 }
855 else
856 $uri .= $parameters[$parameterIndex] . '/';
857 ++$parameterIndex;
858 }
859 if ( $hasUnorderedParameter )
860 {
861 $uri .= $unorderedURI;
862 }
863
864 if ( !empty( $userParameters ) && is_array( $userParameters ) )
865 {
866 // Remove any slash(es) at the end of the uri, because the user params are appended with a leading slash
867 $uri = preg_replace( "#(^.*)(/+)$#", "\$1", $uri );
868 foreach ( $userParameters as $name => $value )
869 {
870 $uri .= '/(' . $name . ')/' . $value;
871 }
872 }
873
874 // Remove multiple slashes at the end of the uri
875 $uri = preg_replace( "#(^.*)(//+)$#", "\$1", $uri );
876 if ( $anchor !== false )
877 $uri .= '#' . urlencode( $anchor );
878 return $uri;
879 }
880
891 function parameters( $viewName = '' )
892 {
893 if ( $viewName == '' )
894 $viewName = self::currentView();
895 $viewData = $this->viewData( $viewName );
896 if ( isset( $viewData['params'] ) )
897 {
898 return $viewData['params'];
899 }
900 return null;
901 }
902
914 function unorderedParameters( $viewName = '' )
915 {
916 if ( $viewName == '' )
917 $viewName = self::currentView();
918 $viewData = $this->viewData( $viewName );
919 if ( isset( $viewData['unordered_params'] ) )
920 {
921 return $viewData['unordered_params'];
922 }
923 return null;
924 }
925
935 function viewData( $viewName = '' )
936 {
937 if ( $viewName == '' )
938 $viewName = self::currentView();
939 if ( $this->singleFunction() )
940 $viewData = $this->Module["function"];
941 else
942 $viewData = $this->Functions[$viewName];
943 return $viewData;
944 }
945
955 function redirectTo( $uri )
956 {
957 $originalURI = $uri;
958 $uri = preg_replace( "#(^.*)(/+)$#", "\$1", $uri );
959 if ( strlen( $originalURI ) != 0 and
960 strlen( $uri ) == 0 )
961 $uri = '/';
962
963 $urlComponents = parse_url( $uri );
964 // eZSys::hostname() can contain port if present.
965 // So parsing it with parse_url() as well to only get host.
966 $currentHostname = eZSys::hostname();
967 $currentHostnameParsed = parse_url( $currentHostname, PHP_URL_HOST );
968 $currentHostname = $currentHostnameParsed ? $currentHostnameParsed : $currentHostname;
969 if ( isset( $urlComponents['host'] ) && $urlComponents['host'] !== $currentHostname )
970 {
971 $allowedHosts = $this->getAllowedRedirectHosts();
972 if ( !isset( $allowedHosts[$urlComponents['host']] ) )
973 {
974 // Non-authorized host, return only the URI (without host) + query string and fragment if present.
975 eZDebug::writeError( "Redirection requested on non-authorized host '{$urlComponents['host']}'" );
976 header( $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden' );
977 echo "Redirection requested on non-authorized host";
978 eZDB::checkTransactionCounter();
979 eZExecution::cleanExit();
980 }
981 }
982
983 $this->RedirectURI = $uri;
984 $this->setExitStatus( self::STATUS_REDIRECT );
985 }
986
992 private function getAllowedRedirectHosts()
993 {
994 $ini = eZINI::instance();
995 $allowedHosts = array_fill_keys( $ini->variable( 'SiteSettings', 'AllowedRedirectHosts' ), true );
996 // Adding HostMatchMapItems from siteaccess match if present
997 if ( $ini->hasVariable( 'SiteAccessSettings', 'HostMatchMapItems' ) )
998 {
999 $hostMatchMapItems = $ini->variable( 'SiteAccessSettings', 'HostMatchMapItems' );
1000 foreach ( $hostMatchMapItems as $item )
1001 {
1002 list( $host, $sa ) = explode( ';', $item );
1003 $allowedHosts[$host] = true;
1004 }
1005 }
1006
1007 // Adding HostUriMatchMapItems
1008 foreach ( $ini->variable( 'SiteAccessSettings', 'HostUriMatchMapItems' ) as $item )
1009 {
1010 list( $host, $uri, $sa ) = explode( ';', $item );
1011 $allowedHosts[$host] = true;
1012 }
1013
1014 return $allowedHosts;
1015 }
1016
1024 function redirectURI()
1025 {
1026 return $this->RedirectURI;
1027 }
1028
1036 function setRedirectURI( $uri )
1037 {
1038 $this->RedirectURI = $uri;
1039 }
1040
1048 function redirectStatus()
1049 {
1050 return $this->RedirectStatus;
1051 }
1052
1060 function setRedirectStatus( $status )
1061 {
1062 $this->RedirectStatus = $status;
1063 }
1064
1070 function attributes()
1071 {
1072 return array( "uri",
1073 "functions",
1074 'views',
1075 "name",
1076 "path",
1077 "info",
1078 "aviable_functions",
1079 "available_functions" );
1080 }
1081
1089 function hasAttribute( $attr )
1090 {
1091 return in_array( $attr, $this->attributes() );
1092 }
1093
1102 function attribute( $attr )
1103 {
1104 switch( $attr )
1105 {
1106 case "uri":
1107 return $this->uri();
1108 break;
1109 case "functions":
1110 return $this->Functions;
1111 case "views":
1112 return $this->Functions;
1113 case "name":
1114 return $this->Name;
1115 case "path":
1116 return $this->Path;
1117 case "info":
1118 return $this->Module;
1119 case 'aviable_functions':
1120 case 'available_functions':
1121 return $this->FunctionList;
1122 default:
1123 {
1124 eZDebug::writeError( "Attribute '$attr' does not exist", __METHOD__ );
1125 return null;
1126 }
1127 break;
1128 }
1129 }
1130
1142 function setCurrentAction( $actionName, $view = '' )
1143 {
1144 if ( $view == '' )
1145 $view = self::currentView();
1146 if ( $view == '' or $actionName == '' )
1147 return false;
1148 $this->ViewActions[$view] = $actionName;
1149 }
1150
1175 function currentAction( $view = '' )
1176 {
1177 if ( $view == '' )
1178 $view = self::currentView();
1179 if ( isset( $this->ViewActions[$view] ) )
1180 return $this->ViewActions[$view];
1181 $http = eZHTTPTool::instance();
1182 if ( isset( $this->Functions[$view]['default_action'] ) )
1183 {
1184 $defaultAction = $this->Functions[$view]['default_action'];
1185 foreach ( $defaultAction as $defaultActionStructure )
1186 {
1187 $actionName = $defaultActionStructure['name'];
1188 $type = $defaultActionStructure['type'];
1189 if ( $type == 'post' )
1190 {
1191 $parameters = array();
1192 if ( isset( $defaultActionStructure['parameters'] ) )
1193 $parameters = $defaultActionStructure['parameters'];
1194 $hasParameters = true;
1195 foreach ( $parameters as $parameterName )
1196 {
1197 if ( !$http->hasPostVariable( $parameterName ) )
1198 {
1199 $hasParameters = false;
1200 break;
1201 }
1202 }
1203 if ( $hasParameters )
1204 {
1205 $this->ViewActions[$view] = $actionName;
1206 return $this->ViewActions[$view];
1207 }
1208 }
1209 else
1210 {
1211 eZDebug::writeWarning( 'Unknown default action type: ' . $type, __METHOD__ );
1212 }
1213 }
1214 }
1215 if ( isset( $this->Functions[$view]['single_post_actions'] ) )
1216 {
1217 $singlePostActions = $this->Functions[$view]['single_post_actions'];
1218 foreach( $singlePostActions as $postActionName => $realActionName )
1219 {
1220 if ( $http->hasPostVariable( $postActionName ) )
1221 {
1222 $this->ViewActions[$view] = $realActionName;
1223 return $this->ViewActions[$view];
1224 }
1225 }
1226 }
1227 if ( isset( $this->Functions[$view]['post_actions'] ) )
1228 {
1229 $postActions = $this->Functions[$view]['post_actions'];
1230 foreach( $postActions as $postActionName )
1231 {
1232 if ( $http->hasPostVariable( $postActionName ) )
1233 {
1234 $this->ViewActions[$view] = $http->postVariable( $postActionName );
1235 return $this->ViewActions[$view];
1236 }
1237 }
1238 }
1239
1240 $this->ViewActions[$view] = false;
1241 return false;
1242 }
1243
1255 function setActionParameter( $parameterName, $parameterValue, $view = '' )
1256 {
1257 if ( $view == '' )
1258 $view = self::currentView();
1259 $this->ViewActionParameters[$view][$parameterName] = $parameterValue;
1260 }
1261
1272 function actionParameter( $parameterName, $view = '' )
1273 {
1274 if ( $view == '' )
1275 $view = self::currentView();
1276 if ( isset( $this->ViewActionParameters[$view][$parameterName] ) )
1277 return $this->ViewActionParameters[$view][$parameterName];
1278 $currentAction = $this->currentAction( $view );
1279 $http = eZHTTPTool::instance();
1280 if ( isset( $this->Functions[$view]['post_action_parameters'][$currentAction] ) )
1281 {
1282 $postParameters = $this->Functions[$view]['post_action_parameters'][$currentAction];
1283 if ( isset( $postParameters[$parameterName] ) &&
1284 $http->hasPostVariable( $postParameters[$parameterName] ) )
1285 {
1286 return $http->postVariable( $postParameters[$parameterName] );
1287 }
1288 eZDebug::writeError( "No such action parameter: $parameterName", __METHOD__ );
1289 }
1290 if ( isset( $this->Functions[$view]['post_value_action_parameters'][$currentAction] ) )
1291 {
1292 $postParameters = $this->Functions[$view]['post_value_action_parameters'][$currentAction];
1293 if ( isset( $postParameters[$parameterName] ) )
1294 {
1295 $postVariables = $http->attribute( 'post' );
1296 $postVariableNameMatch = $postParameters[$parameterName];
1297 $regMatch = "/^" . $postVariableNameMatch . "_(.+)$/";
1298 foreach ( $postVariables as $postVariableName => $postVariableValue )
1299 {
1300 if ( preg_match( $regMatch, $postVariableName, $matches ) )
1301 {
1302 $parameterValue = $matches[1];
1303 $this->ViewActionParameters[$view][$parameterName] = $parameterValue;
1304 return $parameterValue;
1305 }
1306 }
1307 eZDebug::writeError( "No such action parameter: $parameterName", __METHOD__ );
1308 }
1309 }
1310 return null;
1311 }
1312
1324 function hasActionParameter( $parameterName, $view = '' )
1325 {
1326 if ( $view == '' )
1327 $view = self::currentView();
1328 if ( isset( $this->ViewActionParameters[$view][$parameterName] ) )
1329 return true;
1330 $currentAction = $this->currentAction( $view );
1331 $http = eZHTTPTool::instance();
1332 if ( isset( $this->Functions[$view]['post_action_parameters'][$currentAction] ) )
1333 {
1334 $postParameters = $this->Functions[$view]['post_action_parameters'][$currentAction];
1335 if ( isset( $postParameters[$parameterName] ) and
1336 $http->hasPostVariable( $postParameters[$parameterName] ) )
1337 {
1338 return true;
1339 }
1340 }
1341 if ( isset( $this->Functions[$view]['post_value_action_parameters'][$currentAction] ) )
1342 {
1343 $postParameters = $this->Functions[$view]['post_value_action_parameters'][$currentAction];
1344 if ( isset( $postParameters[$parameterName] ) )
1345 {
1346 $postVariables = $http->attribute( 'post' );
1347 $postVariableNameMatch = $postParameters[$parameterName];
1348 $regMatch = "/^" . $postVariableNameMatch . "_(.+)$/";
1349 foreach ( $postVariables as $postVariableName => $postVariableValue )
1350 {
1351 if ( preg_match( $regMatch, $postVariableName, $matches ) )
1352 {
1353 $parameterValue = $matches[1];
1354 $this->ViewActionParameters[$view][$parameterName] = $parameterValue;
1355 return true;
1356 }
1357 }
1358 }
1359 }
1360 return false;
1361 }
1362
1373 function isCurrentAction( $actionName, $view = '' )
1374 {
1375 if ( $view == '' )
1376 $view = self::currentView();
1377 if ( $view == '' or $actionName == '' )
1378 return false;
1379 return $this->currentAction( $view ) == $actionName;
1380 }
1381
1405 function addHook( $hookName, $function, $priority = 1, $expandParameters = true, $append = false )
1406 {
1407 $hookEntries = isset( $this->HookList[$hookName] ) ? $this->HookList[$hookName] : false;
1408 if ( !is_array( $hookEntries ) )
1409 {
1410 $hookEntries = array();
1411 }
1412 $entry = array( 'function' => $function,
1413 'expand_parameters' => $expandParameters );
1414
1415 $position = $priority;
1416 if ( $append )
1417 {
1418 while ( isset( $hookEntries[$position] ) )
1419 ++$position;
1420 }
1421 else
1422 {
1423 while ( isset( $hookEntries[$position] ) )
1424 --$position;
1425 }
1426 $this->HookList[$hookName][$position] = $entry;
1427 }
1428
1444 function runHooks( $hookName, $parameters = null )
1445 {
1446 $status = null;
1447 $hookEntries = isset( $this->HookList[$hookName] ) ? $this->HookList[$hookName] : false;
1448 if ( isset( $hookEntries ) and
1449 is_array( $hookEntries ) )
1450 {
1451 ksort( $hookEntries );
1452 foreach ( $hookEntries as $hookEntry )
1453 {
1454 $function = $hookEntry['function'];
1455 $expandParameters = $hookEntry['expand_parameters'];
1456 if ( is_string( $function ) )
1457 {
1458 $functionName = $function;
1459 if ( function_exists( $functionName ) )
1460 {
1461 if ( $parameters === null ||
1462 $expandParameters === null )
1463 {
1464 $retVal = $functionName( $this );
1465 }
1466 else if ( $expandParameters )
1467 {
1468 $retVal = call_user_func_array( $functionName, array_merge( array( $this ), $parameters ) );
1469 }
1470 else
1471 {
1472 $retVal = $functionName( $this, $parameters );
1473 }
1474 }
1475 else
1476 {
1477 eZDebug::writeError( "Unknown hook function '$functionName' in hook: $hookName", __METHOD__ );
1478 }
1479 }
1480 else if ( is_array( $function ) )
1481 {
1482 if ( isset( $function[0] ) &&
1483 isset( $function[1] ) )
1484 {
1485 $object = $function[0];
1486 $functionName = $function[1];
1487 if ( method_exists( $object, $functionName ) )
1488 {
1489 if ( $parameters === null )
1490 {
1491 $retVal = $object->$function( $this );
1492 }
1493 else if ( $expandParameters )
1494 {
1495 $retVal = call_user_func_array( array( $object, $functionName ), array_merge( array( $this ), $parameters ) );
1496 }
1497 else
1498 {
1499 $retVal = $object->$functionName( $this, $parameters );
1500 }
1501 }
1502 else
1503 {
1504 eZDebug::writeError( "Unknown hook method '$functionName' in class '" . strtolower( get_class( $object ) ) . "' in hook: $hookName", __METHOD__ );
1505 }
1506 }
1507 else
1508 {
1509 eZDebug::writeError( "Missing data for method handling in hook: $hookName", __METHOD__ );
1510 }
1511 }
1512 else
1513 {
1514 eZDebug::writeError( 'Unknown entry type ' . gettype( $function ) . 'in hook: ' . $hookName, __METHOD__ );
1515 }
1516
1517 switch( $retVal )
1518 {
1519 case self::HOOK_STATUS_OK:
1520 {
1521 } break;
1522
1523 case self::HOOK_STATUS_FAILED:
1524 {
1525 eZDebug::writeWarning( 'Hook execution failed in hook: ' . $hookName, __METHOD__ );
1526 } break;
1527
1528 case self::HOOK_STATUS_CANCEL_RUN:
1529 {
1530 return $retVal;
1531 } break;
1532 }
1533 }
1534 }
1535 return $status;
1536 }
1537
1548 function setViewResult( $result, $view = '' )
1549 {
1550 if ( $view == '' )
1551 $view = $this->currentView();
1552 $this->ViewResult[$view] = $result;
1553 }
1554
1561 function hasViewResult( $view = '' )
1562 {
1563 if ( $view == '' )
1564 $view = $this->currentView();
1565 return isset( $this->ViewResult[$view] );
1566 }
1567
1576 function viewResult( $view = '' )
1577 {
1578 if ( $view == '' )
1579 $view = $this->currentView();
1580 if ( isset( $this->ViewResult[$view] ) )
1581 {
1582 return $this->ViewResult[$view];
1583 }
1584 return null;
1585 }
1586
1598 function forward( $module, $functionName, $parameters = false )
1599 {
1600 $Return = null;
1601 if ( $module && $functionName )
1602 {
1603 $viewName = self::currentView();
1604
1605 if ( $parameters === false)
1606 {
1607 $parameters = array();
1608 }
1609
1610 $parameters = array_merge( $parameters, $this->OriginalViewParameters );
1611 $unorderedParameters = $this->OriginalUnorderedParameters;
1612 $userParameters = $this->UserParameters;
1613
1614 $Return = $module->run( $functionName, $parameters, $unorderedParameters, $userParameters );
1615
1616 // override default navigation part
1617 if ( $Return['is_default_navigation_part'] === true )
1618 {
1619 if ( $this->singleFunction() )
1620 $function = $this->Module["function"];
1621 else
1622 $function = $this->Functions[$functionName];
1623
1624 if ( isset( $function['default_navigation_part'] ) )
1625 {
1626 $Return['navigation_part'] = $function['default_navigation_part'];
1627 }
1628 }
1629
1630 $this->RedirectURI = $module->redirectURI();
1631 $this->setExitStatus( $module->exitStatus() );
1632 }
1633 return $Return;
1634 }
1635
1652 function run( $functionName, $parameters = array(), $overrideParameters = false, $userParameters = false )
1653 {
1654 if ( count( $this->Functions ) > 0 and
1655 !isset( $this->Functions[$functionName] ) )
1656 {
1657 eZDebug::writeError( "Undefined view: " . $this->Module["name"] . "::$functionName ",
1658 "eZModule" );
1659 $this->setExitStatus( self::STATUS_FAILED );
1660 $Return = null;
1661 return $Return;
1662 }
1663 if ( $this->singleFunction() )
1664 $function = $this->Module["function"];
1665 else
1666 $function = $this->Functions[$functionName];
1667
1668 $params = array();
1669 $i = 0;
1670 $parameterValues = array();
1671 if ( isset( $function["params"] ) )
1672 {
1673 $functionParameterDefinitions = $function["params"];
1674 foreach ( $functionParameterDefinitions as $param )
1675 {
1676 if ( isset( $parameters[$i] ) )
1677 {
1678 $params[$param] = $parameters[$i];
1679 $parameterValues[] = $parameters[$i];
1680 }
1681 else
1682 {
1683 $params[$param] = null;
1684 $parameterValues[] = null;
1685 }
1686 ++$i;
1687 }
1688 }
1689
1690 $this->ViewParameters = $parameters;
1691 $this->OriginalParameters = $parameters;
1692 $this->OriginalViewParameters = $parameterValues;
1693 $this->NamedParameters = $params;
1694
1695 $GLOBALS['eZRequestedModuleParams'] = array( 'module_name' => $this->Name,
1696 'function_name' => $functionName,
1697 'parameters' => $params );
1698
1699 $this->UserParameters = $userParameters;
1700
1701 if ( isset( $function['ui_context'] ) )
1702 {
1703 $this->UIContext = $function['ui_context'];
1704 }
1705 if ( isset( $function['ui_component'] ) )
1706 {
1707 $this->UIComponent = $function['ui_component'];
1708 }
1709 else if ( $this->UIComponentMatch == 'view' )
1710 {
1711 $this->UIComponent = $functionName;
1712 }
1713
1714 if ( array_key_exists( 'Limitation', $parameters ) )
1715 {
1716 $params['Limitation'] =& $parameters[ 'Limitation' ];
1717 }
1718
1719 // check for unordered parameters and initialize variables if they exist
1720 $unorderedParametersList = array();
1721 $unorderedParameters = array();
1722 if ( isset( $function["unordered_params"] ) )
1723 {
1724 $unorderedParams = $function["unordered_params"];
1725
1726 foreach ( $unorderedParams as $urlParamName => $variableParamName )
1727 {
1728 if ( in_array( $urlParamName, $parameters ) )
1729 {
1730 $pos = array_search( $urlParamName, $parameters );
1731
1732 $params[$variableParamName] = $parameters[$pos + 1];
1733 $unorderedParameters[$variableParamName] = $parameters[$pos + 1];
1734 $unorderedParametersList[$variableParamName] = $parameters[$pos + 1];
1735 }
1736 else
1737 {
1738 $params[$variableParamName] = false;
1739 $unorderedParameters[$variableParamName] = false;
1740 }
1741 }
1742 }
1743
1744 // Loop through user defines parameters
1745 if ( $userParameters !== false )
1746 {
1747 if ( !isset( $params['UserParameters'] ) or
1748 !is_array( $params['UserParameters'] ) )
1749 {
1750 $params['UserParameters'] = array();
1751 }
1752
1753 if ( is_array( $userParameters ) && count( $userParameters ) > 0 )
1754 {
1755 foreach ( array_keys( $userParameters ) as $paramKey )
1756 {
1757 if( isset( $function['unordered_params'] ) &&
1758 $unorderedParams != null )
1759 {
1760 if ( array_key_exists( $paramKey, $unorderedParams ) )
1761 {
1762 $params[$unorderedParams[$paramKey]] = $userParameters[$paramKey];
1763 $unorderedParametersList[$unorderedParams[$paramKey]] = $userParameters[$paramKey];
1764 }
1765 }
1766
1767 $params['UserParameters'][$paramKey] = $userParameters[$paramKey];
1768 }
1769 }
1770 }
1771
1772 $this->OriginalUnorderedParameters = $unorderedParametersList;
1773
1774 if ( is_array( $overrideParameters ) )
1775 {
1776 foreach ( $overrideParameters as $param => $value )
1777 {
1778 $params[$param] = $value;
1779 }
1780 }
1781 $params["Module"] = $this;
1782 $params["ModuleName"] = $this->Name;
1783 $params["FunctionName"] = $functionName;
1784 $params["Parameters"] = $parameters;
1785 $params_as_var = isset( $this->Module["variable_params"] ) ? $this->Module["variable_params"] : false;
1786 $this->ExitStatus = self::STATUS_OK;
1787 // eZDebug::writeNotice( $params, 'module parameters1' );
1788
1789 $currentView =& $GLOBALS['eZModuleCurrentView'];
1790 $viewStack =& $GLOBALS['eZModuleViewStack'];
1791 if ( !isset( $currentView ) )
1792 $currentView = false;
1793 if ( !isset( $viewStack ) )
1794 $viewStack = array();
1795 if ( is_array( $currentView ) )
1796 $viewStack[] = $currentView;
1797 $currentView = array( 'view' => $functionName,
1798 'module' => $this->Name );
1799 $Return = eZProcess::run( $this->Path . "/" . $this->Name . "/" . $function["script"],
1800 $params,
1801 $params_as_var );
1802
1803 if ( $this->hasViewResult( $functionName ) )
1804 {
1805 $Return = $this->viewResult( $functionName );
1806 }
1807
1808 if ( count( $viewStack ) > 0 )
1809 $currentView = array_pop( $viewStack );
1810 else
1811 $currentView = false;
1812
1813 // Check if the module has set the navigation part, if not default to module setting
1814 if ( !is_string( $Return ) && !isset( $Return['navigation_part'] ) )
1815 {
1816 $Return['is_default_navigation_part'] = true;
1817 if ( isset( $function['default_navigation_part'] ) )
1818 $Return['navigation_part'] = $function['default_navigation_part'];
1819
1820 }
1821 elseif( !is_string( $Return ) )
1822 {
1823 $Return['is_default_navigation_part'] = false;
1824 }
1825
1826 // Check if we have overrides for navigation part
1827 $viewName = $this->Name . '/' . $functionName;
1828 if ( isset( $this->NavigationParts[$viewName] ) )
1829 {
1830 $Return['is_default_navigation_part'] = false;
1831 $Return['navigation_part'] = $this->NavigationParts[$viewName];
1832 }
1833 else if ( isset( $this->NavigationParts[$this->Name] ) )
1834 {
1835 $Return['is_default_navigation_part'] = false;
1836 $Return['navigation_part'] = $this->NavigationParts[$this->Name];
1837 }
1838
1839 return $Return;
1840 }
1841
1851 function currentView()
1852 {
1853 $currentView = $GLOBALS['eZModuleCurrentView'];
1854 if ( $currentView !== false )
1855 return $currentView['view'];
1856 return false;
1857 }
1858
1866 function currentModule()
1867 {
1868 $currentView = $GLOBALS['eZModuleCurrentView'];
1869 if ( $currentView !== false )
1870 return $currentView['module'];
1871 return false;
1872 }
1873
1881 static function globalPathList()
1882 {
1883 if ( !isset( $GLOBALS['eZModuleGlobalPathList'] ) )
1884 return null;
1885 return $GLOBALS['eZModuleGlobalPathList'];
1886 }
1887
1897 static function activeModuleRepositories( $useExtensions = true )
1898 {
1899 $moduleINI = eZINI::instance( 'module.ini' );
1900 $moduleRepositories = $moduleINI->variable( 'ModuleSettings', 'ModuleRepositories' );
1901
1902 if ( $useExtensions )
1903 {
1904 $extensionRepositories = $moduleINI->variable( 'ModuleSettings', 'ExtensionRepositories' );
1905 $extensionDirectory = eZExtension::baseDirectory();
1906 $activeExtensions = eZExtension::activeExtensions();
1907 $globalExtensionRepositories = array();
1908
1909 foreach ( $extensionRepositories as $extensionRepository )
1910 {
1911 $extPath = $extensionDirectory . '/' . $extensionRepository;
1912 $modulePath = $extPath . '/modules';
1913 if ( !in_array( $extensionRepository, $activeExtensions ) )
1914 {
1915 eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but has not yet been activated.\n" .
1916 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions\n" .
1917 "or make sure it is activated in the setting ExtensionSettings/ActiveExtensions in site.ini." );
1918 }
1919 else if ( file_exists( $modulePath ) )
1920 {
1921 $globalExtensionRepositories[] = $modulePath;
1922 }
1923 else if ( !file_exists( $extPath ) )
1924 {
1925 eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but the extension itself does not exist.\n" .
1926 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions.\n" .
1927 "You should probably remove this extension from the list." );
1928 }
1929 else
1930 {
1931 eZDebug::writeWarning( "Extension '$extensionRepository' does not have the subdirectory 'modules' allthough it reported it had modules.\n" .
1932 "Looked for directory '" . $modulePath . "'\n" .
1933 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extension." );
1934 }
1935 }
1936
1937 $moduleRepositories = array_merge( $moduleRepositories, $globalExtensionRepositories );
1938 $moduleRepositories = array_reverse( $moduleRepositories );
1939 }
1940
1941 return $moduleRepositories;
1942 }
1943
1951 static function setGlobalPathList( $pathList )
1952 {
1953 if ( !is_array( $pathList ) )
1954 $pathList = array( $pathList );
1955 $GLOBALS['eZModuleGlobalPathList'] = $pathList;
1956 }
1957
1965 static function addGlobalPathList( $pathList )
1966 {
1967 if ( !is_array( $GLOBALS['eZModuleGlobalPathList'] ) )
1968 {
1969 $GLOBALS['eZModuleGlobalPathList'] = array();
1970 }
1971 if ( !is_array( $pathList ) )
1972 {
1973 $pathList = array( $pathList );
1974 }
1975 $GLOBALS['eZModuleGlobalPathList'] = array_merge( $GLOBALS['eZModuleGlobalPathList'], $pathList );
1976 }
1977
1990 static function exists( $moduleName, $pathList = null, $showError = false )
1991 {
1992 $module = null;
1993 return self::findModule( $moduleName, $module, $pathList, $showError );
1994 }
1995
2011 static function findModule( $moduleName, $module = null, $pathList = null, $showError = false )
2012 {
2013 if ( $pathList === null )
2014 $pathList = array();
2015 else if ( !is_array( $pathList ) )
2016 $pathList = array( $pathList );
2017 $searchPathList = self::globalPathList();
2018 if ( $searchPathList === null )
2019 $searchPathList = array();
2020 $searchPathList = array_merge( $searchPathList, $pathList );
2021 $triedList = array();
2022 $triedDirList = array();
2023 $foundADir = false;
2024 foreach ( $searchPathList as $path )
2025 {
2026 $dir = "$path/$moduleName";
2027 $file = "$dir/module.php";
2028 if ( file_exists( $file ) )
2029 {
2030 if ( $module === null )
2031 $module = new self( $path, $file, $moduleName, false );
2032 else
2033 $module->initialize( $path, $file, $moduleName, false );
2034 return $module;
2035 }
2036 else if ( !file_exists( $dir ) )
2037 {
2038 $triedDirList[] = $dir;
2039 }
2040 else
2041 {
2042 $foundADir = true;
2043 $triedList[] = $dir;
2044 }
2045 }
2046
2047 $msg = "Could not find module named '$moduleName'";
2048 if ( $foundADir )
2049 {
2050 $msg = "\nThese directories had a directory named '$moduleName' but did not contain the module.php file:\n" .
2051 implode( ", ", $triedList ) . "\n" .
2052 "This usually means it is missing or has a wrong name.";
2053 if ( count( $triedDirList ) > 0 )
2054 $msg .= "\n\nThese directories were tried too but none of them exists:\n" . implode( ', ', $triedDirList );
2055 }
2056 else
2057 {
2058 if ( count( $triedDirList ) > 0 )
2059 $msg.= "\nThese directories were tried but none of them exists:\n" . implode( ", ", $triedDirList );
2060 }
2061 if ( $showError )
2062 eZDebug::writeWarning( $msg );
2063
2064 return null;
2065 }
2066
2071 function getNamedParameters()
2072 {
2073 return $this->NamedParameters;
2074 }
2075
2087 public static function accessAllowed( eZURI $uri )
2088 {
2089 $moduleName = $uri->element();
2090 $viewName = $uri->element( 1 );
2091 $check = array( 'result' => true,
2092 'module' => $moduleName,
2093 'view' => $viewName,
2094 'view_checked' => false );
2095
2096 $ini = eZINI::instance();
2097
2098 $access = true;
2099 $currentAccess = true;
2100 if ( !$ini->hasGroup( 'SiteAccessRules' ) )
2101 return $check;
2102 $items = $ini->variableArray( 'SiteAccessRules', 'Rules' );
2103 foreach( $items as $item )
2104 {
2105 $name = strtolower( $item[0] );
2106 if ( isset ( $item[1] ) )
2107 $value = $item[1];
2108 else
2109 $value = null;
2110 switch( $name )
2111 {
2112 case 'access':
2113 {
2114 $currentAccess = ( $value == 'enable' );
2115 } break;
2116 case 'moduleall':
2117 {
2118 $access = $currentAccess;
2119 } break;
2120 case 'module':
2121 {
2122 if ( preg_match( "#([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)#", $value, $matches ) )
2123 {
2124 if ( $matches[1] == $moduleName and
2125 $matches[2] == $viewName )
2126 {
2127 $check['view_checked'] = true;
2128 $access = $currentAccess;
2129 }
2130 }
2131 else
2132 {
2133 if ( $value == $moduleName )
2134 {
2135 $access = $currentAccess;
2136 $check['view_checked'] = false;
2137 }
2138 }
2139 } break;
2140 default:
2141 {
2142 eZDebug::writeError( "Unknown access rule: $name=$value", 'Access' );
2143 } break;
2144 }
2145 }
2146
2147 $check['result'] = $access;
2148 return $check;
2149 }
2150 }
2151
2152 ?>
eZDB\checkTransactionCounter
static checkTransactionCounter()
Definition: ezdb.php:293
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\writeWarning
static writeWarning( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:502
eZError\KERNEL_ACCESS_DENIED
const KERNEL_ACCESS_DENIED
Definition: ezerror.php:21
eZError\KERNEL_MODULE_NOT_FOUND
const KERNEL_MODULE_NOT_FOUND
Definition: ezerror.php:42
eZError\KERNEL_MODULE_DISABLED
const KERNEL_MODULE_DISABLED
Definition: ezerror.php:50
eZError\KERNEL_LANGUAGE_NOT_FOUND
const KERNEL_LANGUAGE_NOT_FOUND
Definition: ezerror.php:37
eZError\KERNEL_NOT_AVAILABLE
const KERNEL_NOT_AVAILABLE
Definition: ezerror.php:29
eZError\KERNEL_NOT_FOUND
const KERNEL_NOT_FOUND
Definition: ezerror.php:25
eZError\KERNEL_MODULE_VIEW_NOT_FOUND
const KERNEL_MODULE_VIEW_NOT_FOUND
Definition: ezerror.php:46
eZExecution\cleanExit
static cleanExit()
Definition: ezexecution.php:100
eZExtension\activeExtensions
static activeExtensions( $extensionType=false, eZINI|null $siteINI=null)
Definition: ezextension.php:60
eZExtension\baseDirectory
static baseDirectory(eZINI|null $siteINI=null)
Definition: ezextension.php:39
eZHTTPTool\instance
static instance()
Definition: ezhttptool.php:189
eZModule
Definition: ezmodule.php:36
eZModule\run
run( $functionName, $parameters=array(), $overrideParameters=false, $userParameters=false)
Definition: ezmodule.php:1652
eZModule\$RedirectStatus
$RedirectStatus
Definition: ezmodule.php:147
eZModule\STATUS_REDIRECT
const STATUS_REDIRECT
Definition: ezmodule.php:60
eZModule\redirectURI
redirectURI()
Definition: ezmodule.php:1024
eZModule\$Name
$Name
Definition: ezmodule.php:110
eZModule\runHooks
runHooks( $hookName, $parameters=null)
Definition: ezmodule.php:1444
eZModule\viewData
viewData( $viewName='')
Definition: ezmodule.php:935
eZModule\STATUS_FAILED
const STATUS_FAILED
Definition: ezmodule.php:54
eZModule\setTitle
setTitle( $title)
Definition: ezmodule.php:404
eZModule\title
title()
Definition: ezmodule.php:392
eZModule\uiContextName
uiContextName()
Definition: ezmodule.php:457
eZModule\redirect
redirect( $moduleName, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
Definition: ezmodule.php:668
eZModule\__construct
__construct( $path, $file, $moduleName, $checkFileExistence=true)
Definition: ezmodule.php:261
eZModule\$ViewParameters
$ViewParameters
Definition: ezmodule.php:183
eZModule\redirectionURIForModule
redirectionURIForModule( $module, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
Definition: ezmodule.php:814
eZModule\functionURI
functionURI( $function)
Definition: ezmodule.php:373
eZModule\errorCode
errorCode()
Definition: ezmodule.php:536
eZModule\$UIComponentMatch
$UIComponentMatch
Definition: ezmodule.php:242
eZModule\isCurrentAction
isCurrentAction( $actionName, $view='')
Definition: ezmodule.php:1373
eZModule\exists
static exists( $moduleName, $pathList=null, $showError=false)
Definition: ezmodule.php:1990
eZModule\redirectToView
redirectToView( $viewName='', $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
Definition: ezmodule.php:698
eZModule\exitStatus
exitStatus()
Definition: ezmodule.php:509
eZModule\hasActionParameter
hasActionParameter( $parameterName, $view='')
Definition: ezmodule.php:1324
eZModule\setRedirectURI
setRedirectURI( $uri)
Definition: ezmodule.php:1036
eZModule\accessAllowed
static accessAllowed(eZURI $uri)
Definition: ezmodule.php:2087
eZModule\$UIContext
$UIContext
Definition: ezmodule.php:226
eZModule\attributes
attributes()
Definition: ezmodule.php:1070
eZModule\$ViewActions
$ViewActions
Definition: ezmodule.php:169
eZModule\$useExceptions
static $useExceptions
Definition: ezmodule.php:244
eZModule\addGlobalPathList
static addGlobalPathList( $pathList)
Definition: ezmodule.php:1965
eZModule\$Title
$Title
Definition: ezmodule.php:154
eZModule\HOOK_STATUS_CANCEL_RUN
const HOOK_STATUS_CANCEL_RUN
Definition: ezmodule.php:78
eZModule\activeModuleRepositories
static activeModuleRepositories( $useExtensions=true)
Definition: ezmodule.php:1897
eZModule\setRedirectStatus
setRedirectStatus( $status)
Definition: ezmodule.php:1060
eZModule\STATUS_IDLE
const STATUS_IDLE
Definition: ezmodule.php:42
eZModule\$ErrorCode
$ErrorCode
Definition: ezmodule.php:133
eZModule\$OriginalParameters
$OriginalParameters
Definition: ezmodule.php:190
eZModule\attribute
attribute( $attr)
Definition: ezmodule.php:1102
eZModule\setCurrentName
setCurrentName( $name)
Definition: ezmodule.php:419
eZModule\singleFunction
singleFunction()
Definition: ezmodule.php:446
eZModule\unorderedParameters
unorderedParameters( $viewName='')
Definition: ezmodule.php:914
eZModule\$Path
$Path
Definition: ezmodule.php:117
eZModule\initialize
initialize( $path, $file, $moduleName, $checkFileExistence=true)
Definition: ezmodule.php:280
eZModule\hasViewResult
hasViewResult( $view='')
Definition: ezmodule.php:1561
eZModule\hasAttribute
hasAttribute( $attr)
Definition: ezmodule.php:1089
eZModule\$NavigationParts
$NavigationParts
Definition: ezmodule.php:246
eZModule\setExitStatus
setExitStatus( $stat)
Definition: ezmodule.php:523
eZModule\redirectCurrent
redirectCurrent()
Definition: ezmodule.php:793
eZModule\setCurrentAction
setCurrentAction( $actionName, $view='')
Definition: ezmodule.php:1142
eZModule\$NamedParameters
$NamedParameters
Definition: ezmodule.php:204
eZModule\findModule
static findModule( $moduleName, $module=null, $pathList=null, $showError=false)
Definition: ezmodule.php:2011
eZModule\$UIComponent
$UIComponent
Definition: ezmodule.php:234
eZModule\errorModule
errorModule()
Definition: ezmodule.php:560
eZModule\setViewResult
setViewResult( $result, $view='')
Definition: ezmodule.php:1548
eZModule\setActionParameter
setActionParameter( $parameterName, $parameterValue, $view='')
Definition: ezmodule.php:1255
eZModule\getNamedParameters
getNamedParameters()
Definition: ezmodule.php:2071
eZModule\forward
forward( $module, $functionName, $parameters=false)
Definition: ezmodule.php:1598
eZModule\$ExitStatus
$ExitStatus
Definition: ezmodule.php:126
eZModule\setCurrentView
setCurrentView( $name)
Definition: ezmodule.php:437
eZModule\$Functions
$Functions
Definition: ezmodule.php:92
eZModule\setUIContextName
setUIContextName( $context)
Definition: ezmodule.php:483
eZModule\currentView
currentView()
Definition: ezmodule.php:1851
eZModule\addHook
addHook( $hookName, $function, $priority=1, $expandParameters=true, $append=false)
Definition: ezmodule.php:1405
eZModule\STATUS_OK
const STATUS_OK
Definition: ezmodule.php:48
eZModule\$Module
$Module
Definition: ezmodule.php:104
eZModule\setErrorCode
setErrorCode( $errorCode)
Definition: ezmodule.php:548
eZModule\$HookList
$HookList
Definition: ezmodule.php:161
eZModule\$ViewActionParameters
$ViewActionParameters
Definition: ezmodule.php:37
eZModule\redirectTo
redirectTo( $uri)
Definition: ezmodule.php:955
eZModule\$ViewResult
$ViewResult
Definition: ezmodule.php:176
eZModule\parameters
parameters( $viewName='')
Definition: ezmodule.php:891
eZModule\handleError
handleError( $errorCode, $errorType=false, $parameters=array(), $userParameters=false)
Definition: ezmodule.php:593
eZModule\viewResult
viewResult( $view='')
Definition: ezmodule.php:1576
eZModule\currentModule
currentModule()
Definition: ezmodule.php:1866
eZModule\$OriginalUnorderedParameters
$OriginalUnorderedParameters
Definition: ezmodule.php:211
eZModule\currentRedirectionURI
currentRedirectionURI()
Definition: ezmodule.php:770
eZModule\$UserParameters
$UserParameters
Definition: ezmodule.php:218
eZModule\redirectModule
redirectModule( $module, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
Definition: ezmodule.php:723
eZModule\$FunctionList
$FunctionList
Definition: ezmodule.php:245
eZModule\setGlobalPathList
static setGlobalPathList( $pathList)
Definition: ezmodule.php:1951
eZModule\uri
uri()
Definition: ezmodule.php:356
eZModule\currentAction
currentAction( $view='')
Definition: ezmodule.php:1175
eZModule\setErrorModule
setErrorModule( $moduleName, $viewName)
Definition: ezmodule.php:576
eZModule\HOOK_STATUS_FAILED
const HOOK_STATUS_FAILED
Definition: ezmodule.php:84
eZModule\$OriginalViewParameters
$OriginalViewParameters
Definition: ezmodule.php:197
eZModule\getAllowedRedirectHosts
getAllowedRedirectHosts()
Definition: ezmodule.php:992
eZModule\HOOK_STATUS_OK
const HOOK_STATUS_OK
Definition: ezmodule.php:72
eZModule\uiComponentName
uiComponentName()
Definition: ezmodule.php:469
eZModule\STATUS_RERUN
const STATUS_RERUN
Definition: ezmodule.php:66
eZModule\redirectStatus
redirectStatus()
Definition: ezmodule.php:1048
eZModule\actionParameter
actionParameter( $parameterName, $view='')
Definition: ezmodule.php:1272
eZModule\$RedirectURI
$RedirectURI
Definition: ezmodule.php:140
eZModule\setUIComponentName
setUIComponentName( $component)
Definition: ezmodule.php:497
eZModule\redirectionURI
redirectionURI( $moduleName, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
Definition: ezmodule.php:748
eZModule\globalPathList
static globalPathList()
Definition: ezmodule.php:1881
eZProcess\run
static run( $file, $Params=array(), $params_as_var=false)
Definition: ezprocess.php:19
eZSys\hostname
static hostname()
Definition: ezsys.php:676
eZURI
Definition: ezuri.php:28
eZURI\element
element( $index=0, $relative=true)
Definition: ezuri.php:328
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.