.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;
}
";
return $html.adm_render_mnode($menu,$sub);
}
function adm_render_mnode(&$menu,$sub) {
global $_CONF;
$html = "";
$iter = $menu->getIterator();
while($iter->hasNext()) {
$curr = $iter->getNext();
$html .= "";
if($curr->hasOpenCat() != 0) {
$html .= "
".adm_render_mnode($curr,($sub+4))."
";
}
}
return $html;
}
function adm_render_category(&$cat) {
global $menu,$metalist,$DBc,$_USER;
$html = "";
$m = $menu->getIterator();
while($m->hasNext()) {
$n = $m->getNext();
$html .= "";
$m2 = $n->getIterator();
while($m2->hasNext()) {
$n2 = $m2->getNext();
$html .= "";
//db
$res = $DBc->sqlQuery("SELECT aa_id,aal_name FROM ach_achievement LEFT JOIN (ach_achievement_lang) ON (aal_lang='".$_USER->getLang()."' AND aal_achievement=aa_id) WHERE aa_category='".$n2->getID()."' ORDER by aa_sticky DESC, aal_name ASC");
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
$html .= "";
}
}
//db
$res = $DBc->sqlQuery("SELECT aa_id,aal_name FROM ach_achievement LEFT JOIN (ach_achievement_lang) ON (aal_lang='".$_USER->getLang()."' AND aal_achievement=aa_id) WHERE aa_category='".$n->getID()."' ORDER by aa_sticky DESC, aal_name ASC");
$sz = sizeof($res);
for($i=0;$i<$sz;$i++) {
$html .= "";
}
}
$metalist = $html;
$html = "";
if($_REQUEST['confirm'] == "delete") {
$tmp = $cat->getElementByPath($_REQUEST['id']);
if($tmp != null) {
$html .= "
";
}
}
$html .= "";
if($cat->hasTieAlignDev()) {
$html .= ach_render_tiebar($cat->getCurrentCult(),$cat->getCurrentCiv(),$cat);
}
$iter = $cat->getOpen();
while($iter->hasNext()) {
$curr = $iter->getNext();
if(!$curr->isTiedAlign_open($cat->getCurrentCult(),$cat->getCurrentCiv())) {
#continue;
}
$html .= ach_render_achievement_open($curr,$cat);
}
return $html;
}
function ach_render_achievement_open(&$ach,&$cat) {
global $_CONF,$menu;
$html = '
|
|
|
|
|
";
$html .= ' |
|
';
$html .= "";
$html .= "";
$html .= "";
$html .= ach_render_task_open($ach,$cat);
$html .= ' |
|
|
|
|
|
';
return $html;
}
function ach_render_task_open(&$ach,&$cat) {
global $metalist;
$html = "";
$task_list = $ach->getOpen();
while($task_list->hasNext()) {
$task = $task_list->getNext();
if(!$task->isTiedAlign($cat->getCurrentCult(),$cat->getCurrentCiv())) {
#continue;
}
$html .= "";
$html .= "";
$html .= "";
$html .= ach_render_obj_list($task->getIterator(),$task);
}
return $html;
}
function ach_render_obj_list($obj,$task) {
#return null;
global $metalist;
$html = "";
#$i = 0;
#$skip = false;
while($obj->hasNext()) {
#foreach($obj as $elem) {
$inh = "";
$elem = $obj->getNext();
if($task->isInherited($elem->getID())) {
$inh = "inherited: ";
}
#if(($i%2) == 0) {
$html .= "";
#}
switch($elem->getDisplay()) {
case "meta":
$html .= "".$inh.ach_render_obj_meta($elem)." | ";
break;
case "value":
#if(($i%2) == 1) {
# $html .= " | ";
#}
$html .= "".$inh.ach_render_obj_value($elem)." | ";
#$i++;
break;
case "simple":
$html .= "".$inh.ach_render_obj_simple($elem)." | ";
break;
case "hidden":
default:
//do nothing
#$skip = true;
#if(($i%2) == 1) {
# $html .= " ";
#}
$html .= "".$inh.ach_render_obj_hidden($elem)." | ";
#$i++;
break;
}
$html .= "";
#$html .= " ";
$html .= " getPathID()."'> |
";
$html .= "";
#if(($i%2) == 1) {
$html .= " |
";
#}
#if(!$skip) {
# $i++;
#}
#$skip = false;
}
#if(($i%2) == 1) {
# $html .= "";
#}
$html .= "
";
return $html;
}
function ach_render_obj_simple(&$obj) {
global $_CONF;
$html = "";
if($obj->isdone()) {
$html .= " ";
}
else {
$html .= " ";
}
$html .= "[obj:]".$obj->getDisplayName()."";
return $html;
}
function ach_render_obj_meta(&$obj) {
global $_CONF;
if($obj->isdone()) {
$col = "#71BE02";
$grey = "";
}
else {
$col = "#999999";
$grey = "grey/";
}
return "
getMetaImage()."' width='20px' /> |
[obj:]".$obj->getDisplayName()." |
";
}
function ach_render_obj_value(&$obj) {
$html = "";
#if($obj->getName() != null) {
if($obj->isdone()) {
$col = "#71BE02";
}
else {
$col = "#999999";
}
$html .= "[obj:]".$obj->getDisplayName()."
";
#}
$html .= ach_render_progressbar($obj->getProgress(),$obj->getValue(),350);
return $html;
}
function ach_render_obj_hidden(&$obj) {
$html = "";
#if($obj->getName() != null) {
if($obj->isdone()) {
$col = "#71BE02";
}
else {
$col = "#999999";
}
$html .= "";
#}
#$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_tiebar($cult = "c_neutral", $civ = "c_neutral",&$cat) {
global $_USER;
$html = "
";
/*if($cat->isTiedCult() && !$cat->isTiedCiv() && $cult == "c_neutral") { // neutral / xx
#While being of neutral allegiance with the higher powers
$html .= get_translation('ach_allegiance_neutral_cult',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
}
elseif($cat->isTiedCiv() && !$cat->isTiedCult() && $civ == "c_neutral") { // xx / neutral
#While being of neutral allegiance with the homin civilizations
$html .= get_translation('ach_allegiance_neutral_civ',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
}*/
if(($cult == "c_neutral" || !$cat->isAllowedCult()) && ($civ == "c_neutral" || !$cat->isAllowedCiv())) { // neutral / neutral
#While being of neutral allegiance
$html .= get_translation('ach_allegiance_neutral',$_USER->getLang(),array("".get_translation('ach_c_neutral',$_USER->getLang()).""));
}
else { //other
#While being aligned with the
$html .= get_translation('ach_allegiance_start',$_USER->getLang());
if($cat->isAllowedCult() && $cult != "c_neutral") {
#CULT
$html .= "".ach_translate_cc($cult)."";
if($cat->isAllowedCiv() && $civ != "c_neutral") {
#and the CIV
$html .= get_translation('ach_allegiance_and',$_USER->getLang())." ".ach_translate_cc($civ)."";
}
}
elseif($cat->isAllowedCiv() && $civ != "c_neutral") {
#CIV
$html .= "".ach_translate_cc($civ)."";
}
}
#, accomplish the following achievements:
$html .= get_translation('ach_allegiance_end',$_USER->getLang())."
";
return $html;
}
?>