]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Moved doTemplateFooBar() down (to match with other include files)
[mailer.git] / inc / template-functions.php
index 8f1a88c2dc4a520cc5ce0eb3fd79eaf6336db5ca..7134e1f0f2ef68e9ff05e9271d7c37e63153ff8d 100644 (file)
@@ -82,40 +82,6 @@ function fixEmptyContentToDashes ($str) {
        return $str;
 }
 
-// Color-switch helper function
-function doTemplateColorSwitch ($template, $clear = false, $return = true) {
-       // Is it there?
-       if (!isset($GLOBALS['color_switch'][$template])) {
-               // Initialize it
-               initTemplateColorSwitch($template);
-       } elseif ($clear === false) {
-               // Switch color if called from loadTemplate()
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SWITCH:' . $template);
-               $GLOBALS['color_switch'][$template] = 3 - $GLOBALS['color_switch'][$template];
-       } // END - if
-
-       // Return CSS class name
-       if ($return === true) {
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'RETURN:' . $template . '=' . $GLOBALS['color_switch'][$template]);
-               return 'switch_sw' . $GLOBALS['color_switch'][$template];
-       } // END - if
-}
-
-// Helper function for extension registration link
-function doTemplateExtensionRegistrationLink ($template, $dummy, $ext_name) {
-       // Default is all productive
-       $OUT = '<a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&amp;what=extensions&amp;reg_ext=' . $ext_name . '%}">{--ADMIN_REGISTER_EXTENSION--}</a>';
-
-       // Is the given extension non-productive?
-       if (!isExtensionProductive($ext_name)) {
-               // Non-productive code
-               $OUT = '<em style="cursor:help" class="admin_note" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=' . $ext_name . '%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</em>';
-       } // END - if
-
-       // Return code
-       return $OUT;
-}
-
 // Init color switch
 function initTemplateColorSwitch ($template) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'INIT:' . $template);
@@ -314,9 +280,7 @@ function loadTemplate ($template, $return = false, $content = array()) {
                $basePath = sprintf("%stemplates/%s/html/", getPath(), getLanguage());
                $extraPath = detectExtraTemplatePath($template);;
 
-               ////////////////////////
-               // Generate file name //
-               ////////////////////////
+               // Generate FQFN
                $FQFN = $basePath . $extraPath . $template . '.tpl';
 
                // Does the special template exists?
@@ -1700,5 +1664,43 @@ function fixNullEmptyToDashes ($str, $num) {
        return $return;
 }
 
+//-----------------------------------------------------------------------------
+//                       Template Helper Functions
+//-----------------------------------------------------------------------------
+
+// Color-switch helper function
+function doTemplateColorSwitch ($template, $clear = false, $return = true) {
+       // Is it there?
+       if (!isset($GLOBALS['color_switch'][$template])) {
+               // Initialize it
+               initTemplateColorSwitch($template);
+       } elseif ($clear === false) {
+               // Switch color if called from loadTemplate()
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SWITCH:' . $template);
+               $GLOBALS['color_switch'][$template] = 3 - $GLOBALS['color_switch'][$template];
+       } // END - if
+
+       // Return CSS class name
+       if ($return === true) {
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'RETURN:' . $template . '=' . $GLOBALS['color_switch'][$template]);
+               return 'switch_sw' . $GLOBALS['color_switch'][$template];
+       } // END - if
+}
+
+// Helper function for extension registration link
+function doTemplateExtensionRegistrationLink ($template, $dummy, $ext_name) {
+       // Default is all productive
+       $OUT = '<a title="{--ADMIN_REGISTER_EXTENSION_TITLE--}" href="{%url=modules.php?module=admin&amp;what=extensions&amp;reg_ext=' . $ext_name . '%}">{--ADMIN_REGISTER_EXTENSION--}</a>';
+
+       // Is the given extension non-productive?
+       if (!isExtensionProductive($ext_name)) {
+               // Non-productive code
+               $OUT = '<em style="cursor:help" class="admin_note" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=' . $ext_name . '%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</em>';
+       } // END - if
+
+       // Return code
+       return $OUT;
+}
+
 // [EOF]
 ?>