From 5472fd01bdb5640f58579fc06b0777e4f52975d7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Aug 2014 19:20:39 +0200 Subject: 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 --- index.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'index.php') 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(); -- cgit v1.2.3-55-g7522