Custom admin pages
This commit is contained in:
parent
a5dc0addea
commit
7ea717200c
2 changed files with 8 additions and 2 deletions
|
@ -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>';
|
||||||
|
|
|
@ -63,8 +63,8 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define variables
|
// Define variables
|
||||||
$ADMIN_CONTROLLER = $layout['controller'];
|
$ADMIN_CONTROLLER = $layout['controller'];
|
||||||
$ADMIN_VIEW = $layout['view'];
|
$ADMIN_VIEW = $layout['view'];
|
||||||
|
|
||||||
// Load plugins before the admin area will be load.
|
// Load plugins before the admin area will be load.
|
||||||
Theme::plugins('beforeAdminLoad');
|
Theme::plugins('beforeAdminLoad');
|
||||||
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue