}
// Init returned content
- $ret = '';
+ $templateContent = '';
// Set current template
$GLOBALS['current_template'] = $template;
case 'ho': // Hours
for ($idx = 0; $idx <= 23; $idx++) {
- $padded = padLeftZero($idx);
+ $padded = padLeftZero($idx, 2);
$OUT .= '<option value="' . $padded . '"';
if ($default == $padded) $OUT .= ' selected="selected"';
$OUT .= '>' . $padded . '</option>';
case 'mi': // Minutes
case 'se': // Seconds
for ($idx = 0; $idx <= 59; $idx+=5) {
- $padded = padLeftZero($idx);
+ $padded = padLeftZero($idx, 2);
$OUT .= '<option value="' . $padded . '"';
if ($default == $padded) $OUT .= ' selected="selected"';
$OUT .= '>' . $padded . '</option>';
break;
default: // Should not happen!
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid state of extension %s detected.", $ext_name));
- $message = sprintf("Invalid state of extension %s detected.", $ext_name);
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Invalid state of extension %s detected.', $ext_name));
+ $message = sprintf('Invalid state of extension %s detected.', $ext_name);
break;
} // END - switch
break;
case 'password': // Password was changed
- $content['message'] = '{--MEMBER_CHANGED_PASS--}' . PHP_EOL;
+ $content['message'] = '{--MEMBER_CHANGED_PASSWORD--}' . PHP_EOL;
break;
default:
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown mode %s detected.", $mode));
- $content['message'] = '{--MEMBER_UNKNOWN_MODE--}' . ': ' . $mode . PHP_EOL . PHP_EOL;
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unknown mode %s detected.', $mode));
+ $content['message'] = '{%message,MEMBER_UNKNOWN_MODE=' . $mode . '%}' . PHP_EOL . PHP_EOL;
break;
} // END - switch
} // END - foreach
if (isAdminNotificationEnabled()) {
// The admin needs to be notified about a profile change
$message_admin = 'admin_mydata_notify';
- $sub_adm = '{--ADMIN_CHANGED_DATA--}';
+ $subjectAdmin = '{--ADMIN_CHANGED_DATA_SUBJECT--}';
} else {
// No mail to admin
$message_admin = '';
- $sub_adm = '';
+ $subjectAdmin = '';
}
// Set subject lines
- $sub_mem = '{--MEMBER_CHANGED_DATA--}';
+ $subjectMember = '{--MEMBER_CHANGED_DATA--}';
// Output success message
$content['message'] = '<span class="message">{--MEMBER_MYDATA_MAIL_SENT--}</span>';
break;
default: // Unsupported module!
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
- $content['message'] = '<span class="bad">{--UNKNOWN_MODULE--}</span>';
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unsupported module %s detected.', $mod));
+ $content['message'] = '<span class="bad">{%message,UNKNOWN_MODULE=' . $mod . '%}</span>';
break;
} // END - switch
} else {
}
// Send email to user if required
- if ((!empty($sub_mem)) && (!empty($message)) && (!empty($content['userid']))) {
+ if ((!empty($subjectMember)) && (!empty($message)) && (!empty($content['userid']))) {
// Send member mail
- sendEmail($content['userid'], $sub_mem, $message);
+ sendEmail($content['userid'], $subjectMember, $message);
} // END - if
// Send only if no other error has occured
- if ((!empty($sub_adm)) && (!empty($message_admin)) && (isAdminNotificationEnabled())) {
+ if ((!empty($subjectAdmin)) && (!empty($message_admin)) && (isAdminNotificationEnabled())) {
// Send admin mail
- sendAdminNotification($sub_adm, $message_admin, $content, getMemberId());
+ sendAdminNotification($subjectAdmin, $message_admin, $content, getMemberId());
} elseif (isAdminNotificationEnabled()) {
// Cannot send mails to admin!
$content['message'] = '{--CANNOT_SEND_ADMIN_MAILS--}';
// Generates a 'selection box' from given array
function generateSelectionBoxFromArray ($options, $name, $optionKey, $optionContent = '', $extraName = '', $templateName = '', $default = NULL, $nameElement = '', $allowNone = FALSE, $useDefaultAsArray = FALSE) {
+ // options must be an array
+ assert(is_array($options));
+
// Default is empty
$addKey = '';
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
}
// 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', $return, $message);
+ return loadTemplate('admin_settings_saved', TRUE, $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 displayErrorMessage ($message) {
// Load the template
- return loadTemplate('admin_settings_unsaved', $return, $message);
+ outputHtml(returnErrorMessage($message));
+}
+
+// Displays given error message in admin_settings_unsaved template
+function returnErrorMessage ($message) {
+ // Load the template
+ return loadTemplate('admin_settings_unsaved', TRUE, $message);
}
// Generates a selection box for (maybe) given gender
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;
+}
+
// [EOF]
?>