.ach_menu { display:block; padding:2px; border:1px solid #000000; margin-bottom:2px; color:#FFFFFF; } .ach_menu:hover { color:orange; } .ach_mspan a { text-decoration:none; } "; $sz = $menu->getSize(); for($i=0;$i<$sz;$i++) { $curr = $menu->getChild($i); $html .= "
".$curr->getName()."
".ach_render_menu($curr,($sub+4))."
"; } return $html; } function ach_render_category(&$cat) { $html = ""; $tmp = $cat->getDone(); $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "A"; $html .= ach_render_achievement_done($cat->getChild($tmp[$i])); } $tmp = $cat->getOpen(); $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "B"; $html .= ach_render_achievement_open($cat->getChild($tmp[$i])); } return $html; } function ach_render_achievement_done(&$ach) { $html = ""; $html .= '
'.$ach->getName().'
'.$ach->getValueDone().'
'; $html .= ach_render_perk_done($ach); $html .= '
'; return $html; } function ach_render_achievement_open(&$ach) { $html = ""; $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 = $ach->getChild($perk_list[0]); $html .= "".$perk->getName().""; if($perk->objDrawable()) { $html .= "
".ach_render_obj_list($perk->getChildren()); } return $html; } function ach_render_perk_done(&$ach) { $html = ""; $perk_list = $ach->getDone(); foreach($perk_list as $elem) { $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; } function ach_render_obj_list(&$obj) { $html = "
"; $i = 0; $skip = false; foreach($obj as $elem) { 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) { $html = ""; if($obj->isdone()) { $html .= " "; } else { $html .= " "; } $html .= $obj->getName().""; return $html; } function ach_render_obj_meta(&$obj) { $html = ""; if($obj->isdone()) { $col = "#71BE02"; $grey = ""; } else { $col = "#999999"; $grey = "grey/"; } return "
 ".$obj->getName()."
"; } function ach_render_obj_value(&$obj) { $html = ""; if($obj->isdone()) { $col = "#71BE02"; } else { $col = "#999999"; } $html .= "
".$obj->getName()."
"; $val = $obj->getValue(); $prog = $obj->getProgress(); $width = 350; $left = floor($width*(100*($prog/$val))/100); $html .= "
"; if(($prog/$val) > 0.85) { $html .= " ".$prog." / ".$val." "; } $html .= " "; if(($prog/$val) <= 0.85) { $html .= " ".$prog." / ".$val." "; } $html .= "
"; return $html; } ?>