]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Removed 'notice' CSS class from listing tasks
[mailer.git] / inc / template-functions.php
index 62fecd0386f86a5c54187892e77648dfd6a00e7a..78e58e0790efc9f741a0479e5edc5be55e0ee847 100644 (file)
@@ -110,23 +110,32 @@ function outputHtml ($htmlCode, $newLine = true) {
                                        outputRawCode($htmlCode);
 
                                        // That's why you don't need any \n at the end of your HTML code... :-)
-                                       if ($newLine === true) print("\n");
+                                       if ($newLine === true) {
+                                               print("\n");
+                                       } // END - if
                                } else {
                                        // Render mode for old or lame servers...
                                        $GLOBALS['output'] .= $htmlCode;
 
                                        // That's why you don't need any \n at the end of your HTML code... :-)
-                                       if ($newLine === true) $GLOBALS['output'] .= "\n";
+                                       if ($newLine === true) {
+                                               $GLOBALS['output'] .= "\n";
+                                       } // END - if
                                }
                                break;
 
                        case 'direct':
                                // If we are switching from render to direct output rendered code
-                               if ((!empty($GLOBALS['output'])) && (getPhpCaching() != 'on')) { outputRawCode($GLOBALS['output']); $GLOBALS['output'] = ''; }
+                               if ((!empty($GLOBALS['output'])) && (getPhpCaching() != 'on')) {
+                                       outputRawCode($GLOBALS['output']);
+                                       $GLOBALS['output'] = '';
+                               } // END - if
 
                                // The same as above... ^
                                outputRawCode($htmlCode);
-                               if ($newLine === true) print("\n");
+                               if ($newLine === true) {
+                                       print("\n");
+                               } // END - if
                                break;
 
                        default:
@@ -323,7 +332,7 @@ function loadTemplate ($template, $return = false, $content = array(), $compileC
                                        // Prepare eval() command
                                        $GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($ret), false, true, true, $compileCode) . '";';
                                } elseif (substr($template, 0, 3) == 'js_') {
-                                       // JavaScripts don't like entities and timings
+                                       // JavaScripts don't like entities, dollar signs and timings
                                        $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
                                } else {
                                        // Prepare eval() command, other output doesn't like entities, maybe
@@ -340,7 +349,7 @@ function loadTemplate ($template, $return = false, $content = array(), $compileC
                } elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
                        // Only admins shall see this warning or when installation mode is active
                        $ret = '<div class="para">
-       <span class="notice">{--TEMPLATE_404--}</span>
+       <span class="bad">{--TEMPLATE_404--}</span>
 </div>
 <div class="para">
        (' . $template . ')
@@ -1603,16 +1612,16 @@ function sendModeMails ($mod, $modes) {
 
                                default: // Unsupported module!
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
-                                       $content['message'] = '<span class="notice">{--UNKNOWN_MODULE--}</span>';
+                                       $content['message'] = '<span class="bad">{--UNKNOWN_MODULE--}</span>';
                                        break;
                        } // END - switch
                } else {
                        // Passwords mismatch
-                       $content['message'] = '<span class="notice">{--MEMBER_PASSWORD_ERROR--}</span>';
+                       $content['message'] = '<span class="bad">{--MEMBER_PASSWORD_ERROR--}</span>';
                }
        } else {
                // Could not load profile
-               $content['message'] = '<span class="notice">{--MEMBER_CANNOT_LOAD_PROFILE--}</span>';
+               $content['message'] = '<span class="bad">{--MEMBER_CANNOT_LOAD_PROFILE--}</span>';
        }
 
        // Send email to user if required
@@ -1638,7 +1647,7 @@ function sendModeMails ($mod, $modes) {
 }
 
 // Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
+function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '', $templateName = '') {
        // Start the output
        $OUT = '<select name="' . $name . '" size="1" class="form_select">
 <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
@@ -1647,8 +1656,14 @@ function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionCo
        foreach ($options as $option) {
                // Add the <option> entry from ...
                if (empty($optionContent)) {
-                       // ... template
-                       $OUT .= loadTemplate('select_' . $name . $extraName . '_option', true, $option);
+                       // Is a template name given?
+                       if (empty($templateName)) {
+                               // ... $name template
+                               $OUT .= loadTemplate('select_' . $name . $extraName . '_option', true, $option);
+                       } else {
+                               // ... $templateName template
+                               $OUT .= loadTemplate('select_' . $templateName . $extraName . '_option', true, $option);
+                       }
                } else {
                        // ... direct HTML code
                        $OUT .= '<option value="' . $option[$optionValue] . '">' . $option[$optionContent] . '</option>';
@@ -1664,7 +1679,13 @@ function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionCo
        );
 
        // Load template and return it
-       return loadTemplate('select_' . $name . $extraName . '_box', true, $content);
+       if (empty($templateName)) {
+               // Use name from $name + $extraName
+               return loadTemplate('select_' . $name . $extraName . '_box', true, $content);
+       } else {
+               // Use name from $templateName + $extraName
+               return loadTemplate('select_' . $templateName . $extraName . '_box', true, $content);
+       }
 }
 
 // Prepares the header for HTML output
@@ -1709,8 +1730,8 @@ function generateMetaDescriptionCode () {
                $GLOBALS['page_header'] .= '<meta name="description" content="' . $DESCR . '" />';
        } // END - if
 
-       // Initialize referal system
-       initReferalSystem();
+       // Initialize referral system
+       initReferralSystem();
 }
 
 // Generates an FQFN for template cache from the given template name
@@ -1798,7 +1819,7 @@ function doTemplateColorSwitch ($template, $clear = false, $return = true) {
 // Helper function for extension registration link
 function doTemplateExtensionRegistrationLink ($template, $clear, $ext_name) {
        // Default is all non-productive
-       $OUT = '<em style="cursor:help" class="notice" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=' . $ext_name . '%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</em>';
+       $OUT = '<div style="cursor:help" title="{%message,ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK_TITLE=' . $ext_name . '%}">{--ADMIN_EXTENSION_IS_NON_PRODUCTIVE_LINK--}</div>';
 
        // Is the given extension non-productive?
        if (isExtensionProductive($ext_name)) {
@@ -1825,7 +1846,7 @@ function doTemplateAdminMemberMailLinks ($template, $clear, $mailId) {
 // Helper function to create a selection box for YES/NO configuration entries
 function doTemplateConfigurationYesNoSelectionBox ($template, $clear, $configEntry) {
        // Default is a "missing entry" warning
-       $OUT = '<em style="cursor:help" class="notice" title="{%message,ADMIN_CONFIG_ENTRY_MISSING=' . $configEntry . '%}">!' . $configEntry . '!</em>';
+       $OUT = '<div class="bad" style="cursor:help" title="{%message,ADMIN_CONFIG_ENTRY_MISSING=' . $configEntry . '%}">!' . $configEntry . '!</div>';
 
        // Generate the HTML code
        if (isConfigEntrySet($configEntry)) {