menu more and tools

- items: allow 'upg' to be an array
- filter: fixed logic error in checks
- Markup: prevent handling of [menu], as PageTemplate is nyi
- Power: advanced features (hide reagents or sellprice; recoloring,
  renaming, iconizing of links)
- search: side-icon for titles
- smarty: added template-vars to cache (has to be fixed sooner or later)

- identify as HTML5 (fixed a strange bug with displaced list-pegs)
- removed several typos
This commit is contained in:
Sarjuuk
2014-03-22 19:15:10 +01:00
parent f236d7ae93
commit 93cc42407c
65 changed files with 1074 additions and 249 deletions

View File

@@ -59,7 +59,7 @@ class SmartyAoWoW extends Smarty
$tv = &$this->_tpl_vars;
// fetch article & static infobox
if ($tv['type'] && $tv['typeId'])
if (isset($tv['type']) && isset($tv['typeId']))
{
$article = DB::Aowow()->selectRow(
'SELECT SQL_CALC_FOUND_ROWS article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = ?d UNION ALL '.
@@ -70,7 +70,13 @@ class SmartyAoWoW extends Smarty
if ($article)
{
$tv['article'] = ['text' => Util::jsEscape($article['article'])];
$replace = array(
'script' => 'scr"+"ipt',
'HOST_URL' => HOST_URL,
'STATIC_URL' => STATIC_URL
);
$tv['article'] = ['text' => strtr(Util::jsEscape($article['article']), $replace)];
if (empty($tv['infobox']) && !empty($article['quickInfo']))
$tv['infobox'] = $article['quickInfo'];
@@ -247,7 +253,8 @@ class SmartyAoWoW extends Smarty
$file = $this->cache_dir.'data/'.$key;
$cacheData = time()." ".AOWOW_REVISION."\n";
$cacheData = time()." ".AOWOW_REVISION."\n";
$cacheData .= serialize($this->_tpl_vars)."\n"; // todo(med): this should not be nessecary, rework caching
$cacheData .= serialize(str_replace(["\n", "\t"], ['\n', '\t'], $data));
if ($filter)
@@ -273,9 +280,12 @@ class SmartyAoWoW extends Smarty
if ($expireTime <= time() || $rev < AOWOW_REVISION)
return false;
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[1]));
if (isset($cache[2]))
$filter = unserialize($cache[2]);
$this->_tpl_vars = unserialize($cache[1]);
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[2]));
if (isset($cache[3]))
$filter = unserialize($cache[3]);
return true;
}