From e53891f4375882eba23d10df70d92bff167677a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 10 Mar 2009 17:14:19 +0000 Subject: [PATCH] Functions for handling INC_POOL moved to inc-functions.php, plus some extra functions. Template admin_settings_saved.tpl has no longer tables --- inc/functions.php | 113 +------------ inc/inc-functions.php | 156 ++++++++++++++++++ inc/language/de.php | 2 +- inc/modules/admin.php | 7 +- inc/mysql-connect.php | 2 +- .../de/html/admin/admin_overview_header.tpl | 28 ++-- templates/de/html/admin/admin_reg_form.tpl | 5 +- .../de/html/admin/admin_settings_saved.tpl | 20 ++- theme/business/css/general.css | 85 +++++----- theme/default/css/general.css | 12 +- theme/desert/css/general.css | 3 +- 11 files changed, 244 insertions(+), 189 deletions(-) create mode 100644 inc/inc-functions.php diff --git a/inc/functions.php b/inc/functions.php index a3fb34dbd0..a794e2d9e0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -41,20 +41,6 @@ if (!defined('__SECURITY')) { require($INC); } -// Check if our config file is writeable or not -function IS_INC_WRITEABLE ($inc) { - // Generate FQFN - $FQFN = sprintf("%sinc/%s.php", constant('PATH'), $inc); - - // Abort by simple test - if ((FILE_READABLE($FQFN)) && (!is_writeable($FQFN))) { - return false; - } // END - if - - // Test write-access on directory - return is_writeable(dirname($FQFN)); -} - // Output HTML code directly or "render" it. You addionally switch the new-line character off function OUTPUT_HTML ($HTML, $newLine = true) { // Some global variables @@ -2698,7 +2684,7 @@ function LOAD_INC ($INC) { $FQFN = constant('PATH') . $INC; // Is the include file there? - if (!FILE_READABLE($FQFN)) { + if (!INCLUDE_READABLE($INC)) { // Not there so log it debug_report_bug(sprintf("Include file %s not found.", $INC)); return false; @@ -3102,58 +3088,6 @@ function DEBUG_LOG ($funcFile, $line, $message, $force=true) { } // END - if } -// Reads a directory with PHP files in and gets only files back -function GET_DIR_AS_ARRAY ($baseDir, $prefix, $includeDirs = false, $addBaseDir = true) { - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix} - Entered!"); - // Init includes - $INCs = array(); - - // Open directory - $dirPointer = opendir(constant('PATH') . $baseDir) or mxchange_die("Cannot read ".basename($baseDir)." path!"); - - // Read all entries - while ($baseFile = readdir($dirPointer)) { - // Construct include filename and FQFN - $INC = $baseDir . "/" . $baseFile; - $FQFN = constant('PATH') . $INC; - - // Is this a valid reset file? - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}"); - if (((FILE_READABLE($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) || (($includeDirs) && (isDirectory($FQFN)))) { - // Remove both for extension name - $extName = substr($baseFile, strlen($prefix), -4); - - // Try to find it - $extId = GET_EXT_ID($extName); - - // Is the extension valid and active? - if (($extId > 0) && (EXT_IS_ACTIVE($extName))) { - // Then add this file - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " Extension entry ".$baseFile." added."); - $INCs[] = $INC; - } elseif ($extId == 0) { - // Add non-extension files as well - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " Regular entry ".$baseFile." added."); - if ($addBaseDir) { - $INCs[] = $INC; - } else { - $INCs[] = $baseFile; - } - } - } // END - if - } // END - while - - // Close directory - closedir($dirPointer); - - // Sort array - asort($INCs); - - // Return array with include files - //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " - Left!"); - return $INCs; -} - // Load more reset scripts function runResetIncludes () { // Is the reset set or old sql_patches? @@ -3621,51 +3555,6 @@ function isDirectory ($FQFN) { return $isDirectory; } -// Init INC_POOL -function INIT_INC_POOL () { - $GLOBALS['inc_pool'] = array(); -} - -// Setter for INC_POOL -function SET_INC_POOL ($includePool) { - $GLOBALS['inc_pool'] = (array) $includePool; -} - -// Getter for INC_POOL -function GET_INC_POOL () { - return $GLOBALS['inc_pool']; -} - -// Count INC_POOL -function COUNT_INC_POOL () { - return count($GLOBALS['inc_pool']); -} - -// Merge INC_POOL into given -function MERGE_INC_POOL ($includePool) { - SET_INC_POOL(merge_array(GET_INC_POOL(), $includePool)); -} - -// Add single include file to INC_POOL -function ADD_INC_TO_POOL ($INC) { - $GLOBALS['inc_pool'][] = (string) $INC; -} - -// Remove an include file from INC_POOL -function REMOVE_INC_FROM_POOL ($INC) { - // First look it up - $key = array_search($INC, GET_INC_POOL()); - - // Is it valid? - if ($key !== false) { - // Then remove it - unset($GLOBALS['inc_pool'][$key]); - - // And sort the list - asort($GLOBALS['inc_pool']); - } // END - if -} - // Handle message codes from URL function handleCodeMessage () { if (REQUEST_ISSET_GET(('msg'))) { diff --git a/inc/inc-functions.php b/inc/inc-functions.php new file mode 100644 index 0000000000..22fd177bdf --- /dev/null +++ b/inc/inc-functions.php @@ -0,0 +1,156 @@ + 0) && (EXT_IS_ACTIVE($extName))) { + // Then add this file + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " Extension entry ".$baseFile." added."); + $INCs[] = $INC; + } elseif ($extId == 0) { + // Add non-extension files as well + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " Regular entry ".$baseFile." added."); + if ($addBaseDir) { + $INCs[] = $INC; + } else { + $INCs[] = $baseFile; + } + } + } // END - if + } // END - while + + // Close directory + closedir($dirPointer); + + // Sort array + asort($INCs); + + // Return array with include files + //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, " - Left!"); + return $INCs; +} + +// Init INC_POOL +function INIT_INC_POOL () { + $GLOBALS['inc_pool'] = array(); +} + +// Setter for INC_POOL +function SET_INC_POOL ($includePool) { + $GLOBALS['inc_pool'] = (array) $includePool; +} + +// Getter for INC_POOL +function GET_INC_POOL () { + return $GLOBALS['inc_pool']; +} + +// Count INC_POOL +function COUNT_INC_POOL () { + return count($GLOBALS['inc_pool']); +} + +// Merge INC_POOL into given +function MERGE_INC_POOL ($includePool) { + SET_INC_POOL(merge_array(GET_INC_POOL(), $includePool)); +} + +// Add single include file to INC_POOL +function ADD_INC_TO_POOL ($INC) { + $GLOBALS['inc_pool'][] = (string) $INC; +} + +// Remove an include file from INC_POOL +function REMOVE_INC_FROM_POOL ($INC) { + // First look it up + $key = array_search($INC, GET_INC_POOL()); + + // Is it valid? + if ($key !== false) { + // Then remove it + unset($GLOBALS['inc_pool'][$key]); + + // And sort the list + asort($GLOBALS['inc_pool']); + } // END - if +} + +// [EOF] +?> diff --git a/inc/language/de.php b/inc/language/de.php index cbfb985c55..4593a9f465 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1033,7 +1033,7 @@ define('ADMIN_LINK_LOCK_USER_TITLE', "Mitglied sperren"); define('ADMIN_LINK_UNLOCK_USER_TITLE', "Mitglied entsperren"); define('ADMIN_LINK_ADD_POINTS_TITLE', "{!POINTS!} aufbuchen"); define('ADMIN_LINK_SUB_POINTS_TITLE', "{!POINTS!} abziehen"); -define('MESSAGE_HEADER', "Hinweis"); +define('MESSAGE_HEADER', "Hinweis:"); define('ADMIN_ALPHA_SELCTION', "Alphabetische Suche:"); define('CATEGORY_NOT_SAVED', "Kategorie %d nicht gespeichert."); define('USER_ACCOUNT_404', "User-Account %d nicht gefunden."); diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 2d9fc975f8..37f234633d 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -135,13 +135,16 @@ if (!isAdminRegistered()) { define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage)); // Reset variables - $loginMessage = ""; $passwdMessage = ""; - } else { + $loginMessage = ""; $passwdMessage = ""; + } else { // Reset values to nothing define('__MSG_LOGIN', ""); define('__MSG_PASS' , ""); } + // Output message in seperate template + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOT_REGISTERED')); + // Load register template LOAD_TEMPLATE("admin_reg_form"); } diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index d8d70d7c8a..5e97ba5b0c 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { require("inc/functions.php"); // Load more function libraries or includes -foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) { +foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) { // Load special functions LOAD_INC_ONCE(sprintf("inc/%s.php", $lib)); } // END - foreach diff --git a/templates/de/html/admin/admin_overview_header.tpl b/templates/de/html/admin/admin_overview_header.tpl index 9bd78aa15e..f203017174 100644 --- a/templates/de/html/admin/admin_overview_header.tpl +++ b/templates/de/html/admin/admin_overview_header.tpl @@ -1,16 +1,16 @@
- - - - - - - - - - - - + + + + + + + + + + + + diff --git a/templates/de/html/admin/admin_reg_form.tpl b/templates/de/html/admin/admin_reg_form.tpl index 34a75abadb..e26f988e5c 100644 --- a/templates/de/html/admin/admin_reg_form.tpl +++ b/templates/de/html/admin/admin_reg_form.tpl @@ -3,9 +3,8 @@
-
{--ADMIN_TASK_SYSTEM_WELCOME--}
-
{--ID_SELECT--}{--ADMIN_ASSIGNED_ADMIN--}{--ADMIN_REGISTER_EXTENSION--}{--ADMIN_TASK_INFOS--}{--ADMIN_MEMBER_UID--}{--ADMIN_TASK_TYPE--}{--ADMIN_TASK_CREATED--}
+
{--ADMIN_TASK_SYSTEM_WELCOME--}
+
{--ID_SELECT--}{--ADMIN_ASSIGNED_ADMIN--}{--ADMIN_REGISTER_EXTENSION--}{--ADMIN_TASK_INFOS--}{--ADMIN_MEMBER_UID--}{--ADMIN_TASK_TYPE--}{--ADMIN_TASK_CREATED--}
+ {--ADMIN_REGISTER_NOW--} + diff --git a/templates/de/html/admin/admin_settings_saved.tpl b/templates/de/html/admin/admin_settings_saved.tpl index 6c9c0892e2..1c83398e87 100644 --- a/templates/de/html/admin/admin_settings_saved.tpl +++ b/templates/de/html/admin/admin_settings_saved.tpl @@ -1,8 +1,12 @@ -
-
{--ADMIN_NOT_REGISTERED--}
-
- {--ADMIN_REGISTER_NOW--}
 
- - - - - - -
{--MESSAGE_HEADER--}
$content
+
+ +
+
+ {--MESSAGE_HEADER--} +
+
+ $content +
+
+ +
diff --git a/theme/business/css/general.css b/theme/business/css/general.css index 24731f2b25..230e55d8b1 100644 --- a/theme/business/css/general.css +++ b/theme/business/css/general.css @@ -84,65 +84,66 @@ ul, ol { } .runtime_fatalcontent { - text-align : left; - font-size : 12px; + text-align : left; + font-size : 12px; } .admin { color : #000000; - background-color : #FFFFFF; + background-color : #FFFFFF; font-family : Verdana, Arial, Geneva, Helvetica, sans-serif; } .admin_note { color : #000000; - font-size : 12px; + font-size : 12px; } DIV.admin_note { - padding-top : 10px; - padding-right : 10px; - padding-left : 10px; + padding-top : 10px; + padding-right : 10px; + padding-left : 10px; } .admin_fatal { color : #000000; - font-size : 18px; + font-size : 18px; } .admin_edit, .member_confirm { - background-color : #FFFFFF; + background-color : #FFFFFF; } .member_banner { - background-color : #FFFFFF; + background-color : #FFFFFF; width : 488px; } .admin_error { - background-color : #FFFFFF; + background-color : #FFFFFF; color : #000000; - font-size : 10px; + font-size : 10px; } .admin_select, .guest_select, .member_select { border : solid 1px; - border-color : #000000; - background-color : #EEEEFF; + border-color : #000000; + background-color : #EEEEFF; } .admin_register, .admin_desc_header, .admin_done, .admin_title, .member_title2, .guest_title2, .admin_message { - background-color : #EEEEFF; + background-color : #EEEEFF; color : #000000; text-align : center; } .admin_title2 { - background-color : #EEEEFF; + font-weight : bold; + padding : 4px; + background-color : #EEEEFF; color : #000000; text-align : center; - height : 25px; - font-size : 14px; + font-size : 14px; } .member_done, .guest_done { @@ -150,7 +151,7 @@ DIV.admin_note { } .member_misc { - background-color : #FFFFFF; + background-color : #FFFFFF; } .admin_misc, .member_misc { @@ -166,40 +167,40 @@ DIV.admin_note { } .admin_welcome { - background-color : #EEEEFF; + background-color : #EEEEFF; color : #000000; - vertical-align : middle; - font-size : 18px; + vertical-align : middle; + font-size : 18px; height : 50px; } .admin_header { - background-color : #EEEEFF; + background-color : #EEEEFF; } .admin_menu { - background-color : #EEEEFF; + background-color : #EEEEFF; color : #000000; width : 230px; } .admin_logout { - background-color : #DDDDFF; + background-color : #DDDDFF; color : #000000; } .admin_desc_cont { - text-align : left; - background-color : #FFFFFF; + text-align : left; + background-color : #FFFFFF; } .admin_table, .member_table { - background-color : #FFFFFF; + background-color : #FFFFFF; } .admin_editmenu { - min-width : 500px; - max-width : 90%; + min-width : 500px; + max-width : 90%; } .admin_form_header { @@ -635,17 +636,17 @@ DIV.admin_note { } .admin_message { - margin-bottom : 15px; + padding-bottom : 15px; } #show_timings_block { margin-top : 5px; - tex-align : center; - border : solid 1px; - border-color : #000000; - background-color : #EEEEFF; - font-size : 10px; - vertical-align : middle; + tex-align : center; + border : solid 1px; + border-color : #000000; + background-color : #EEEEFF; + font-size : 10px; + vertical-align : middle; width : 465px; height : 22px; z-index : 0; @@ -654,13 +655,13 @@ DIV.admin_note { .show_timings_column { z-index : 10; top : 3px; - background-color : #FFFFFF; - position : relative; + background-color : #FFFFFF; + position : relative; margin : 0px; width : 150px; display : block; - border : solid 1px; - border-color : #000000; + border : solid 1px; + border-color : #000000; } .show_timings_data { @@ -670,7 +671,7 @@ DIV.admin_note { .login_failure_header { text-align : center; - background-color : #EEEEFF; + background-color : #EEEEFF; font-weight : bold; } diff --git a/theme/default/css/general.css b/theme/default/css/general.css index 4c301c2c57..f3c2ff173e 100644 --- a/theme/default/css/general.css +++ b/theme/default/css/general.css @@ -151,7 +151,7 @@ DIV.admin_note { } .admin_register, .admin_desc_header, .admin_done, .admin_title, .member_title2, .guest_title2, .admin_message { - background-color : #ddeedd; + background-color : #ddeedd; color : #009900; text-align : center; } @@ -542,11 +542,12 @@ DIV.admin_note { } .admin_title2 { - background-color : #ddeedd; + font-weight : bold; + padding : 4px; + background-color : #ddeedd; color : #000099; text-align : center; - height : 25px; - font-size : 14px; + font-size : 14px; } .member_unconfirmed { @@ -661,7 +662,8 @@ DIV.admin_note { } .admin_message { - margin-bottom : 15px; + padding-top : 5px; + padding-bottom : 5px; } #show_timings_block { diff --git a/theme/desert/css/general.css b/theme/desert/css/general.css index 98771c0ef0..15d6e60447 100644 --- a/theme/desert/css/general.css +++ b/theme/desert/css/general.css @@ -597,10 +597,11 @@ DIV.admin_note { } .admin_title2 { + font-weight : bold; + padding : 4px; background-color : #DDDDAA; color : #880000; text-align : center; - height : 25px; font-size : 14px; } -- 2.39.5