View Order
This commit is contained in:
@ -19,55 +19,63 @@ class Lang
|
||||
public static function moneyFormat($var)
|
||||
{
|
||||
global $config;
|
||||
return $config['currency_code'] . ' ' .number_format($var, 0, $config['dec_point'], $config['thousands_sep']);
|
||||
return $config['currency_code'] . ' ' . number_format($var, 0, $config['dec_point'], $config['thousands_sep']);
|
||||
}
|
||||
|
||||
public static function phoneFormat($phone)
|
||||
{
|
||||
global $config;
|
||||
if(Validator::UnsignedNumber($phone) && !empty($config['country_code_phone'])){
|
||||
if (Validator::UnsignedNumber($phone) && !empty($config['country_code_phone'])) {
|
||||
return preg_replace('/^0/', $config['country_code_phone'], $phone);
|
||||
}else{
|
||||
} else {
|
||||
return $phone;
|
||||
}
|
||||
}
|
||||
|
||||
public static function dateFormat($date){
|
||||
public static function dateFormat($date)
|
||||
{
|
||||
global $config;
|
||||
return date($config['date_format'], strtotime($date));
|
||||
}
|
||||
|
||||
public static function dateTimeFormat($date){
|
||||
public static function dateTimeFormat($date)
|
||||
{
|
||||
global $config;
|
||||
if(strtotime($date) < strtotime("2000-01-01 00:00:00")){
|
||||
if (strtotime($date) < strtotime("2000-01-01 00:00:00")) {
|
||||
return "";
|
||||
}else{
|
||||
return date($config['date_format']. ' H:i', strtotime($date));
|
||||
} else {
|
||||
return date($config['date_format'] . ' H:i', strtotime($date));
|
||||
}
|
||||
}
|
||||
|
||||
public static function dateAndTimeFormat($date, $time){
|
||||
public static function dateAndTimeFormat($date, $time)
|
||||
{
|
||||
global $config;
|
||||
return date($config['date_format']. ' H:i', strtotime("$date $time"));
|
||||
return date($config['date_format'] . ' H:i', strtotime("$date $time"));
|
||||
}
|
||||
|
||||
public static function nl2br($text){
|
||||
public static function nl2br($text)
|
||||
{
|
||||
return nl2br($text);
|
||||
}
|
||||
|
||||
public static function arrayCount($arr){
|
||||
if(is_array($arr)){
|
||||
public static function arrayCount($arr)
|
||||
{
|
||||
if (is_array($arr)) {
|
||||
return count($arr);
|
||||
}else{
|
||||
} else if (is_object($arr)) {
|
||||
return count($arr);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getNotifText($key){
|
||||
public static function getNotifText($key)
|
||||
{
|
||||
global $_notifmsg, $_notifmsg_default;
|
||||
if(isset($_notifmsg[$key])){
|
||||
if (isset($_notifmsg[$key])) {
|
||||
return $_notifmsg[$key];
|
||||
}else{
|
||||
} else {
|
||||
return $_notifmsg_default[$key];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user