Browse Source

Ajout core/module/addon

10504
SylvainLelievre 4 months ago
parent
commit
bcd1f4910a
  1. 4
      core/class/helper.class.php
  2. 10
      core/core.php

4
core/class/helper.class.php

@ -137,10 +137,10 @@ class helper {
*/
public static function getModules() {
$modules = array();
$dirs = array_diff(scandir($folder), array('..', '.'));
$dirs = array_diff(scandir('module'), array('..', '.'));
foreach ($dirs as $key => $value) {
// Dossier non vide
if (file_exists($folder . '/' . $value . '/' . $value . '.php')) {
if (file_exists('module/' . $value . '/' . $value . '.php')) {
// Lire les constantes en gérant les erreurs de nom de classe
try {
$class_reflex = new \ReflectionClass($value);

10
core/core.php

@ -56,7 +56,8 @@ class common {
'sitemap',
'theme',
'user',
'translate'
'translate',
'addon'
];
public static $accessList = [
'user',
@ -177,7 +178,8 @@ class common {
'theme' => '',
'admin' => '',
'blacklist' => '',
'locale' => ''
'locale' => '',
'addon'
];
/**
@ -603,7 +605,7 @@ class common {
$this->setData(['theme',$tempData['theme']]);
// Import des users sauvegardés si option active
if ($keepUsers === false
if ($keepUsers === false
AND $tempData['user'] !== NULL) {
$this->setData(['user',$tempData['user']]);
}
@ -2901,7 +2903,7 @@ class layout extends common {
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user" data-tippy-content="Configurer les utilisateurs">' . template::ico('users') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>';
//$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'modules" data-tippy-content="Gérer les modules">' . template::ico('puzzle') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'addon" data-tippy-content="Gérer les modules">' . template::ico('puzzle') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
// Mise à jour automatique
$today = mktime(0, 0, 0);

Loading…
Cancel
Save