From 3c9762973a6349e04c677ab53bc15de1bded135a Mon Sep 17 00:00:00 2001 From: quix0r Date: Thu, 12 Mar 2009 17:34:03 +0000 Subject: [PATCH] Rewritten all THEME_FOO variables to GLOBALS --- .gitattributes | 1 - inc/libs/theme_functions.php | 2 +- inc/modules/admin/what-theme_edit.php | 8 ++++---- inc/modules/admin/what-theme_import.php | 14 +++++++------- inc/modules/member/what-themes.php | 10 +++++----- templates/de/html/admin/admin_new_ext.tpl | 1 - theme/business/theme.php | 14 +++++++------- theme/default/theme.php | 14 +++++++------- theme/desert/theme.php | 14 +++++++------- 9 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 templates/de/html/admin/admin_new_ext.tpl diff --git a/.gitattributes b/.gitattributes index d13df1113f..078ba80c1a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1119,7 +1119,6 @@ templates/de/html/admin/admin_mods_stats.tpl -text templates/de/html/admin/admin_mods_stats2.tpl -text templates/de/html/admin/admin_mods_stats2_row.tpl -text templates/de/html/admin/admin_mods_stats_row.tpl -text -templates/de/html/admin/admin_new_ext.tpl -text templates/de/html/admin/admin_newsletter.tpl -text templates/de/html/admin/admin_newsletter_nohtml.tpl -text templates/de/html/admin/admin_newsletter_tsk.tpl -text diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 766ca009a9..640dd0b1f3 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -63,7 +63,7 @@ function THEME_SELECTION_BOX ($mod, $act, $wht, $result) { // And save all data in array LOAD_INC($INC); $themesArray['theme_unix'][] = $content['theme_path']; - $themesArray['theme_name'][] = $THEME_NAME; + $themesArray['theme_name'][] = $GLOBALS['theme_data']['name']; } // END - if } // END - while diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index ae1e64d4d6..1aab5bbd91 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -98,7 +98,7 @@ if ($SEL > 0) { } // Switch to testing mode -$THEME_MODE = "test"; +$GLOBALS['theme_mode'] = "test"; // Generate output lines for the template $OUT = ""; $SW = 2; @@ -123,9 +123,9 @@ if (SQL_NUMROWS($result) > 0) { 'link' => $LINK, 'name' => $content['theme_name'], 'is_act' => TRANSLATE_YESNO($content['theme_active']), - 'email' => "".$THEME_AUTHOR."", - 'url_link' => DEREFERER($THEME_URL), - 'url_title' => $THEME_URL, + 'email' => "".$GLOBALS['theme_data']['author']."", + 'url_link' => DEREFERER($GLOBALS['theme_data']['url']), + 'url_title' => $GLOBALS['theme_data']['url'], 'ver' => $content['theme_ver'], ); diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index 0cc67e7c31..6d27c505d7 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -49,7 +49,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Switch to testing mode -$THEME_MODE = "test"; +$GLOBALS['theme_mode'] = "test"; // Import selected theme if not present if (REQUEST_ISSET_POST(('theme'))) { @@ -64,7 +64,7 @@ if (REQUEST_ISSET_POST(('theme'))) { // Register it ith the exchange SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`,`theme_active`,`theme_ver`,`theme_name`) VALUES ('%s','N','%s','%s')", - array(REQUEST_POST('theme'), $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__); + array(REQUEST_POST('theme'), $GLOBALS['theme_data']['version'], $GLOBALS['theme_data']['name']), __FILE__, __LINE__); // Destroy cache rebuildCacheFiles("themes", "them"); @@ -107,11 +107,11 @@ while ($dir = readdir($handle)) { // Add found theme to array $THEMES['theme_unix'][] = $dir; - $THEMES['theme_name'][] = $THEME_NAME; - $THEMES['theme_author'][] = $THEME_AUTHOR; - $THEMES['theme_email'][] = $THEME_EMAIL; - $THEMES['theme_url'][] = $THEME_URL; - $THEMES['theme_ver'][] = $THEME_VERSION; + $THEMES['theme_name'][] = $GLOBALS['theme_data']['name']; + $THEMES['theme_author'][] = $GLOBALS['theme_data']['author']; + $THEMES['theme_email'][] = $GLOBALS['theme_data']['email']; + $THEMES['theme_url'][] = $GLOBALS['theme_data']['url']; + $THEMES['theme_ver'][] = $GLOBALS['theme_data']['version']; } // END - if } // END - while diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index 9d794f9135..2a466cdbee 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -87,11 +87,11 @@ while ($entry = readdir($handle)) { // Add found theme to array $THEMES['theme_unix'][] = $entry; - $THEMES['theme_name'][] = $THEME_NAME; - $THEMES['theme_author'][] = $THEME_AUTHOR; - $THEMES['theme_email'][] = $THEME_EMAIL; - $THEMES['theme_url'][] = $THEME_URL; - $THEMES['theme_ver'][] = $THEME_VERSION; + $THEMES['theme_name'][] = $GLOBALS['theme_data']['name']; + $THEMES['theme_author'][] = $GLOBALS['theme_data']['author']; + $THEMES['theme_email'][] = $GLOBALS['theme_data']['email']; + $THEMES['theme_url'][] = $GLOBALS['theme_data']['url']; + $THEMES['theme_ver'][] = $GLOBALS['theme_data']['version']; } // END - if } // END - while diff --git a/templates/de/html/admin/admin_new_ext.tpl b/templates/de/html/admin/admin_new_ext.tpl deleted file mode 100644 index 11f5d85d80..0000000000 --- a/templates/de/html/admin/admin_new_ext.tpl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/theme/business/theme.php b/theme/business/theme.php index 0324a511d1..a90427ac0e 100644 --- a/theme/business/theme.php +++ b/theme/business/theme.php @@ -46,24 +46,24 @@ if (!defined('__SECURITY')) { // Theme definitions // // The name of your theme -$THEME_NAME = "Solid-Business"; +$GLOBALS['theme_data']['name'] = "Solid-Business"; // Only your name please! -$THEME_AUTHOR = "Roland Häder"; +$GLOBALS['theme_data']['author'] = "Roland Häder"; // Your email address -$THEME_EMAIL = "webmaster@mxchange.org"; +$GLOBALS['theme_data']['email'] = "webmaster@mxchange.org"; // URL where you have uploaded it -$THEME_URL = "http://www.mxchange.org"; +$GLOBALS['theme_data']['url'] = "http://www.mxchange.org"; // Version number -$THEME_VERSION = "0.0"; +$GLOBALS['theme_data']['version'] = "0.0"; // Switch mode -if (empty($THEME_MODE)) $THEME_MODE = "load"; +if (empty($GLOBALS['theme_mode'])) $GLOBALS['theme_mode'] = "load"; -switch ($THEME_MODE) +switch ($GLOBALS['theme_mode']) { case "test": // Do stuff while testing the theme: The admin clicked on "Import" break; diff --git a/theme/default/theme.php b/theme/default/theme.php index a572648486..b42cb8ada3 100644 --- a/theme/default/theme.php +++ b/theme/default/theme.php @@ -46,24 +46,24 @@ if (!defined('__SECURITY')) { // Theme definitions // // The name of your theme -$THEME_NAME = "Standart-Theme"; +$GLOBALS['theme_data']['name'] = "Standart-Theme"; // Only your name please! -$THEME_AUTHOR = "Roland Häder"; +$GLOBALS['theme_data']['author'] = "Roland Häder"; // Your email address -$THEME_EMAIL = "webmaster@mxchange.org"; +$GLOBALS['theme_data']['email'] = "webmaster@mxchange.org"; // URL where you have uploaded it -$THEME_URL = "http://www.mxchange.org"; +$GLOBALS['theme_data']['url'] = "http://www.mxchange.org"; // Version number -$THEME_VERSION = "0.0"; +$GLOBALS['theme_data']['version'] = "0.0"; // Switch mode -if (empty($THEME_MODE)) $THEME_MODE = "load"; +if (empty($GLOBALS['theme_mode'])) $GLOBALS['theme_mode'] = "load"; -switch ($THEME_MODE) +switch ($GLOBALS['theme_mode']) { case "test": // Do stuff while testing the theme: The admin clicked on "Import" break; diff --git a/theme/desert/theme.php b/theme/desert/theme.php index adcf7f2de3..55aaa01836 100644 --- a/theme/desert/theme.php +++ b/theme/desert/theme.php @@ -46,24 +46,24 @@ if (!defined('__SECURITY')) { // Theme definitions // // The name of your theme -$THEME_NAME = "Desert-Storm"; +$GLOBALS['theme_data']['name'] = "Desert-Storm"; // Only your name please! -$THEME_AUTHOR = "Roland Häder"; +$GLOBALS['theme_data']['author'] = "Roland Häder"; // Your email address -$THEME_EMAIL = "webmaster@mxchange.org"; +$GLOBALS['theme_data']['email'] = "webmaster@mxchange.org"; // URL where you have uploaded it -$THEME_URL = "http://www.mxchange.org"; +$GLOBALS['theme_data']['url'] = "http://www.mxchange.org"; // Version number -$THEME_VERSION = "0.0.1"; +$GLOBALS['theme_data']['version'] = "0.0.1"; // Switch mode -if (empty($THEME_MODE)) $THEME_MODE = "load"; +if (empty($GLOBALS['theme_mode'])) $GLOBALS['theme_mode'] = "load"; -switch ($THEME_MODE) +switch ($GLOBALS['theme_mode']) { case "test": // Do stuff while testing the theme: The admin clicked on "Import" break; -- 2.39.5