From 2daca99c514c7df3664b87c9d474c3bc44522d90 Mon Sep 17 00:00:00 2001
From: root <root@welcometucode.htu.tuwien.ac.at>
Date: Thu, 16 Jul 2015 01:53:23 +0200
Subject: [PATCH] devmode.

---
 html_funcs.php       |  7 +++++--
 person.php           |  3 ++-
 settings.php.example | 12 +++++++++---
 style.css            |  5 +++++
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/html_funcs.php b/html_funcs.php
index 188d6ec..a374bf8 100644
--- a/html_funcs.php
+++ b/html_funcs.php
@@ -6,6 +6,8 @@
 */
 
 function html_top($title = ""){
+  if($GLOBALS['devmode'] == 1)$title .= ' [DEVMODE]';
+
 	return <<<EOF
 <!DOCTYPE html>
 <html lang="de" dir="ltr">
@@ -34,7 +36,7 @@ function html_linkbox($current = "") {
 	$items = array(
 		'index' => "Home",
 		'list' => "Anmeldungen",
-		'calendar' => "Kalender",
+		'intern/upload' => "Dateiupload",
 		'stats' => "Stats"
 	);
 	$out = '<div id="menu" class="align-center"><h1>Anmeldesystem welcomeTUcode</h1><ul class="menulist">';
@@ -42,6 +44,7 @@ function html_linkbox($current = "") {
 		$activeitem = ($current === $file) ? ' menuactive' : '';
 		$out .= '<li class="menuitem'.$activeitem.'"><a href="./'.$file.'.php">'.$name.'</a></li>';
 	}
-	$out .= '</ul></div>';
+	$out .= '</ul></div><hr>';
+    if($GLOBALS['devmode'] == 1)$out .= '<p class="footnote">DEVMODE aktiv.<br>Am System wird gerade gearbeitet!</p>';
 	return $out;
 }
diff --git a/person.php b/person.php
index 335db4b..6c7e064 100644
--- a/person.php
+++ b/person.php
@@ -23,7 +23,8 @@ try{
   }
 
   echo html_top("Person bearbeiten");
-  echo "<h1>Person bearbeiten</h1>";
+  echo html_linkbox("person");
+  echo "<h2>Person bearbeiten</h2>";
 
   if(isset($_REQUEST['delete'])){
     exit('<h2>Person gelöscht</h2><p><a href="list.php">Zurück zur Übersicht</a></p>'.html_bottom());
diff --git a/settings.php.example b/settings.php.example
index 3cae100..de34d96 100644
--- a/settings.php.example
+++ b/settings.php.example
@@ -1,8 +1,14 @@
 <?php
 
-ini_set('display_errors',1);
-ini_set('display_startup_errors',1);
-error_reporting(-1);
+$GLOBALS['devmode'] = 1;
+
+if($GLOBALS['devmode'] == 1){
+  ini_set('display_errors',1);
+  ini_set('display_startup_errors',1);
+  error_reporting(-1);
+}else{
+  error_reporting(0);
+}
 
 $GLOBALS['dbc'] = new PDO('pgsql:host=localhost;port=5432;dbname=SETME;user=SETME;password=SETME');
 $GLOBALS['dbc']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
diff --git a/style.css b/style.css
index 1069e41..9c6b955 100644
--- a/style.css
+++ b/style.css
@@ -90,6 +90,11 @@
 .footnote {
   text-align:right;
   font-size: 12px;
+  float: right;
+}
+
+hr {
+  clear: both;
 }
 
 table, th, td {
-- 
2.43.0