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() {
$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);

View File

@ -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'
];
/**
@ -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);