From 5fd875c0ce6da2a2eb451f55915e127654825a1b Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 28 Jul 2008 15:44:57 +0200 Subject: [PATCH] Added Maximize/Normalize button into the menu. Using this button, you can show and hide and header in your session to maximize useability of phpLogCon. --- src/include/functions_common.php | 2 + src/include/functions_frontendhelpers.php | 56 ++++++++++++++++++++++- src/lang/de/main.php | 3 ++ src/lang/en/main.php | 2 + src/lang/pt_BR/main.php | 2 + src/templates/include_footer.html | 1 - src/templates/include_header.html | 4 +- src/templates/include_menu.html | 6 +++ src/themes/dark/main.css | 8 ++++ src/themes/default/main.css | 7 +++ src/userchange.php | 13 +++++- 11 files changed, 98 insertions(+), 6 deletions(-) diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 77a9ee1..ea2bc41 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -440,6 +440,8 @@ function InitFrontEndVariables() $content['MENU_SOURCE_DISK'] = $content['BASEPATH'] . "images/icons/document_text.png"; $content['MENU_SOURCE_DB'] = $content['BASEPATH'] . "images/icons/data_table.png"; $content['MENU_SOURCE_PDO'] = $content['BASEPATH'] . "images/icons/data_gear.png"; + $content['MENU_MAXIMIZE'] = $content['BASEPATH'] . "images/icons/table_selection_all.png"; + $content['MENU_NORMAL'] = $content['BASEPATH'] . "images/icons/table_selection_block.png"; $content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png"; $content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png"; diff --git a/src/include/functions_frontendhelpers.php b/src/include/functions_frontendhelpers.php index c34716c..df02f8b 100644 --- a/src/include/functions_frontendhelpers.php +++ b/src/include/functions_frontendhelpers.php @@ -41,12 +41,28 @@ if ( !defined('IN_PHPLOGCON') ) function InitFrontEndDefaults() { + global $content; + // To create the current URL CreateCurrentUrl(); // --- BEGIN Main Info Area - + $content['MAXURL'] = $content['BASEPATH'] . "userchange.php?"; + if ( isset($_SESSION['SESSION_MAXIMIZED']) && $_SESSION['SESSION_MAXIMIZED'] == true ) + { + $content['MAXIMIZED'] = true; + $content['MAXIMAGE'] = $content['MENU_NORMAL']; + $content['MAXLANGTEXT'] = $content['LN_MENU_NORMALVIEW']; + $content['MAXURL'] .= "op=maximize&max=0"; + } + else + { + $content['MAXIMIZED'] = false; + $content['MAXIMAGE'] = $content['MENU_MAXIMIZE']; + $content['MAXLANGTEXT'] = $content['LN_MENU_MAXVIEW']; + $content['MAXURL'] .= "op=maximize&max=1"; + } // --- END Main Info Area @@ -65,6 +81,40 @@ function InstallFileReminder() } } +function GetAdditionalUrl($skipParam, $appendParam = "") +{ + global $content; +//echo $content['additional_url_full']; + if ( isset($content['additional_url_full']) && strlen($content['additional_url_full']) > 0 ) + { + if ( strlen($skipParam) > 0 ) + { + // remove parameters from string! + $szReturn = preg_replace("#(&{$skipParam}=[\w]+)#is", '', $content['additional_url_full']); + if ( strlen($szReturn) > 0 ) + { + if ( strlen($appendParam) > 0 ) + return $szReturn . "&" . $appendParam; + else + return $szReturn; + } + else if ( strlen($appendParam) > 0 ) + return "?" . $appendParam; + else + return ""; + } + else + return $content['additional_url_full']; + } + else + { + if ( strlen($appendParam) > 0 ) + return "?" . $appendParam; + else + return ""; + } +} + function CreateCurrentUrl() { global $content, $CFG; @@ -72,6 +122,7 @@ function CreateCurrentUrl() // Init additional_url helper variable $content['additional_url'] = ""; + $content['additional_url_full'] = ""; $content['additional_url_uidonly'] = ""; $content['additional_url_sortingonly'] = ""; $content['additional_url_sourceonly'] = ""; @@ -143,6 +194,9 @@ function CreateCurrentUrl() } else $content['additional_url'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1]; + + // always append to this URL! + $content['additional_url_full'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1]; } $hvCounter++; diff --git a/src/lang/de/main.php b/src/lang/de/main.php index e126ffd..1844500 100644 --- a/src/lang/de/main.php +++ b/src/lang/de/main.php @@ -69,6 +69,9 @@ $content['LN_MENU_LOGIN'] = "Login"; $content['LN_MENU_ADMINCENTER'] = "Admin Center"; $content['LN_MENU_LOGOFF'] = "Logoff"; $content['LN_MENU_LOGGEDINAS'] = "Logged in as"; + $content['LN_MENU_MAXVIEW'] = "Maximize View"; + $content['LN_MENU_NORMALVIEW'] = "Normalize View"; + // Index Site $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warnung! Du hast das Installationsscript 'install.php' noch nicht aus dem phpLogCon Hauptordner entfernt!"; diff --git a/src/lang/en/main.php b/src/lang/en/main.php index 8fc40c2..a330118 100644 --- a/src/lang/en/main.php +++ b/src/lang/en/main.php @@ -70,6 +70,8 @@ $content['LN_GEN_DB_SQLITE'] = "SQLite 2"; $content['LN_MENU_ADMINCENTER'] = "Admin Center"; $content['LN_MENU_LOGOFF'] = "Logoff"; $content['LN_MENU_LOGGEDINAS'] = "Logged in as"; + $content['LN_MENU_MAXVIEW'] = "Maximize View"; + $content['LN_MENU_NORMALVIEW'] = "Normalize View"; // Main Index Site $content['LN_ERROR_INSTALLFILEREMINDER'] = "Warning! You still have NOT removed the 'install.php' from your phpLogCon main directory!"; diff --git a/src/lang/pt_BR/main.php b/src/lang/pt_BR/main.php index abb861e..f4e46e9 100644 --- a/src/lang/pt_BR/main.php +++ b/src/lang/pt_BR/main.php @@ -73,6 +73,8 @@ $content['LN_GEN_SELECTVIEW'] = "Visão"; $content['LN_MENU_ADMINCENTER'] = "Admin Center"; $content['LN_MENU_LOGOFF'] = "Logoff"; $content['LN_MENU_LOGGEDINAS'] = "Logged in as"; + $content['LN_MENU_MAXVIEW'] = "Maximize View"; + $content['LN_MENU_NORMALVIEW'] = "Normalize View"; // Main Index Site $content['LN_ERROR_INSTALLFILEREMINDER'] = "Atenção! Você ainda NÃO removeu o arquivo 'install.php' do diretório de seu phpLogCon!"; diff --git a/src/templates/include_footer.html b/src/templates/include_footer.html index 7da75ef..8e46353 100644 --- a/src/templates/include_footer.html +++ b/src/templates/include_footer.html @@ -1,4 +1,3 @@ -

diff --git a/src/templates/include_header.html b/src/templates/include_header.html index c89a45b..28634ee 100644 --- a/src/templates/include_header.html +++ b/src/templates/include_header.html @@ -11,6 +11,7 @@ +
@@ -65,7 +66,6 @@ -
@@ -116,7 +116,7 @@
- + diff --git a/src/templates/include_menu.html b/src/templates/include_menu.html index bb65c31..25cc2dd 100644 --- a/src/templates/include_menu.html +++ b/src/templates/include_menu.html @@ -23,5 +23,11 @@ + + + +
  + {MAXLANGTEXT} +
diff --git a/src/themes/dark/main.css b/src/themes/dark/main.css index 135399f..b9ec9f2 100644 --- a/src/themes/dark/main.css +++ b/src/themes/dark/main.css @@ -236,6 +236,14 @@ font color: #FFFFFF; background-color: #290604; } +.topmenuextra +{ + height: 16px; + font: 10px Verdana, Arial, Helvetica, sans-serif; + color: #FFFFFF; + background-color: #053841; +} + .topmenu2begin { height: 20px; diff --git a/src/themes/default/main.css b/src/themes/default/main.css index 770eba7..082bd71 100644 --- a/src/themes/default/main.css +++ b/src/themes/default/main.css @@ -239,6 +239,13 @@ font color: #FFFFFF; background-color: #597196; } +.topmenuextra +{ + height: 20px; + font: 10px Verdana, Arial, Helvetica, sans-serif; + color: #FFFFFF; + background-color: #B8D4E0; +} .topmenu2begin { height: 20px; diff --git a/src/userchange.php b/src/userchange.php index 0b84233..7ded33c 100644 --- a/src/userchange.php +++ b/src/userchange.php @@ -80,8 +80,17 @@ if ( isset($_GET['op']) ) exit; } } - - + if ( $_GET['op'] == "maximize" && isset($_GET['max']) ) + { + if ( intval($_GET['max']) == 1 ) + { + $_SESSION['SESSION_MAXIMIZED'] = true; + } + else + { + $_SESSION['SESSION_MAXIMIZED'] = false; + } + } if ( $_GET['op'] == "changepagesize" && isset($_GET['pagesizeid']) ) { if ( intval($_GET['pagesizeid']) >= 0 && intval($_GET['pagesizeid']) < count($content['pagesizes']) )