From: Roland Häder Date: Sat, 7 Mar 2009 17:44:20 +0000 (+0000) Subject: More fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=66b2219e27cbea96dcfe69a181b9ab819796a820;p=mailer.git More fixes --- diff --git a/inc/extensions.php b/inc/extensions.php index 5e94c32dc3..cd182874e5 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -130,7 +130,6 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run // Registeres an extension and possible update depencies function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = true) { global $INC_POOL; - global $NOTES; // This shall never do a non-admin user! if (!IS_ADMIN()) return false; @@ -153,12 +152,12 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr } // END - if } // END - if - // Init queries + // Init queries and notes INIT_SQLS(); + EXT_INIT_NOTES(); // Init variables $ret = false; - $NOTES = ""; $INC_POOL = array(); // By default we have no failures @@ -174,7 +173,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr LOAD_EXTENSION($ext_name, "update", $ver, $dry_run); // Add update notes to our output - $NOTES .= ADD_EXTENSION_NOTES($ver); + ADD_EXTENSION_NOTES($ver); } // END - foreach // Does this extension depends on an outstanding update of another update? @@ -428,16 +427,13 @@ function GET_EXT_VERSION ($ext_name) { // Updates a given extension with current extension version to latest version function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { // This shall never do a non-admin user! - global $NOTES; global $INC_POOL; // Init arrays INIT_SQLS(); + EXT_INIT_NOTES(); $INC_POOL = array(); - // Init notes - $NOTES = ""; - // Only admins are allowed to update extensions if ((!IS_ADMIN()) || (empty($ext_name))) return false; @@ -482,7 +478,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { } // END - if // Add notes - $NOTES .= ADD_EXTENSION_NOTES($GLOBALS['cache_array']['update_ver'][$ext_name]); + ADD_EXTENSION_NOTES($GLOBALS['cache_array']['update_ver'][$ext_name]); } // END - for // In real-mode execute any existing includes @@ -498,7 +494,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { if (!$dry_run) { // Create task - CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $GLOBALS['cache_array']['update_ver'][$ext_name], SQL_ESCAPE($NOTES)); + CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $GLOBALS['cache_array']['update_ver'][$ext_name], SQL_ESCAPE(EXT_GET_NOTES(EXT_GET_NOTES()))); // Update extension's version SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1", @@ -842,6 +838,8 @@ function ADD_EXTENSION_NOTES ($ver) { 'ver' => $ver, 'notes' => EXT_GET_UPDATE_NOTES() ); + + // Reset them EXT_SET_UPDATE_NOTES(""); } elseif (($ver == "0.0") || ($ver == "0.0.0")) { // Initial release @@ -861,8 +859,8 @@ function ADD_EXTENSION_NOTES ($ver) { $out = LOAD_TEMPLATE("admin_ext_notes", true, $content); } // END - if - // Return the output - return $out; + // Add the notes + EXT_APPEND_NOTES($out); } // Getter for CSS files array @@ -900,7 +898,7 @@ function EXT_ADD_CSS_FILE ($file) { // Setter for EXT_ALWAYS_ACTIVE flag function EXT_SET_ALWAYS_ACTIVE ($active) { - $GLOBALS['ext_always_active'] = $active; + $GLOBALS['ext_always_active'] = (string) $active; } // Getter for EXT_ALWAYS_ACTIVE flag @@ -910,7 +908,7 @@ function EXT_GET_ALWAYS_ACTIVE () { // Setter for EXT_VERSION flag function EXT_SET_VERSION ($version) { - $GLOBALS['ext_version'] = $version; + $GLOBALS['ext_version'] = (float) $version; } // Getter for EXT_VERSION flag @@ -920,7 +918,7 @@ function EXT_GET_VERSION () { // Setter for EXT_DEPRECATED flag function EXT_SET_DEPRECATED ($deprecated) { - $GLOBALS['ext_deprecated'] = $deprecated; + $GLOBALS['ext_deprecated'] = (string) $deprecated; } // Getter for EXT_DEPRECATED flag @@ -930,7 +928,7 @@ function EXT_GET_DEPRECATED () { // Setter for EXT_UPDATE_DEPENDS flag function EXT_SET_UPDATE_DEPENDS ($updateDepends) { - $GLOBALS['ext_update_depends'] = $updateDepends; + $GLOBALS['ext_update_depends'] = (string) $updateDepends; } // Getter for EXT_UPDATE_DEPENDS flag @@ -940,7 +938,7 @@ function EXT_GET_UPDATE_DEPENDS () { // Setter for EXT_REPORTS_FAILURE flag function EXT_SET_REPORTS_FAILURE ($reportsFailure) { - $GLOBALS['ext_reports_failure'] = $reportsFailure; + $GLOBALS['ext_reports_failure'] = (string) $reportsFailure; } // Getter for EXT_REPORTS_FAILURE flag @@ -953,14 +951,14 @@ function EXT_SET_VER_HISTORY ($verHistory) { $GLOBALS['ext_ver_history'] = (array) $verHistory; } -// Getter for EXT_VER_HISTORY flag +// Getter for EXT_VER_HISTORY array function EXT_GET_VER_HISTORY () { return $GLOBALS['ext_ver_history']; } // Setter for EXT_UPDATE_NOTES flag function EXT_SET_UPDATE_NOTES ($updateNotes) { - $GLOBALS['ext_update_notes'] = (array) $updateNotes; + $GLOBALS['ext_update_notes'] = (string) $updateNotes; } // Getter for EXT_UPDATE_NOTES flag @@ -968,5 +966,20 @@ function EXT_GET_UPDATE_NOTES () { return $GLOBALS['ext_update_notes']; } +// Init extension notice +function EXT_INIT_NOTES () { + $GLOBALS['ext_notes'] = ""; +} + +// Append extension notice +function EXT_APPEND_NOTES ($notes) { + $GLOBALS['ext_notes'] .= (string) $notes; +} + +// Getter for extension notes +function EXT_GET_NOTES () { + return $GLOBALS['ext_notes']; +} + // ?> diff --git a/inc/language/de.php b/inc/language/de.php index 4b39d7a561..3517e96d3a 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1159,6 +1159,7 @@ define('ADMIN_SUBJECT_EXTENSION_DEACTIVATED', "Automatische Deaktivierung einer define('FATAL_EXTENSION_LOADED', "Erweiterung %s bereits geladen!"); define('ADMIN_ACCESS_DENIED', "Zugriff auf diesen Adminmenüpunkt nicht gestattet."); define('ADMIN_URL_BLACKLIST_DISABLED', "URL-Sperrliste ist deaktiviert."); +define('ADMIN_MENU_IS_EMPTY', "Das von Ihnen ausgewählte Menü %s ist leer."); define('MEMBER_MAIL_BONUS_CONFIRMED_ON', "Sie haben diese Bonusmail %s bestätigt."); define('MEMBER_MAIL_NORMAL_CONFIRMED_ON', "Sie haben diese Klickmail %s bestätigt."); diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index aa7284ccf5..8df89bcda1 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -60,12 +60,12 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) { $TITLEs = array(); // Chheck for new extensions and updates - $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_main); + $jobsDone = OUTPUT_STANDARD_OVERVIEW($result_main); // Init SQLs INIT_SQLS(); - if (!$JOBS_DONE) { + if (!$jobsDone) { // New extensions or updates found $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND `status`='NEW' AND task_type='EXTENSION_UPDATE'");