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 <?php
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) { if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
include(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 { } else {
echo '<h1 class="text-center">'.$L->g('Page not found').'</h1>'; 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>'; echo '<h2 class="text-center">'.$L->g('Choose a page from the sidebar.').'</h2>';

View File

@ -77,6 +77,10 @@ else
// Load controller. // Load controller.
if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) { if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) {
include(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. // Load view and theme.