Added patch_core.sh to all 'cored' PHP projects to ease patching of the 'core' project
[mailer.git] / inc / template-functions.php
index b2f6b1fa00a7b14a21f2971e85cd3ecfde1197b8..aff7a024c3568b76ef1b0206dedcd605f1129095 100644 (file)
@@ -331,7 +331,7 @@ function loadTemplate ($template, $return = false, $content = array(), $compileC
        (' . $template . ')
 </div>
 <div class="para">
-       {--TEMPLATE_CONTENT--}
+       {--TEMPLATE_CONTENT--}:
        <pre>' . print_r($content, true) . '</pre>
 </div>';
                } else {
@@ -490,9 +490,9 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
        {--TEMPLATE_404--}: ' . $template . '
 </div>
 <div class="para">
-       {--TEMPLATE_CONTENT--}
+       {--TEMPLATE_CONTENT--}:
        <pre>' . print_r($content, true) . '</pre>
-       {--TEMPLATE_DATA--}
+       {--TEMPLATE_DATA--}:
        <pre>' . print_r($DATA, true) . '</pre>
 </div>';
 
@@ -543,8 +543,8 @@ function getMenuCssClasses ($data) {
 }
 
 // Generate XHTML code for the CAPTCHA
-function generateCaptchaCode ($code, $type, $DATA, $userid) {
-       return '<img border="0" alt="Code ' . $code . '" src="{%url=mailid_top.php?userid=' . $userid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '%}" />';
+function generateCaptchaCode ($code, $type, $type, $userid) {
+       return '<img border="0" alt="Code ' . $code . '" src="{%url=mailid_top.php?userid=' . $userid . '&amp;' . $type . '=' . $type . '&amp;mode=img&amp;code=' . $code . '%}" />';
 }
 
 // Compiles the given HTML/mail code
@@ -841,7 +841,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
        $M2 = getMonth(time() + $timestamp);
 
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
-       if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02'))  $SWITCH = getOneDay();
+       if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02'))  {
+               $SWITCH = getOneDay();
+       } // END - switch
 
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
@@ -1586,7 +1588,7 @@ function sendModeMails ($mod, $modes) {
        }
 
        // Load template
-       loadTemplate('admin_settings_saved', false, $content['message']);
+       displayMessage($content['message']);
 }
 
 // Generates a 'selection box' from given array
@@ -1703,6 +1705,12 @@ function translatePoolType ($type) {
        return sprintf("{--POOL_TYPE_%s--}", strtoupper($type));
 }
 
+// Displays given message in admin_settings_saved template
+function displayMessage ($message, $return = false) {
+       // Load the template
+       return loadTemplate('admin_settings_saved', $return, $message);
+}
+
 //-----------------------------------------------------------------------------
 //                      Template helper functions for EL
 //-----------------------------------------------------------------------------