From 49f6ea6d58dfa1d400988ca898b491bb1e8e49dc Mon Sep 17 00:00:00 2001 From: SirCotare Date: Sun, 3 Jun 2012 20:53:01 +0200 Subject: [PATCH] #1470 bugfix in tie logics while rendering --- .../include/ach_render_common.php | 23 ++- .../include/ach_render_ig.php | 189 ++++++++++++++++-- .../include/ach_render_web.php | 86 ++++---- code/web/app/app_achievements/lang.php | 14 ++ 4 files changed, 242 insertions(+), 70 deletions(-) diff --git a/code/web/app/app_achievements/include/ach_render_common.php b/code/web/app/app_achievements/include/ach_render_common.php index ae7b75035..2c49ac3a7 100644 --- a/code/web/app/app_achievements/include/ach_render_common.php +++ b/code/web/app/app_achievements/include/ach_render_common.php @@ -1,9 +1,20 @@ getLang()); + + return $t[$cc]; } ?> \ No newline at end of file diff --git a/code/web/app/app_achievements/include/ach_render_ig.php b/code/web/app/app_achievements/include/ach_render_ig.php index 4abf20f83..2718bfbc0 100644 --- a/code/web/app/app_achievements/include/ach_render_ig.php +++ b/code/web/app/app_achievements/include/ach_render_ig.php @@ -1,6 +1,93 @@ + .o { + color:orange; + } + + +
+ + "; + if($cat->isTiedCult()) { + $html.= "
+ + - - -
+ "; + if($sub == 0) { + $html .= ""; + } + $html .= " -
".$curr->getName()."
-
".ach_render_menu($curr,($sub+4))."
"; +
"; + if($curr->hasOpenCat() != 0) { + $html .= "
".ach_render_menu($curr,($sub+4))."
"; + } } return $html; @@ -44,6 +135,10 @@ function ach_render_category(&$cat) { $html = ""; + if($cat->isTiedCult() || $cat->isTiedCiv()) { + $html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat); + } + $tmp = $cat->getDone(); $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { @@ -156,9 +251,6 @@ $perk = $ach->getChild($elem); $html .= "
".$perk->getName()." ( ".date('d.m.Y',$perk->getDone())." ) ".$perk->getValue()."
"; } - /*if($perk->objDrawable()) { - $html .= "
".ach_render_obj_list($perk->getChildren()); - }*/ return $html; } @@ -250,31 +342,36 @@ function ach_render_obj_value(&$obj) { $html = ""; - if($obj->isdone()) { - $col = "#71BE02"; + if($obj->getName() != null) { + if($obj->isdone()) { + $col = "#71BE02"; + } + else { + $col = "#999999"; + } + $html .= "
".$obj->getName()."
"; } - else { - $col = "#999999"; - } - $html .= "
".$obj->getName()."
"; - $val = $obj->getValue(); - $prog = $obj->getProgress(); + $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350); + + return $html; + } - $width = 350; + function ach_render_progressbar($prog,$val,$width) { + $val = max(1,$val); $left = floor($width*(100*($prog/$val))/100); - $html .= " + $html = " @@ -282,4 +379,52 @@ return $html; } + + function ach_render_summary_header() { + global $_USER; + + return "
".get_translation('ach_summary_header',$_USER->getLang())."
"; + } + + function ach_render_summary_footer(&$summary) { + global $_USER; + + $nodes = $summary->getSummary(); + $html = ""; + + $sum_done = 0; + $sum_total = 0; + + $i = 0; + foreach($nodes as $elem) { + if(($i%3) == 0) { + $html .= ""; + } + + $html .= ""; + $sum_done += $elem[1]; + $sum_total += $elem[2]; + + if(($i%3) == 2) { + $html .= ""; + } + + $i++; + } + + if(($i%3) == 2) { + $html .= ""; + } + + $html = "

+

".get_translation('ach_summary_stats',$_USER->getLang())."
+
"; if(($prog/$val) > 0.85) { - $html .= " ".$prog." / ".$val." "; + $html .= " ".nf($prog)." / ".nf($val)." "; } $html .= " "; if(($prog/$val) <= 0.85) { - $html .= " ".$prog." / ".$val." "; + $html .= " ".nf($prog)." / ".nf($val)." "; } $html .= "
".$elem[0]."
".ach_render_progressbar($elem[1],$elem[2],200)."
+ + + + ".$html." +
".get_translation('ach_summary_stats_total',$_USER->getLang())."
".ach_render_progressbar($sum_done,$sum_total,450)."
"; + + return $html; + } ?> \ No newline at end of file diff --git a/code/web/app/app_achievements/include/ach_render_web.php b/code/web/app/app_achievements/include/ach_render_web.php index 8ab9f8903..2718bfbc0 100644 --- a/code/web/app/app_achievements/include/ach_render_web.php +++ b/code/web/app/app_achievements/include/ach_render_web.php @@ -1,25 +1,5 @@ getLang()); - - return $t[$cc]; - } - - function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",$cat) { + function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) { global $_USER; $html = " -
+
- - "; + if($cat->isTiedCult()) { + $html.= "
+