/** * prepare.php * * @author Louis SAUNDERS * @copyright 2009-2010 Deuxeos - All rights reserved */ /********************************************************************************************************/ /************* Variables *************/ /********************************************************************************************************/ var hager_gmap_key = "ABQIAAAA1IgTV3TBx4rvp_GlR2Dj0BSCWMgyJG89gfXXS39JTLbJ7-ozfxRsDbvqm54E2Tr_V_CdH5XqFjJ4GA"; var directory_item_per_page = 10; var dir_script = "/skin/js/"; var imageOK_src = "/skin/img/pics/ok.gif"; var imageKO_src = "/skin/img/pics/ko.gif"; _editor_url = "/skin/js/xinha/"; _editor_lang = "en"; var root_url = "http://www.your-electrician.com/"; /********************************************************************************************************/ /************* en_UK VALIDATIONS *************/ /********************************************************************************************************/ var en_UK = new Array(); en_UK["format_date"] = "dmy"; en_UK["format_time"] = "24"; en_UK["dashboard_date"] = "d/m/Y"; en_UK["regex_money"] = /^[0-9 ]+([,]{1}[0-9]+)?$/; en_UK["regex_zipcode"] = /^[A-Z][A-Z0-9]{1,3}[ ][0-9][A-Z]{2}$/; en_UK["regex_date"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/; en_UK["regex_fax"] = /^(.*)$/; en_UK["regex_phone"] = /^(.*)$/; en_UK["regex_datetime"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/; en_UK["regex_mobile"] = /^(.*)$/; /********************************************************************************************************/ /************* en_UK TEXTS *************/ /********************************************************************************************************/ en_UK["isDate"] = "Invalid date. Example: 23/10/2007"; en_UK["isMoney"] = "Must be a valid amount. Example: 1 234,56"; en_UK["isFAX"] = "Invalid FAX number. Example: -"; en_UK["isZipCode"] = "Invalid Postcode. Example: {TF1 7FT}"; en_UK["isPhone"] = "Invalid phone number. Example: -"; en_UK["isDateTime"] = "Invalid date time format. Example: 23/10/2007 14:52:10"; en_UK["isMobilePhone"] = "Invalid mobile phone number. Example: -"; /********************************************************************************************************/ /************* TEXTS *************/ /********************************************************************************************************/ var common = new Array(); common["dashboard_date"] = "d/m/Y"; common["isLanguageCode"] = "Invalid code. Example: en_UK"; common["isEqualLength"] = "Length must be of {0} characters"; common["isMaxLength"] = "Length can't be more than {0} characters"; common["isMinLength"] = "Length can't be less than {0} characters"; common["isLengthBetween"] = "Length must be between {0} and {1} characters"; common["isMaxValue"] = "Value can't be more than {0}"; common["isMinValue"] = "Value can't be less than {0}"; common["isValueBetween"] = "Value must be between {0} and {1}"; common["isDateDay"] = "Invalid day"; common["isDateMonth"] = "Invalid month"; common["isDateYear"] = "Invalid year"; common["isYear"] = "The year must be valid and be between 1901 and 2155"; common["isInteger"] = "Must be an integer. Example: 1200 ou -213"; common["isDouble"] = "Must be unique. Example: 12.24 or 23,51"; common["isAlpha"] = "Must be alphabetical"; common["isAlNum"] = "Must be alphanumeric"; common["isInsee"] = "Invalid INSEE number. Example: 1 85 34 33 354 450 45"; common["isApe"] = "Invalid APE number. Example: 25.4Z"; common["isSiret"] = "Invalid Companies House number."; common["isSiren"] = "Invalid Companies House number."; common["isTVA"] = "Invalid VAT number."; common["isEmail"] = "Invalid e-Mail address. Example: john.doe@domain.com"; common["isRootURL"] = "Invalid root URL. Example: http://www.domain.com"; common["isURL"] = "Invalid URL. Example: http://www.domain.com/company/news/"; common["isExtension"] = "Invalid file extension. Example: C:myFile.{0}"; common["areExtensions"] = "Invalid file extension ({0})"; common["isDateBefore"] = "Date must be before {0}"; common["isDateAfter"] = "Date must be after {0}"; common["isDateBetween"] = "Date must be between {0} and {1}"; common["isRadioChecked"] = "You must select a value"; common["isCollectionChecked"] = "You must select at least one item"; common["isMaxCollectionChecked"] = "You can't select more than {0} items"; common["isCollectionCheckedBetween"] = "The number of selected items must be between {0} and {1}"; common["isGroupSelected"] = "You must select at least one item"; common["isMaxGroupSelected"] = "You can't select more than {0} items"; common["isGroupSelectedBetween"] = "The number of selected items must be between {0} and {1}"; common["isDateTimeDay"] = "Invalid day"; common["isDateTimeMonth"] = "Invalid month"; common["isDateTimeYear"] = "Invalid year"; common["isDateTimeHour"] = "Invalid hour"; common["isDateTimeMinute"] = "Invalid minute"; common["isDateTimeSecond"] = "Invalid second"; common["isRewrittenURL"] = "Invalid URL."; common["No"] = "No"; common["Ok"] = "OK"; common["Yes"] = "Yes"; common["deleteItem"] = "JS_DELETEITEM"; common["deleteItems"] = "JS_DELETEITEMS"; common["validateForm"] = "Invalid fields. Please check the form."; common["incompleteForm"] = "Some fields were not completed. Please check the form."; common["emptySelection"] = "JS_EMPTYSELECTION"; common["format_validation"] = "Field validation"; common["validateFormTitle"] = "Error !"; /********************************************************************************************************/ /************* FUNCTIONS *************/ /********************************************************************************************************/ /** * Gets the string associated with the key * * @param lang * @param key */ function getCommonString(key) { try { var ret = common[key]; if (ret === undefined) ret = key; return ret; } catch (ex) {} return key; } /** * Gets the localized string associated with the key * * @param key */ function getLocalizedString(lang, key) { if (lang == "common") return getCommonString(key); try { var ret = eval(lang + "['" + key + "']"); if (ret === undefined) ret = key; return ret; } catch (ex) {} return key; }