15 if (!defined(
'IN_PEEL')) {
27 $modules_to_check = array_keys(array_merge_recursive(
vb(
$GLOBALS[
'site_parameters'][
'modules_front_office_functions_files_array'], array()),
vb(
$GLOBALS[
'site_parameters'][
'modules_admin_functions_array'], array()),
vb(
$GLOBALS[
'site_parameters'][
'modules_crons_functions_array'], array()),
vb(
$GLOBALS[
'site_parameters'][
'modules_lang_folders_array'], array())));
28 foreach($modules_to_check as $this_module) {
29 if((empty($technical_code) || $technical_code == $this_module) && empty(
$GLOBALS[
'modules_installed'][$this_module])) {
31 if(!empty(
$GLOBALS[
'site_parameters'][
'modules_front_office_functions_files_array'][$this_module])) {
32 $GLOBALS[
vb(
$GLOBALS[
'site_parameters'][
'modules_fonctions_variable_array'][$this_module],
'fonctions'. $this_module)] =
$GLOBALS[
'dirroot'] . str_replace(
',',
',' .
$GLOBALS[
'dirroot'],
$GLOBALS[
'site_parameters'][
'modules_front_office_functions_files_array'][$this_module]);
34 if ((in_array($this_module,
$GLOBALS[
'site_parameters'][
'modules_no_optional_array']) || !defined(
'LOAD_NO_OPTIONAL_MODULE') || (defined(
'LOAD_MODULE_FORCED') && in_array($this_module, LOAD_MODULE_FORCED))) &&
check_if_module_active($this_module)) {
37 if((empty(
$GLOBALS[
'site_parameters'][
'modules_no_library_load_array']) || !in_array($this_module,
$GLOBALS[
'site_parameters'][
'modules_no_library_load_array']))) {
38 if(!empty(
$GLOBALS[
'site_parameters'][
'modules_front_office_functions_files_array'][$this_module])) {
39 foreach(explode(
',',
$GLOBALS[
'site_parameters'][
'modules_front_office_functions_files_array'][$this_module]) as $this_file) {
40 if(
String::strpos($this_file,
'.php') !==
false && !in_array($this_file,
vb(
$GLOBALS[
'modules_loaded_functions'], array()))) {
41 if(
String::strpos($this_file,
'administrer/') ===
false || (defined(
'IN_PEEL_ADMIN') || defined(
'IN_CRON'))) {
42 include(
$GLOBALS[
'dirroot'] . $this_file);
44 $GLOBALS[
'modules_loaded_functions'][] = $this_file;
45 $GLOBALS[
'modules_loaded_functions'][] = $this_file;
49 if((defined(
'IN_PEEL_ADMIN') || defined(
'IN_CRON')) && !empty(
$GLOBALS[
'site_parameters'][
'modules_admin_functions_array'][$this_module]) && !in_array(
$GLOBALS[
'site_parameters'][
'modules_admin_functions_array'][$this_module],
vb(
$GLOBALS[
'modules_loaded_functions'], array()))) {
50 $GLOBALS[
'fonctions_admin_'. $this_module] =
$GLOBALS[
'dirroot'] .
$GLOBALS[
'site_parameters'][
'modules_admin_functions_array'][$this_module];
51 include(
$GLOBALS[
'fonctions_admin_'. $this_module]);
52 $GLOBALS[
'modules_loaded_functions'][] =
$GLOBALS[
'site_parameters'][
'modules_admin_functions_array'][$this_module];
54 if(defined(
'IN_CRON') && !empty(
$GLOBALS[
'site_parameters'][
'modules_crons_functions_array'][$this_module]) && !in_array(
$GLOBALS[
'site_parameters'][
'modules_crons_functions_array'][$this_module],
vb(
$GLOBALS[
'modules_loaded_functions'], array()))) {
55 $GLOBALS[
'fonctions_cron_'. $this_module] =
$GLOBALS[
'dirroot'] .
$GLOBALS[
'site_parameters'][
'modules_crons_functions_array'][$this_module];
56 include(
$GLOBALS[
'fonctions_cron_'. $this_module]);
57 $GLOBALS[
'modules_loaded_functions'][] =
$GLOBALS[
'site_parameters'][
'modules_crons_functions_array'][$this_module];
60 if(!empty(
$GLOBALS[
'site_parameters'][
'modules_lang_folders_array'][$this_module])) {
61 $GLOBALS[
'modules_lang_folders_to_load_array'][] =
$GLOBALS[
'site_parameters'][
'modules_lang_folders_array'][$this_module];
63 $GLOBALS[
'modules_installed'][$this_module] = $this_module;
67 if(empty($technical_code)) {
69 if (!empty(
$GLOBALS[
'site_parameters'][
'load_site_specific_lang_folders'])) {
70 foreach(
$GLOBALS[
'site_parameters'][
'load_site_specific_lang_folders'] as $this_key => $this_file_relative_path) {
71 if(!in_array($this_file_relative_path,
vb(
$GLOBALS[
'modules_lang_folders_to_load_array'], array()))) {
72 if(file_exists(
$GLOBALS[
'dirroot'] . $this_file_relative_path)) {
74 $GLOBALS[
'modules_lang_folders_to_load_array'][1000 + $this_key] = $this_file_relative_path;
91 $automatically_activate_if_no_configuration_available = array(
'thumbs');
92 if (empty($module_name) || !isset(
$GLOBALS[
'site_parameters'][
'modules_configuration_variable_array'])) {
96 $module_configuration_variable =
vb(
$GLOBALS[
'site_parameters'][
'modules_configuration_variable_array'][$module_name],
'module_' . $module_name);
97 $module_configured = ((in_array($module_name, $automatically_activate_if_no_configuration_available) && !isset(
$GLOBALS[
'site_parameters'][$module_configuration_variable])) || !empty(
$GLOBALS[
'site_parameters'][$module_configuration_variable]));
98 $module_enable_for_this_lang = (empty(
$GLOBALS[
'site_parameters'][$module_name .
'_allowed_langs_array']) || in_array(
$_SESSION[
'session_langue'],
$GLOBALS[
'site_parameters'][$module_name .
'_allowed_langs_array']));
99 if ($module_configured && $module_enable_for_this_lang) {
101 if (empty($specific_file_name)) {
103 if (file_exists(
$GLOBALS[
'dirroot'] .
'/modules/'.$module_name)) {
107 }
elseif (file_exists(
$GLOBALS[
'dirroot'] .
'/modules/' . $module_name .
'/' . $specific_file_name)) {
124 if(
$mode ==
'boolean') {
131 if (defined(
'PEEL_DEBUG') && PEEL_DEBUG) {
134 foreach(
vb(
$GLOBALS[
'modules_installed'], array()) as $this_module) {
136 $function_name = $this_module .
'_hook_' . $hook;
138 $method_name =
'hook_' . $hook;
140 if(function_exists($function_name)) {
141 $result = $function_name($params);
142 }
elseif(method_exists($class_name, $method_name)) {
143 $result = $class_name::$method_name($params);
146 if(
$mode ==
'boolean') {
170 if (defined(
'PEEL_DEBUG') && PEEL_DEBUG) {
172 $GLOBALS[
'peel_debug'][] = array(
'text' =>
'Hook ' . $hook,
'duration' => $end_time - $start_time,
'start' => $start_time -
$GLOBALS[
'script_start_time']);
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
if(!defined('IN_PEEL')) load_modules($technical_code=null)
Charge les modules Pour obtenir des modules optionnels : Contactez PEEL sur https://www.peel.fr/ ou au 01 75 43 67 97.
microtime_float()
microtime_float()
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
$GLOBALS['page_columns_count']
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
static ucfirst($string)
Returns string with first letter uppercase.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']