+// 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?
+ if (!isset($GLOBALS[__FUNCTION__][$part])) {
+ // "Build" path
+ $GLOBALS[__FUNCTION__][$part] = sprintf('%stemplates/%s/%s', getPath(), getLanguage(), $part);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$part];
+}
+
+// Removes comments with @DEPRECATED
+function removeDeprecatedComment ($output) {
+ // Explode it into pieces ... ;)
+ $lines = explode(chr(10), $output);
+
+ // Walk through all
+ $return = '';
+ foreach ($lines as $line) {
+ // Is there a @DEPRECATED?
+ if (isInString('@DEPRECATED', $line)) {
+ // Ignore this line
+ continue;
+ } // END - if
+
+ // Add it
+ $return .= $line . chr(13);
+ } // END - foreach
+
+ // Returned cleaned content
+ 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;
+}
+
+// Loads page header
+function loadPageHeader () {
+ // Init header
+ $GLOBALS['__page_header'] = '';
+
+ // Is the header already sent?
+ if (($GLOBALS['__header_sent'] != 1) && ($GLOBALS['__header_sent'] != 2)) {
+ // Set default HTTP status to "200 OK"
+ setHttpStatus('200 OK');
+
+ // If not in CSS mode generate the header
+ if ((!isCssOutputMode()) && (!isAjaxOutputMode()) && (!isImageOutputMode())) {
+ // Prepare the header for HTML output
+ loadHtmlHeader();
+ } // END - if
+
+ // Closing HEAD tag
+ if ($GLOBALS['__header_sent'] == '0') {
+ $GLOBALS['__header_sent'] = 1;
+ } // END - if
+ } // END - if
+
+ // Add BODY tag or not?
+ // @TODO Find a way to not use direct module comparison
+ if ((!isCssOutputMode()) && (!isRawOutputMode()) && ($GLOBALS['__header_sent'] == 1) && (getModule() != 'frametester') && (!isFramesetModeEnabled())) {
+ loadTemplate('page_body');
+ $GLOBALS['__header_sent'] = 2;
+ } // END - if
+}
+
+// Loads page footer and calls doShutdown()
+function loadPageFooter () {
+ // Init page footer
+ $GLOBALS['__page_footer'] = '';
+
+ // Footer disabled (e.g. CSS/AJAX/image output) or already sent?
+ // 1234 5 54 45 5 5 543 3 443 3 443 3 44321
+ if ((((!isset($GLOBALS['__footer_sent'])) || (($GLOBALS['__footer_sent'] != 1) && ($GLOBALS['__footer_sent'] != 2))) && (!isCssOutputMode()) && (!isAjaxOutputMode()) && (!isImageOutputMode()))) {
+ // Run the filter, sweet huh?
+ runFilterChain('page_footer');
+
+ // Load page footer
+ $GLOBALS['__page_footer'] .= loadTemplate('page_footer', TRUE);
+ } // END - if
+
+ // Footer has been reached
+ $GLOBALS['__footer_sent'] = 1;
+
+ // Shutdown
+ doShutdown();
+}
+