summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorSimon Rettberg2014-08-07 19:20:39 +0200
committerSimon Rettberg2014-08-07 19:20:39 +0200
commit5472fd01bdb5640f58579fc06b0777e4f52975d7 (patch)
tree325b21b71f7e74eb19404271f81c9f03cada13ee /index.php
parentMerge branch 'i18n' of https://gitlab.c3sl.ufpr.br/cdn/slx-admin into i18n (diff)
downloadslx-admin-5472fd01bdb5640f58579fc06b0777e4f52975d7.tar.gz
slx-admin-5472fd01bdb5640f58579fc06b0777e4f52975d7.tar.xz
slx-admin-5472fd01bdb5640f58579fc06b0777e4f52975d7.zip
Some sanity checks; start making detection of available languages dynamic; put dictionary class in inc/; make redirection on language change work if browser doesn't send referer information
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/index.php b/index.php
index 1a48ad6f..8efb21ed 100644
--- a/index.php
+++ b/index.php
@@ -2,10 +2,6 @@
require_once 'config.php';
-require_once 'lang/i18n.php';
-
-Dictionary::build();
-
require_once('inc/user.inc.php');
/**
@@ -119,10 +115,16 @@ Page::preprocess();
// Generate Main menu
//$menu = new Menu;
-if(User::getName() === false) Render::addTemplate('main-menu-login');
-else Render::addTemplate('main-menu-logout',array(
- 'user' => User::getName()
- ));
+if (User::getName() === false) {
+ Render::addTemplate('main-menu-login', array(
+ 'url' => urlencode($_SERVER['REQUEST_URI'])
+ ));
+} else {
+ Render::addTemplate('main-menu-logout', array(
+ 'url' => urlencode($_SERVER['REQUEST_URI']),
+ 'user' => User::getName()
+ ));
+}
Message::renderList();