More double- to single-quotes rewritten
[mailer.git] / inc / functions.php
index 8a2ad0e162084d1993b525b9b2c694a59ef05d77..12d38f394d37a61351d89f82ff7e7706e95cd0b3 100644 (file)
@@ -263,47 +263,47 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        $date_time = MAKE_DATETIME(time(), "1");
 
        // Base directory
-       $BASE = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
-       $MODE = '';
+       $basePath = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
+       $mode = '';
 
        // Check for admin/guest/member templates
        if (strpos($template, "admin_") > -1) {
                // Admin template found
-               $MODE = "admin/";
+               $mode = "admin/";
        } elseif (strpos($template, "guest_") > -1) {
                // Guest template found
-               $MODE = "guest/";
+               $mode = "guest/";
        } elseif (strpos($template, "member_") > -1) {
                // Member template found
-               $MODE = "member/";
+               $mode = "member/";
        } elseif (strpos($template, "install_") > -1) {
                // Installation template found
-               $MODE = "install/";
+               $mode = "install/";
        } elseif (strpos($template, "ext_") > -1) {
                // Extension template found
-               $MODE = "ext/";
+               $mode = "ext/";
        } elseif (strpos($template, "la_") > -1) {
                // "Logical-area" template found
-               $MODE = "la/";
+               $mode = "la/";
        } else {
                // Test for extension
                $test = substr($template, 0, strpos($template, "_"));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
-                       $MODE = $test."/";
+                       $mode = $test."/";
                }
        }
 
        ////////////////////////
        // Generate file name //
        ////////////////////////
-       $FQFN = $BASE.$MODE.$template.".tpl";
+       $FQFN = $basePath.$mode.$template.".tpl";
 
-       if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($MODE == "guest/") || ($MODE == "member/") || ($MODE == "admin/"))) {
+       if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($mode == "guest/") || ($mode == "member/") || ($mode == "admin/"))) {
                // Select what depended header/footer template file for admin/guest/member area
                $file2 = sprintf("%s%s%s_%s.tpl",
-                       $BASE,
-                       $MODE,
+                       $basePath,
+                       $mode,
                        $template,
                        SQL_ESCAPE($GLOBALS['what'])
                );
@@ -318,7 +318,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        // Does the special template exists?
        if (!FILE_READABLE($FQFN)) {
                // Reset to default template
-               $FQFN = $BASE.$template.".tpl";
+               $FQFN = $basePath.$template.".tpl";
        } // END - if
 
        // Now does the final template exists?
@@ -819,34 +819,34 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        $DATA['email'] = $email;
 
        // Base directory
-       $BASE = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
+       $basePath = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
 
        // Check for admin/guest/member templates
        if (strpos($template, "admin_") > -1) {
                // Admin template found
-               $FQFN = $BASE."admin/".$template.".tpl";
+               $FQFN = $basePath."admin/".$template.".tpl";
        } elseif (strpos($template, "guest_") > -1) {
                // Guest template found
-               $FQFN = $BASE."guest/".$template.".tpl";
+               $FQFN = $basePath."guest/".$template.".tpl";
        } elseif (strpos($template, "member_") > -1) {
                // Member template found
-               $FQFN = $BASE."member/".$template.".tpl";
+               $FQFN = $basePath."member/".$template.".tpl";
        } else {
                // Test for extension
                $test = substr($template, 0, strpos($template, "_"));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
-                       $FQFN = $BASE.$test."/".$template.".tpl";
+                       $FQFN = $basePath.$test."/".$template.".tpl";
                } else {
                        // No special filename
-                       $FQFN = $BASE.$template.".tpl";
+                       $FQFN = $basePath.$template.".tpl";
                }
        }
 
        // Does the special template exists?
        if (!FILE_READABLE($FQFN)) {
                // Reset to default template
-               $FQFN = $BASE.$template.".tpl";
+               $FQFN = $basePath.$template.".tpl";
        } // END - if
 
        // Now does the final template exists?