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:
Sarjuuk
2016-02-10 00:14:55 +01:00
parent fe7f05c89c
commit 08717c36d0
97 changed files with 1638 additions and 2624 deletions

View File

@@ -47,31 +47,26 @@ class ObjectsPage extends GenericPage
if ($_ = $this->filterObj->getConditions())
$conditions[] = $_;
$params = $data = [];
$tabData = ['data' => []];
$objects = new GameObjectList($conditions, ['extraOpts' => $this->filterObj->extraOpts]);
if (!$objects->error)
{
$data = $objects->getListviewData();
$tabData['data'] = array_values($objects->getListviewData());
if ($objects->hasSetFields(['reqSkill']))
$params['visibleCols'] = "$['skill']";
$tabData['visibleCols'] = ['skill'];
// create note if search limit was exceeded
if ($objects->getMatches() > CFG_SQL_LIMIT_DEFAULT)
{
$params['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), CFG_SQL_LIMIT_DEFAULT);
$params['_truncated'] = 1;
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), CFG_SQL_LIMIT_DEFAULT);
$tabData['_truncated'] = 1;
}
if ($this->filterObj->error)
$params['_errors'] = '$1';
$tabData['_errors'] = 1;
}
$this->lvTabs[] = array(
'file' => 'object',
'data' => $data,
'params' => $params
);
$this->lvTabs[] = ['object', $tabData];
}
protected function generateTitle()