mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Misc
* added option to 'verbose' concatenate a list of items to class Lang * added option to strip tags from a string to class Markdown * fixed several instances of wrong categories on pages * actually display world state conditions for zone music * some typos all over the place
This commit is contained in:
@@ -90,6 +90,29 @@ class Lang
|
||||
return self::vspf($var, $vspfArgs);
|
||||
}
|
||||
|
||||
public static function concat($args, $useAnd = true, $callback = null)
|
||||
{
|
||||
$b = '';
|
||||
$i = 0;
|
||||
$n = count($args);
|
||||
foreach ($args as $k => $arg)
|
||||
{
|
||||
if (is_callable($callback))
|
||||
$b .= $callback($arg, $k);
|
||||
else
|
||||
$b .= $arg;
|
||||
|
||||
if ($n > 1 && $i < ($n - 2))
|
||||
$b .= ', ';
|
||||
else if ($n > 1 && $i == $n - 2)
|
||||
$b .= Lang::main($useAnd ? 'and' : 'or');
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $b;
|
||||
}
|
||||
|
||||
public static function sort($prop, $group, $method = SORT_NATURAL)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user