From 6b3d10307bbccf00955fb8d7bd2d4bea244c9c8c Mon Sep 17 00:00:00 2001 From: SirCotare Date: Thu, 21 Jun 2012 22:45:27 +0200 Subject: [PATCH] #1470 Parentum interface debugged... --- .../class/AchAchievement_class.php | 7 ++++--- .../class/AchCategory_class.php | 2 +- .../app_achievements/class/AchMenu_class.php | 18 ++++++++++-------- .../class/AchObjective_class.php | 2 +- .../app_achievements/class/AchPerk_class.php | 6 +++--- .../class/AchSummary_class.php | 2 +- code/web/app/app_achievements/index.php | 3 ++- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/code/web/app/app_achievements/class/AchAchievement_class.php b/code/web/app/app_achievements/class/AchAchievement_class.php index 94925ba4f..a28caf1ae 100644 --- a/code/web/app/app_achievements/class/AchAchievement_class.php +++ b/code/web/app/app_achievements/class/AchAchievement_class.php @@ -32,7 +32,8 @@ $sz = sizeof($res); for($i=0;$i<$sz;$i++) { #echo "Z"; - $tmp = $this->makeChild($res[$i],$this); + $res[$i]['this'] = $this; + $tmp = $this->makeChild($res[$i]); #echo var_export($tmp,true); @@ -52,8 +53,8 @@ #echo "X-".$this->hasOpen(); } - private function makeChild(&$a,$b) { - return new AchPerk($a,$b); + function makeChild(&$a) { + return new AchPerk($a); } function getID() { diff --git a/code/web/app/app_achievements/class/AchCategory_class.php b/code/web/app/app_achievements/class/AchCategory_class.php index c4b51ff68..86b6715dc 100644 --- a/code/web/app/app_achievements/class/AchCategory_class.php +++ b/code/web/app/app_achievements/class/AchCategory_class.php @@ -54,7 +54,7 @@ $this->ties_civ_dev = $res[0]['anz']; } - private function makeChild(&$a) { + function makeChild(&$a) { return new AchAchievement($a); } diff --git a/code/web/app/app_achievements/class/AchMenu_class.php b/code/web/app/app_achievements/class/AchMenu_class.php index e30682af5..1b5c384d1 100644 --- a/code/web/app/app_achievements/class/AchMenu_class.php +++ b/code/web/app/app_achievements/class/AchMenu_class.php @@ -19,7 +19,8 @@ $sz = sizeof($res); for($i=0;$i<$sz;$i++) { - $this->nodes[] = $this->makeChild($res[$i],$open); + $res[$i]['open'] = $open; + $this->nodes[] = $this->makeChild($res[$i]); } } @@ -37,8 +38,8 @@ return 0; } - private function makeChild(&$a,$b) { - return new AchMenuNode($a,$b); + function makeChild(&$a) { + return new AchMenuNode($a); } } @@ -50,7 +51,7 @@ private $image; private $order; - function AchMenuNode(&$data,$open) { + function AchMenuNode(&$data) { global $DBc,$_USER; $this->id = $data['ac_id']; @@ -58,19 +59,20 @@ $this->name = $data['acl_name']; $this->image = $data['ac_image']; $this->order = $data['ac_order']; - $this->open = ($this->id == $open); + $this->open = ($this->id == $data['open']); $this->dev = $data['ac_dev']; $res = $DBc->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$_USER->getLang()."' AND acl_category=ac_id) WHERE ac_parent='".$this->id."' ORDER by ac_order ASC, acl_name ASC"); $sz = sizeof($res); for($i=0;$i<$sz;$i++) { - $this->nodes[] = $this->makeChild($res[$i],$open); + $res[$i]['open'] = $open; + $this->nodes[] = $this->makeChild($res[$i]); } } - private function makeChild(&$a,$b) { - return new AchMenuNode($a,$b); + function makeChild(&$a) { + return new AchMenuNode($a); } function getID() { diff --git a/code/web/app/app_achievements/class/AchObjective_class.php b/code/web/app/app_achievements/class/AchObjective_class.php index 1d946c8fa..f58849742 100644 --- a/code/web/app/app_achievements/class/AchObjective_class.php +++ b/code/web/app/app_achievements/class/AchObjective_class.php @@ -1,5 +1,5 @@ id = $data['ap_id']; - $this->parent = $parent; + $this->parent = $data['this']; $this->achievement = $data['ap_achievement']; $this->value = $data['ap_value']; $this->name = $data['apl_name']; @@ -26,7 +26,7 @@ } } - private function makeChild(&$a) { + function makeChild(&$a) { return new AchObjective($a); } diff --git a/code/web/app/app_achievements/class/AchSummary_class.php b/code/web/app/app_achievements/class/AchSummary_class.php index 8a227eea9..2aee31dfc 100644 --- a/code/web/app/app_achievements/class/AchSummary_class.php +++ b/code/web/app/app_achievements/class/AchSummary_class.php @@ -22,7 +22,7 @@ } } - private function makeChild(&$a) { + function makeChild(&$a) { return new AchAchievement($a); } diff --git a/code/web/app/app_achievements/index.php b/code/web/app/app_achievements/index.php index cac79e291..c47ffab38 100644 --- a/code/web/app/app_achievements/index.php +++ b/code/web/app/app_achievements/index.php @@ -33,10 +33,11 @@ else { } require_once("include/ach_render_common.php"); +require_once("class/Parentum_inter.php"); require_once("class/RenderNodeIteraor_abstract.php"); require_once("class/AchList_abstract.php"); require_once("class/Tieable_inter.php"); -require_once("class/Parentum_inter.php"); + require_once("class/AchMenu_class.php"); require_once("class/AchSummary_class.php");