예제 #1
0
function adm_render_category(&$cat)
{
    global $menu, $metalist, $DBc, $_USER;
    $html = "";
    $m = $menu->getIterator();
    while ($m->hasNext()) {
        $n = $m->getNext();
        $html .= "<option value='null' disabled='disabled'>" . $n->getName() . "</option>";
        $m2 = $n->getIterator();
        while ($m2->hasNext()) {
            $n2 = $m2->getNext();
            $html .= "<option value='null' disabled='disabled'>&nbsp;&nbsp;&nbsp;" . $n2->getName() . "</option>";
            //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 .= "<option value='" . $res[$i]['aa_id'] . "'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $res[$i]['aal_name'] . "</option>";
            }
        }
        //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 .= "<option value='" . $res[$i]['aa_id'] . "'>&nbsp;&nbsp;&nbsp;" . $res[$i]['aal_name'] . "</option>";
        }
    }
    $metalist = $html;
    $html = "<style>\n\t\t\t.bw {\n\t\t\t\tbackground-color:#FFFFFF;\n\t\t\t\tcolor:#000000;\n\t\t\t}\n\t\t</style>";
    if ($_REQUEST['confirm'] == "delete") {
        $tmp = $cat->getElementByPath($_REQUEST['id']);
        if ($tmp != null) {
            $html .= "<div style='display:block;padding:3px;margin-bottom:5px;' class='bw'>\n\t\t\t\t<fieldset>\n\t\t\t\t<legend>Delete</legend>\n\t\t\t\t\tAre you sure you want to delete <b>" . $tmp->getName() . "</b><p>\n\t\t\t\t\t<b>Any nested Tasks/Objective/Atoms will be removed, as well as any player progress connected!</b>\n\t\t\t\t\t<p>\n\t\t\t\t\t<a href='?mode=ach&cat=" . $_REQUEST['cat'] . "&act=delete&id=" . $_REQUEST['id'] . "'><b>delete</b></a>\n\t\t\t\t</fieldset>\n\t\t\t\t</div>";
        }
    }
    $html .= "<div style='display:block;background-color:#FFFFFF;padding:3px;margin-bottom:5px;color:#000000;'>\n\t\t\t<div style='display:block;text-align:right;'>\n\t\t\t\t<a href='javascript:hs(\"new_ach\",\"block\");'>\n\t\t\t\t\t<img src='pic/b_insrow.png'>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t\t<div id='new_ach' style='display: none;'>\n\t\t\t\t\t<form method='post' action='?mode=ach&cat=" . $_REQUEST['cat'] . "&act=ach_insert'>\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<legend>add new achievement</legend>\n\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>name:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='aal_name' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>naming template:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='aal_template' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>parent achievement:</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<select name='aa_parent'>\n\t\t\t\t\t\t\t\t\t\t\t<option value='null' selected='selected'>-- none --</option>";
    $iter = $cat->getOpen();
    while ($iter->hasNext()) {
        $item = $iter->getNext();
        $html .= "<option value='" . $item->getID() . "'>" . $item->getName() . "</option>";
    }
    $html .= "</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>image:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='aa_image' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>sticky:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='hidden' value='0' name='aa_sticky' /><input type='checkbox' name='aa_sticky' value='1'/></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan='2'><hr /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>task name:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='atl_name' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>naming template:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='atl_template' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>task yubopoints:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='at_value' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>condition:</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<select name='at_condition'>\n\t\t\t\t\t\t\t\t\t\t\t<option value='all' selected='selected'>all</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='any'>any</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='value'>by value</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>condition value:</td>\n\t\t\t\t\t\t\t\t\t<td><input type='text' name='at_condition_value' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class='bw'>allegiance:</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<select name='at_tie_allegiance[]' multiple='multiple' size='15'>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_neutral'>neutral / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_neutral'>Kami / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_neutral'>Karavan / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_fyros'>neutral / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_fyros'>Kami / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_fyros'>Karavan / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_matis'>neutral / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_matis'>Kami / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_matis'>Karavan / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_tryker'>neutral / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_tryker'>Kami / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_tryker'>Karavan / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_zorai'>neutral / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_zorai'>Kami / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_zorai'>Karavan / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan='2'><input type='hidden' value='0' name='at_inherit' /><input type='submit' value='create' /></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t</div>";
    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;
}
예제 #2
0
function csr_render_category(&$cat)
{
    $html = "";
    if ($cat->hasTieAlign_done() || $cat->hasTieAlign_open()) {
        $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;
}
예제 #3
0
function ach_render_category(&$cat)
{
    global $_USER;
    $html = "";
    if ($cat->isHeroic() && !$cat->hasDone()) {
        return "<center style='font-size:24px;'>" . get_translation('ach_no_heroic_deeds', $_USER->getLang()) . "</center>";
    }
    if ($cat->hasTieAlign_done() || $cat->hasTieAlign_open()) {
        $html .= ach_render_tiebar($cat->getCurrentCult(), $cat->getCurrentCiv(), $cat);
    }
    $iter = $cat->getDone();
    while ($iter->hasNext()) {
        $curr = $iter->getNext();
        if ($curr->inDev() || !$curr->parentDone() || !$curr->isTiedRace_done($cat->getCurrentRace()) || !$curr->isTiedAlign_done($cat->getCurrentCult(), $cat->getCurrentCiv())) {
            continue;
        }
        $html .= ach_render_achievement_done($curr, $cat);
    }
    if ($cat->isHeroic()) {
        return $html;
    }
    $iter = $cat->getOpen();
    while ($iter->hasNext()) {
        $curr = $iter->getNext();
        if ($curr->inDev() || !$curr->parentDone() || !$curr->isTiedRace_open($cat->getCurrentRace()) || !$curr->isTiedAlign_open($cat->getCurrentCult(), $cat->getCurrentCiv())) {
            continue;
        }
        $html .= ach_render_achievement_open($curr, $cat);
    }
    return $html;
}