More misc fixes and rewrites (sorry, lame description)
[mailer.git] / inc / modules / sponsor.php
index 2a2a7fc..4f88a06 100644 (file)
@@ -40,15 +40,15 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif ((!EXT_IS_ACTIVE('sponsor'))) {
-       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('sponsor'));
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('sponsor'));
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
        addFatalMessage(__FILE__, __LINE__, getMessage('SPONSOR_ONLY_AREA_ENTERED'));
        return;
-} elseif (empty($GLOBALS['what'])) {
+} elseif (!isWhatSet()) {
        // Empty what value detected!
-       $GLOBALS['what'] = "welcome";
+       setWhat('welcome');
 }
 
 // A valid sponsor login and we are allowed to enter this module so let's
@@ -56,22 +56,22 @@ if (!defined('__SECURITY')) {
 UPDATE_SPONSOR_LOGIN();
 
 // Generate menu
-define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU($GLOBALS['what']));
+define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU(getWhat()));
 
 // Generate right-side output
-define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT($GLOBALS['what']));
+define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT(getWhat()));
 
 // Load header template
-define('__SPONSOR_HEADER', LOAD_TEMPLATE("sponsor_header", true));
+define('__SPONSOR_HEADER', LOAD_TEMPLATE('sponsor_header', true));
 
 // Load footer template
-define('__SPONSOR_FOOTER', LOAD_TEMPLATE("sponsor_footer", true));
+define('__SPONSOR_FOOTER', LOAD_TEMPLATE('sponsor_footer', true));
 
-// "You are here" navigation
-define('__SPONSOR_YOURE_HERE', ADD_DESCR('sponsor', $GLOBALS['what'], false, false));
+// 'You are here' navigation
+define('__SPONSOR_YOURE_HERE', ADD_DESCR('sponsor', getWhat(), false, false));
 
 // Load main sponsor template
-LOAD_TEMPLATE("sponsor_main");
+LOAD_TEMPLATE('sponsor_main');
 
 //
 ?>