mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Templates/Listviews
* removed most templates by sensibly restructuring lvTab-data. Util::toJSON() does the rest. * taught Util::toJSON() to recognize values prefixed with $ as js-code * use Util::toJSON whenever possible * misc - mail attachments are displyed again - always show all currency rewards on Quest-LVs - suppress an error, when encountering unused ItemMods
This commit is contained in:
@@ -1576,10 +1576,13 @@ class Util
|
||||
if (CFG_DEBUG)
|
||||
$flags |= JSON_PRETTY_PRINT;
|
||||
|
||||
// just a thought: .. about prefixing variables with $ to mark them as function code and retroactively stripping escapes from them
|
||||
// like it's done already in with listviews for example
|
||||
$json = json_encode($data, $flags);
|
||||
|
||||
return json_encode($data, $flags);
|
||||
// handle strings prefixed with $ as js-variables
|
||||
// literal: match everything (lazy) between first pair of unescaped double quotes. First character must be $.
|
||||
$json = preg_replace_callback('/(?<!\\\\)"\$(.+?)(?<!\\\\)"/i', function($m) { return str_replace('\"', '"', $m[1]); }, $json);
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
public static function checkOrCreateDirectory($path)
|
||||
|
||||
Reference in New Issue
Block a user