Ajout core/module/addon

This commit is contained in:
SylvainLelievre 2021-02-15 14:37:17 +01:00
parent 1d75d17e4d
commit bcd1f4910a
2 changed files with 8 additions and 6 deletions

View File

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

View File

@ -56,7 +56,8 @@ class common {
'sitemap', 'sitemap',
'theme', 'theme',
'user', 'user',
'translate' 'translate',
'addon'
]; ];
public static $accessList = [ public static $accessList = [
'user', 'user',
@ -177,7 +178,8 @@ class common {
'theme' => '', 'theme' => '',
'admin' => '', 'admin' => '',
'blacklist' => '', 'blacklist' => '',
'locale' => '' 'locale' => '',
'addon'
]; ];
/** /**
@ -603,7 +605,7 @@ class common {
$this->setData(['theme',$tempData['theme']]); $this->setData(['theme',$tempData['theme']]);
// Import des users sauvegardés si option active // Import des users sauvegardés si option active
if ($keepUsers === false if ($keepUsers === false
AND $tempData['user'] !== NULL) { AND $tempData['user'] !== NULL) {
$this->setData(['user',$tempData['user']]); $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() . '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() . '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() . '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>'; $rightItems .= '<li><a href="' . helper::baseUrl() . 'config" data-tippy-content="Configurer le site">' . template::ico('cog-alt') . '</a></li>';
// Mise à jour automatique // Mise à jour automatique
$today = mktime(0, 0, 0); $today = mktime(0, 0, 0);