mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
ListviewTabs/Fixup
* filter empty tabs before trying to display, case in point * do not always assign conditions tab if empty
This commit is contained in:
@@ -268,10 +268,11 @@ class AchievementPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition for
|
// tab: condition for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::ACHIEVEMENT, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::ACHIEVEMENT, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -233,10 +233,11 @@ class ClassPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::CHR_CLASS, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::CHR_CLASS, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,10 +270,11 @@ class EventPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition for
|
// tab: condition for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::WORLDEVENT, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::WORLDEVENT, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -297,10 +297,11 @@ class FactionPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::FACTION, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::FACTION, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -783,7 +783,10 @@ class GenericPage
|
|||||||
$this->addAnnouncements();
|
$this->addAnnouncements();
|
||||||
|
|
||||||
if (isset($this->lvTabs))
|
if (isset($this->lvTabs))
|
||||||
|
{
|
||||||
|
$this->lvTabs = array_filter($this->lvTabs);
|
||||||
array_walk($this->lvTabs, function (&$x) { $x = array_pad($x, 3, null); });
|
array_walk($this->lvTabs, function (&$x) { $x = array_pad($x, 3, null); });
|
||||||
|
}
|
||||||
|
|
||||||
include('template/pages/'.$this->tpl.'.tpl.php');
|
include('template/pages/'.$this->tpl.'.tpl.php');
|
||||||
die();
|
die();
|
||||||
|
|||||||
@@ -1011,10 +1011,11 @@ class ItemPage extends genericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::ITEM, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::ITEM, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -475,10 +475,11 @@ class ObjectPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::OBJECT, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::OBJECT, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,10 +204,11 @@ class RacePage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::CHR_RACE, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::CHR_RACE, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,10 +339,11 @@ class SkillPage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::SKILL, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::SKILL, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,10 +150,11 @@ class TitlePage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::TITLE, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::TITLE, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -787,10 +787,11 @@ class ZonePage extends GenericPage
|
|||||||
|
|
||||||
// tab: condition-for
|
// tab: condition-for
|
||||||
$cnd = new Conditions();
|
$cnd = new Conditions();
|
||||||
if ($cnd->getByCondition(Type::ZONE, $this->typeId)->prepare())
|
$cnd->getByCondition(Type::ZONE, $this->typeId)->prepare();
|
||||||
|
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
|
||||||
{
|
{
|
||||||
$this->extendGlobalData($cnd->getJsGlobals());
|
$this->extendGlobalData($cnd->getJsGlobals());
|
||||||
$this->lvTabs[] = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for');
|
$this->lvTabs[] = $tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user