]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
First batch of removal of the headers needed for revision-functions.php
[mailer.git] / inc / template-functions.php
index 4ec0827401bd3a5afe38f0b56b91486e372d27e5..cc04cdeb79295e04e23299d09355ec1017ca5c49 100644 (file)
@@ -1931,10 +1931,12 @@ function generateCacheFqfn ($prefix, $template) {
        if (!isset($GLOBALS['template_cache_fqfn'][$prefix][$template])) {
                // Generate the FQFN
                $GLOBALS['template_cache_fqfn'][$prefix][$template] = sprintf(
-                       '%s_compiled/%s/%s.tpl.cache',
+                       '%s%s_compiled/%s/%s%s',
+                       getPath(),
                        getCachePath(),
                        $prefix,
-                       $template
+                       $template,
+                       getCacheExtension()
                );
        } // END - if
 
@@ -1982,15 +1984,27 @@ function translateTimeUnit ($unit) {
 }
 
 // Displays given message in admin_settings_saved template
-function displayMessage ($message, $return = FALSE) {
+function displayMessage ($message) {
+       // Call inner function
+       outputHtml(returnMessage($message));
+}
+
+// Returns given message in admin_settings_saved template
+function returnMessage ($message) {
+       // Load the template
+       return loadTemplate('admin_settings_saved', TRUE, $message);
+}
+
+// Displays given error message in admin_settings_unsaved template
+function displayErrorMessage ($message) {
        // Load the template
-       return loadTemplate('admin_settings_saved', $return, $message);
+       outputHtml(returnErrorMessage($message));
 }
 
-// Displays given error message in admin_settings_saved template
-function displayErrorMessage ($message, $return = FALSE) {
+// Displays given error message in admin_settings_unsaved template
+function returnErrorMessage ($message) {
        // Load the template
-       return loadTemplate('admin_settings_unsaved', $return, $message);
+       return loadTemplate('admin_settings_unsaved', TRUE, $message);
 }
 
 // Generates a selection box for (maybe) given gender
@@ -2387,6 +2401,21 @@ function doTemplateMetaFavIcon ($templateName, $clear = FALSE) {
        return $out;
 }
 
+// Helper function to display referral id or hide it depending on settings
+function doTemplateDisplayReferralIdContent ($template, $clear = FALSE) {
+       // Ddisplay the refid or make it editable?
+       if (isDisplayRefidEnabled()) {
+               // Load "hide" form template
+               $out = loadTemplate('guest_register_refid_hide', TRUE);
+       } else {
+               // Load template to enter it
+               $out = loadTemplate('guest_register_refid', TRUE);
+       }
+
+       // Return code
+       return $out;
+}
+
 // "Getter" for template base path
 function getTemplateBasePath ($part) {
        // Is there cache?
@@ -2421,5 +2450,22 @@ function removeDeprecatedComment ($output) {
        return $return;
 }
 
+// Generates a selection box suitable for e.g. birthdays: day, month and year
+function generateDayMonthYearSelectionBox ($day, $month, $year) {
+       // This depends on selected language
+       switch (getLanguage()) {
+               case 'de': // German date format
+                       $content = addSelectionBox('da', $day) . addSelectionBox('mo', $month) . addSelectionBox('ye', $year);
+                       break;
+
+               default: // Default is the US date format... :)
+                       $content = addSelectionBox('mo', $month) . addSelectionBox('da', $day) . addSelectionBox('ye', $year);
+                       break;
+       } // END - switch
+
+       // Return content
+       return $content;
+}
+
 // [EOF]
 ?>