I think, I've finally found a use for traits

- working on listviews displaying only the columns needed
- still fighting leftovers from class conversion
This commit is contained in:
Sarjuuk
2013-03-13 20:51:36 +01:00
parent 7c482e9319
commit 881e5143d1
4 changed files with 48 additions and 2 deletions

View File

@@ -5,7 +5,9 @@ if (!defined('AOWOW_REVISION'))
class TitleList extends BaseType
{
private $sources = [];
use listviewHelper;
public $sources = [];
protected $setupQuery = 'SELECT *, id AS ARRAY_KEY FROM ?_titles WHERE [cond] ORDER BY Id ASC';
protected $matchQuery = 'SELECT COUNT(1) FROM ?_titles WHERE [cond]';
@@ -33,6 +35,7 @@ class TitleList extends BaseType
}
}
}
$this->reset(); // push first element back for instant use
}
public function getListviewData()
@@ -127,7 +130,7 @@ class TitleList extends BaseType
public function getHtmlizedName($gender = GENDER_MALE)
{
return str_replace('%s', '<span class="q0">&lt;'.Lang::$main['name'].'&gt;</span>', $this->name[$gender]);
return str_replace('%s', '<span class="q0">&lt;'.Lang::$main['name'].'&gt;</span>', $this->names[$this->id][$gender]);
}
public function addRewardsToJScript(&$ref) { }