Custom admin pages

This commit is contained in:
SamBrishes 2020-05-15 07:50:22 +02:00
parent a5dc0addea
commit 7ea717200c
2 changed files with 8 additions and 2 deletions

View File

@ -80,6 +80,8 @@
<?php
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
} else if (isset($plugin) && method_exists($plugin, "adminView")) {
echo $plugin->adminView();
} else {
echo '<h1 class="text-center">'.$L->g('Page not found').'</h1>';
echo '<h2 class="text-center">'.$L->g('Choose a page from the sidebar.').'</h2>';

View File

@ -63,8 +63,8 @@ else
}
// Define variables
$ADMIN_CONTROLLER = $layout['controller'];
$ADMIN_VIEW = $layout['view'];
$ADMIN_CONTROLLER = $layout['controller'];
$ADMIN_VIEW = $layout['view'];
// Load plugins before the admin area will be load.
Theme::plugins('beforeAdminLoad');
@ -77,6 +77,10 @@ else
// Load controller.
if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) {
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
} else if (($plugin = getPlugin($layout['controller'])) !== false) {
if (method_exists($plugin, "adminController") && method_exists($plugin, "adminView")) {
$plugin->adminController();
}
}
// Load view and theme.