2015-04-30 14:12:49 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* Sakura Management
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Declare Namespace
|
|
|
|
namespace Sakura;
|
2015-05-05 06:24:19 +00:00
|
|
|
|
2015-04-30 23:01:01 +00:00
|
|
|
// Define that we are in Management mode
|
|
|
|
define('SAKURA_MANAGE', true);
|
|
|
|
|
2015-04-30 14:12:49 +00:00
|
|
|
// Include components
|
2015-09-14 20:51:23 +00:00
|
|
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-08-18 13:13:40 +00:00
|
|
|
// Make sure user has the permissions to view this
|
2015-09-14 20:51:23 +00:00
|
|
|
if (!Permissions::check('MANAGE', 'USE_MANAGE', Session::$userId, 1)) {
|
2015-08-18 13:13:40 +00:00
|
|
|
header('Location: /');
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
// Management pages
|
2015-04-30 23:01:01 +00:00
|
|
|
$managePages = [
|
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'index' => [
|
|
|
|
'desc' => 'Index',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
],
|
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'reports' => [
|
|
|
|
'desc' => 'Reports',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'banning' => [
|
|
|
|
'desc' => 'Banning',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'warnings' => [
|
|
|
|
'desc' => 'Warnings',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-thing' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'thing',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'user-notes' => [
|
|
|
|
'desc' => 'User notes',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'action-logs' => [
|
|
|
|
'desc' => 'Action logs',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'action-logs' => [
|
|
|
|
'desc' => 'Action logs',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'statistics' => [
|
|
|
|
'desc' => 'Statistics',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'general-settings' => [
|
|
|
|
'desc' => 'General Settings',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'users' => [
|
|
|
|
'desc' => 'Users',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'ranks' => [
|
|
|
|
'desc' => 'Ranks',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'permissions' => [
|
|
|
|
'desc' => 'Permissions',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'info-pages' => [
|
|
|
|
'desc' => 'Info pages',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
2015-05-03 16:25:57 +00:00
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
2015-05-03 16:25:57 +00:00
|
|
|
'system' => [
|
|
|
|
'desc' => 'System',
|
2015-09-14 20:51:23 +00:00
|
|
|
'subs' => [
|
2015-05-03 16:25:57 +00:00
|
|
|
'front-page' => [
|
2015-09-14 20:51:23 +00:00
|
|
|
'desc' => 'Front Page',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
2015-04-30 23:01:01 +00:00
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
// Add page specific things
|
|
|
|
$renderData['page'] = [
|
|
|
|
|
|
|
|
'title' => 'Manage Index',
|
|
|
|
'pages' => $managePages,
|
2015-05-03 16:25:57 +00:00
|
|
|
'activepage' => $_MANAGE_ACTIVE_PAGE = (
|
|
|
|
isset($_GET['page']) ?
|
|
|
|
(
|
|
|
|
array_key_exists($_GET['page'], $managePages) ?
|
|
|
|
$_GET['page'] :
|
|
|
|
key($managePages)
|
|
|
|
) :
|
|
|
|
key($managePages)
|
|
|
|
),
|
|
|
|
'subs' => $_MANAGE_SUBS = $managePages[$_MANAGE_ACTIVE_PAGE]['subs'],
|
|
|
|
'activesub' => $_MANAGE_ACTIVE_SUB = (
|
|
|
|
isset($_GET['sub']) ?
|
|
|
|
(
|
|
|
|
array_key_exists($_GET['sub'], $_MANAGE_SUBS) ?
|
|
|
|
$_GET['sub'] :
|
|
|
|
key($_MANAGE_SUBS)
|
|
|
|
) :
|
|
|
|
key($_MANAGE_SUBS)
|
2015-09-14 20:51:23 +00:00
|
|
|
),
|
2015-04-30 23:01:01 +00:00
|
|
|
|
|
|
|
];
|
2015-04-30 14:12:49 +00:00
|
|
|
|
|
|
|
// Print page contents
|
2015-09-14 20:51:23 +00:00
|
|
|
print Templates::render('pages/' . $_MANAGE_ACTIVE_PAGE . '/' . $_MANAGE_ACTIVE_SUB . '.tpl', $renderData);
|