Promotion Backend v1
This commit is contained in:
parent
0ed47d3553
commit
f0da981737
43 changed files with 2765 additions and 45 deletions
|
|
@ -66,6 +66,10 @@ class Util
|
|||
return number_format($value, $dec, ',', '.');
|
||||
}
|
||||
|
||||
public static function formatPlural($count, $singular, $plural){
|
||||
return ($count === 1) ? $singular : $singular.$plural;
|
||||
}
|
||||
|
||||
public static function utf8ize( $mixed ) {
|
||||
if (is_array($mixed)) {
|
||||
foreach ($mixed as $key => $value) {
|
||||
|
|
@ -218,15 +222,27 @@ class Util
|
|||
}
|
||||
return url($uri);
|
||||
}
|
||||
public static function sanitize($string, $force_lowercase = true, $anal = false, $substr = false)
|
||||
public static function sanitize($string, $force_lowercase = true, $anal = false, $substr = false, $anCon = false)
|
||||
{
|
||||
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
|
||||
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "=", "+", "[", "{", "]",
|
||||
"}", "\\", "|", ";", ":", "\"", "'", "‘", "’", "“", "”", "–", "—",
|
||||
"—", "–", ",", "<", ".", ">", "/", "?");
|
||||
$clean = trim(str_replace($strip, "", strip_tags($string)));
|
||||
$clean = preg_replace('/\s+/', "_", $clean);
|
||||
$clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ;
|
||||
$clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean;
|
||||
|
||||
if($anCon){
|
||||
$ers = array(
|
||||
'Ä' => 'Ae',
|
||||
'Ö' => 'Oe',
|
||||
'Ü' => 'Ue',
|
||||
'ä' => 'ae',
|
||||
'ö' => 'oe',
|
||||
'ü' => 'ue',
|
||||
'ß' => 'ss'
|
||||
);
|
||||
$clean = strtr($clean,$ers);
|
||||
}
|
||||
if($substr){
|
||||
$clean = (strlen($clean) > 20) ? substr($clean,-20) : $clean;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue