// OPPOMENT: convertCommaToDot()
function translateComma ($dotted, $cut = TRUE, $max = '0') {
// First, cast all to double, due to PHP changes
- $dotted = (double) $dotted;
-
- // Default is 3 you can change this in admin area "Settings -> Misc Options"
- if (!isConfigEntrySet('max_comma')) {
- setConfigEntry('max_comma', 3);
- } // END - if
+ $double = (double) $dotted;
// Use from config is default
$maxComma = getConfig('max_comma');
// Cut zeros off?
if (($cut === TRUE) && ($max == '0')) {
// Test for commata if in cut-mode
- $com = explode('.', $dotted);
+ $com = explode('.', $double);
if (count($com) < 2) {
// Don't display commatas even if there are none... ;-)
$maxComma = '0';
// Debug log
// Translate it now
- $translated = $dotted;
+ $translated = $double;
switch (getLanguage()) {
case 'de': // German language
- $translated = number_format($dotted, $maxComma, ',', '.');
+ $translated = number_format($double, $maxComma, ',', '.');
break;
default: // All others
- $translated = number_format($dotted, $maxComma, '.', ',');
+ $translated = number_format($double, $maxComma, '.', ',');
break;
} // END - switch
// Return translated value
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'dotted=' . $dotted . ',translated=' . $translated . ',maxComma=' . $maxComma);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'double=' . $double . ',translated=' . $translated . ',maxComma=' . $maxComma);
return $translated;
}
// "Translates" 'visible' and 'locked' to a CSS class
function translateMenuVisibleLocked ($content, $prefix = '') {
+ // 1st parameter should be an array
+ assert(is_array($content));
+
// Default is 'menu_unknown'
$content['visible_css'] = $prefix . 'menu_unknown';
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'url=' . $url . ',hash=' . $hash . '(' . strlen($hash) . ')');
// De-refer this URL
- $url = '{%url=modules.php?module=loader&url=' . $encodedUrl . '&hash=' . encodeHashForCookie($hash) . '&salt=' . substr($hash, 0, getSaltLength()) . '%}';
+ $url = sprintf(
+ '{%%url=modules.php?module=loader&url=%s&hash=%s&salt=%s%%}',
+ $encodedUrl,
+ encodeHashForCookie($hash),
+ substr($hash, 0, getSaltLength())
+ );
} // END - if
// Return link
$ret = '0';
// Count all entries
- foreach ($array as $key => $selected) {
+ foreach ($array as $selected) {
// Is it checked?
if (!empty($selected)) {
// Yes, then count it
}
// Redirects to an URL and if neccessarry extends it with own base URL
+// @TODO $allowSpider is unused
function redirectToUrl ($url, $allowSpider = TRUE, $compileCode = TRUE) {
// Is the output mode -2?
if (isAjaxOutputMode()) {
if ($match) {
// We have found two different values, so let's sort whole array
foreach ($temporaryArray as $sort_key => $sort_val) {
- $t = $temporaryArray[$sort_key][$key];
+ $t = $temporaryArray[$sort_key][$key];
$temporaryArray[$sort_key][$key] = $temporaryArray[$sort_key][$key2];
$temporaryArray[$sort_key][$key2] = $t;
unset($t);