14 if (!defined(
'IN_PEEL')) {
51 if (empty($this->name_by_lang[
$_SESSION[
'session_langue']])) {
52 $this->name_by_lang[$_SESSION[
'session_langue']] =
vb($this->name_by_lang[
'en'],
vb($this->name_by_lang[
'fr'], $this->technical_code));
54 $this->name = $this->name_by_lang[$_SESSION[
'session_langue']];
55 if ($this->activation_variable === null) {
56 $this->activation_variable =
'module_'.$this->technical_code;
68 if(!empty($this->_errors)) {
69 foreach($this->_errors as $this_error) {
70 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $this_error))->fetch();
73 if(!empty($this->_messages)) {
74 foreach($this->_messages as $this_message) {
75 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => $this_message))->fetch();
102 if ($this::check_install()) {
103 $this->_errors[
'installed'] = $this->name .
' déjà installé';
108 $this->_errors[
'version'] = $this->name .
' - version incompatible';
111 if (!empty($this->dependencies) && count($this->dependencies) > 0) {
112 foreach ($this->dependencies as $this_dependency) {
113 if (!in_array($this_dependency,
$GLOBALS[
'modules_installed'])) {
114 $this->_errors[
'dependency'] = $this->name .
' - module required: ' . $this_dependency;
141 if (!in_array($this->technical_code,
$GLOBALS[
'modules_installed'])) {
173 return set_configuration_variable(array(
'technical_code' => $this->activation_variable,
'string' => 1,
'type' =>
'integer',
'site_id' => $site_id,
'origin' => $this->technical_code),
true);
184 return set_configuration_variable(array(
'technical_code' => $this->activation_variable,
'string' => 0,
'type' =>
'integer',
'site_id' => $site_id,
'origin' => $this->technical_code),
true);
195 if ((!empty($this->peel_versions_compatibility[
'min']) && version_compare(
PEEL_VERSION, $this->peel_versions_compatibility_infos[
'min'],
'<')) || (!empty($this->peel_versions_compatibility_infos[
'max']) && version_compare(
PEEL_VERSION, $this->peel_versions_compatibility_infos[
'max'],
'>'))) {
static check_install()
Vérifie l'installation du module.
disable($site_id=0)
Désactive le module.
check_compatibility()
Désactive le module.
__construct()
Constructor.
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']
const PEEL_VERSION(version_compare(PHP_VERSION, '5.1.2', '<'))
execute($mode=null)
Exécute une action.
enable($site_id=0)
Active le module.
set_configuration_variable($frm, $update_if_technical_code_exists=false, $allow_create=true)
Ajoute la zone HTML dans la table peel_configuration.
$peel_versions_compatibility_infos
get_messages()
Renvoie les erreurs formattées.
install()
Installe le module.
uninstall()
Désinstalle un module.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']