From 95db8e184b378534db0ac08d14ae8500ee5090c3 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Thu, 28 Apr 2016 21:31:15 +0200
Subject: Implemented new menu, added logic for defining dependencies, move
translation files around
---
inc/render.inc.php | 56 +++++++-----------------------------------------------
1 file changed, 7 insertions(+), 49 deletions(-)
(limited to 'inc/render.inc.php')
diff --git a/inc/render.inc.php b/inc/render.inc.php
index 10d18514..14d5a810 100644
--- a/inc/render.inc.php
+++ b/inc/render.inc.php
@@ -41,22 +41,19 @@ class Render
if ($zip)
ob_start();
$page = strtolower($_GET['do']);
- if(User::isLoggedIn())
- self::createDashboard($page);
echo
'
-
',
- self::$dashboard
- ,
+ self::$dashboard,
+ '
+ '
@@ -259,46 +254,9 @@ class Render
/**
* Create the dashboard menu
*/
- private static function createDashboard($page)
+ public static function setDashboard($params)
{
- // Check all required modules
- $requiredModules = array('adduser','main','session','translation','usermanagement');
- $notFound = '';
- foreach ($requiredModules as $module) {
- if(!is_dir('modules/' . $module . '/')){
- $notFound .= '\'' . $module . '\' ';
- }
- }
- if(strlen($notFound) > 0){
- Util::traceError('At least one required module was not found: ' . $notFound);
- }else{
- $modules = array_diff(scandir('modules/'), array('..', '.'));
- $categories = array();
- foreach ($modules as $module) {
- $json = json_decode(file_get_contents("modules/" . $module . "/config.json"),true);
- $categories[$json['category']][] = $module;
- }
- unset($categories['hidden']);
- self::$dashboard = ' ';
- }
- }
-
- /**
- * get categories glyph icons
- */
- private static function getGlyphicon($category){
- return json_decode(file_get_contents("style/categories.json"),true)[$category];
+ self::$dashboard = self::parse('main-menu', $params, 'main');
}
}
--
cgit v1.2.3-55-g7522