".ach_render_yubopoints($user['id'])."
"; #$_REQUEST['mid'] = 1; $menu = new AchMenu($_REQUEST['cat']); $c .= ach_render_menu($menu); $c .= "
"; /*for($i=0;$i<15;$i++) { $c .= ach_render_box_done("Bejeweled"); }*/ $open = $menu->getOpenCat(); if($open != 0) { $cat = new AchCategory($open,null,$_REQUEST['cult'],$_REQUEST['civ']); } else { $cat = new AchSummary($menu,8); $c .= ach_render_summary_header(); } $c .= ach_render_category($cat); if($open == 0) { $c .= ach_render_summary_footer($cat); } $c .= "
"; return $c; } function ach_render_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) { global $_USER,$_CONF; $html = "
"; if($cat->isTiedCult()) { $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($sub == 0) { $html .= ""; } $html .= "
getImage()."' />".$curr->getName()."
"; if($curr->hasOpenCat() != 0) { $html .= "
".ach_render_mnode($curr,($sub+4))."
"; } } return $html; } function ach_render_category(&$cat) { $html = ""; if($cat->isTiedCult() || $cat->isTiedCiv()) { $html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat); } $iter = $cat->getDone(); while($iter->hasNext()) { $curr = $iter->getNext(); #$sz = sizeof($tmp); #for($i=0;$i<$sz;$i++) { #echo "A"; if($curr->inDev()) { continue; } $html .= ach_render_achievement_done($curr); } $iter = $cat->getOpen(); while($iter->hasNext()) { $curr = $iter->getNext(); #$sz = sizeof($tmp); #for($i=0;$i<$sz;$i++) { #echo "B"; if($curr->inDev()) { continue; } $html .= ach_render_achievement_open($curr); } return $html; } function ach_render_achievement_done(&$ach) { global $_CONF; $html = '
'.$ach->getName().'
'.$ach->getValueDone().'
'; $html .= ach_render_perk_done($ach); $html .= '
'; return $html; } function ach_render_achievement_open(&$ach) { global $_CONF; $html = '
'.$ach->getName().'
'.$ach->getValueOpen().'
'; $html .= ach_render_perk_open($ach); $html .= '
'; return $html; } function ach_render_perk_open(&$ach) { #echo var_export($perk_list,true); $html = ""; $perk_list = $ach->getOpen(); $perk = $perk_list->getNext(); #$perk = $ach->getChild($perk_list[0]); if($perk->inDev()) { return $html; } if($perk->getName() != null) { $html .= "".$perk->getDisplayName().""; } if($perk->objDrawable()) { $html .= ach_render_obj_list($perk->getIterator()); } return $html; } function ach_render_perk_done(&$ach) { global $_CONF; $html = ""; $perk_list = $ach->getDone(); while($perk_list->hasNext()) { $perk = $perk_list->getNext(); #foreach($perk_list as $elem) { #$perk = $ach->getChild($elem); if($perk->inDev()) { continue; } $html .= "
".$perk->getDisplayName()." ( ".date('d.m.Y',$perk->getDone())." ) ".$perk->getValue()."
"; } return $html; } function ach_render_obj_list($obj) { $html = "
"; $i = 0; $skip = false; while($obj->hasNext()) { #foreach($obj as $elem) { $elem = $obj->getNext(); if(($i%2) == 0) { $html .= ""; } switch($elem->getDisplay()) { case "meta": $html .= ""; break; case "value": if(($i%2) == 1) { $html .= ""; } $html .= ""; $i++; break; case "simple": $html .= ""; break; case "hidden": default: //do nothing $skip = true; break; } if(($i%2) == 1) { $html .= ""; } if(!$skip) { $i++; } $skip = false; } if(($i%2) == 1) { $html .= ""; } $html .= "
".ach_render_obj_meta($elem)."
".ach_render_obj_value($elem)."
".ach_render_obj_simple($elem)."
"; return $html; } function ach_render_obj_simple(&$obj) { global $_CONF; $html = ""; if($obj->isdone()) { $html .= " "; } else { $html .= " "; } $html .= $obj->getDisplayName().""; return $html; } function ach_render_obj_meta(&$obj) { global $_CONF; $html = ""; if($obj->isdone()) { $col = "#71BE02"; $grey = ""; } else { $col = "#999999"; $grey = "grey/"; } return "
getMetaImage()."' width='20px' />  ".$obj->getDisplayName()."
"; } function ach_render_obj_value(&$obj) { $html = ""; if($obj->getName() != null) { if($obj->isdone()) { $col = "#71BE02"; } else { $col = "#999999"; } $html .= "
".$obj->getDisplayName()."
"; } $html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350); return $html; } function ach_render_progressbar($prog,$val,$width) { $val = max(1,$val); $left = floor($width*(100*($prog/$val))/100); $html = "
"; if(($prog/$val) > 0.85) { $html .= " ".nf($prog)." / ".nf($val)." "; } $html .= " "; if(($prog/$val) <= 0.85) { $html .= " ".nf($prog)." / ".nf($val)." "; } $html .= "
"; 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 .= "
".$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; } ?>