/** * Gets the specyfied regular expression for the parameter. * * @param strign $pattern - 'integer', 'floet', 'currency', 'weight', 'item', 'string' ... * @return the regular expression */ function getPattern($pattern) { if ($pattern == "currency") { // . // - . // , // - . switch (modApiFunc('Users', 'getZone')) { case "CustomerZone": $id = modApiFunc("Localization", "getSessionDisplayCurrency"); break; default: // April 13 - deciding to turn of JS-formatting // forcing to use DEFAULT_CURRENCY_FORMAT, // as currency_id=0 does not exist $id = 0; //modApiFunc("Localization", "getMainStoreCurrency"); break; } $selected_pattern = $pattern . "_" . $id; $patterns = $this->getPatterns(); if (isset($patterns[$selected_pattern])) { $patt = $patterns[$selected_pattern]; } else { if ($patterns[$pattern]) { // . $patt = $patterns[$pattern]; } else { $patt = null; } } if ($patt !== NULL) { return array("patt_type" => "currency", "patt_value" => $patt); } else { return NULL; } } else { $patterns = Localization::getPatterns(); foreach ($patterns as $info) { if ($info['type'] == $pattern) { return $info; } } return null; } }