diff --git a/bl-kernel/admin/themes/booty/index.php b/bl-kernel/admin/themes/booty/index.php index 388a7054..2a9bac54 100644 --- a/bl-kernel/admin/themes/booty/index.php +++ b/bl-kernel/admin/themes/booty/index.php @@ -80,6 +80,8 @@ adminView(); } else { echo '

'.$L->g('Page not found').'

'; echo '

'.$L->g('Choose a page from the sidebar.').'

'; diff --git a/bl-kernel/boot/admin.php b/bl-kernel/boot/admin.php index 4e67d145..cdb20f01 100644 --- a/bl-kernel/boot/admin.php +++ b/bl-kernel/boot/admin.php @@ -13,18 +13,24 @@ $layout = array( 'view'=>null, 'template'=>'index.php', 'slug'=>null, + 'plugin'=>false, 'parameters'=>null, 'title'=>'Bludit' ); -// Get the view, controller, and the parameters from the URL. +// Get the Controller $explodeSlug = $url->explodeSlug(); $layout['controller'] = $layout['view'] = $layout['slug'] = empty($explodeSlug[0])?'dashboard':$explodeSlug[0]; unset($explodeSlug[0]); -$layout['parameters'] = implode('/', $explodeSlug); -// Boot plugins rules +// Get the Plugin include(PATH_RULES.'60.plugins.php'); +if ($layout['controller'] === 'plugin' && !empty($explodeSlug)) { + $layout['plugin'] = getPlugin(array_shift($explodeSlug)); +} + +// Get the URL parameters +$layout['parameters'] = implode('/', $explodeSlug); // --- AJAX --- if ($layout['slug']==='ajax') { @@ -77,6 +83,8 @@ else // Load controller. if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) { include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php'); + } else if(!empty($layout['plugin']) && method_exists($layout['plugin'], 'adminController')) { + $layout['plugin']->adminController(); } // Load view and theme.