Ejemplo n.º 1
0
function ach_render_task_open(&$ach)
{
    $html = "";
    $open = explode(";", $_REQUEST['id']);
    $task_list = $ach->getOpen();
    while ($task_list->hasNext()) {
        $task = $task_list->getNext();
        $o = "none";
        if ($open[2] == $task->getID()) {
            $o = "block";
        }
        $html .= "<div style='display: block; margin-bottom: 5px;'>\r\n\t\t\t\t<div style='display:block;font-size:16px;' class='bar'><a href='javascript:hs(\"task_" . $task->getID() . "\",\"block\");'>[+]</a> " . $task->getDisplayName() . " <span style='font-size:12px;'>(condition= " . $task->getCondition() . ": " . $task->getConditionValue() . ")</span></div>\r\n\t\t\t\t<div style='margin-left:25px;display:" . $o . ";' id='task_" . $task->getID() . "'>" . ach_render_obj_list($task->getIterator(), $task) . "</div>\r\n\t\t\t</div>";
    }
    return $html;
}
Ejemplo n.º 2
0
function ach_render_task_open(&$ach)
{
    global $_CONF;
    $html = "";
    $open = explode(";", $_REQUEST['id']);
    $task_list = $ach->getOpen();
    while ($task_list->hasNext()) {
        $task = $task_list->getNext();
        $o = "none";
        if ($open[2] == $task->getID()) {
            $o = "block";
        }
        $tmp = $task->getLang('en');
        if ($tmp[0] != "" || $tmp[1] != '') {
            $html .= "<div style='display: block; margin-bottom: 5px;'>\r\n\t\t\t\t<div style='display:block;font-size:16px;' class='bar'><a name='jtask_" . $task->getID() . "'></a><a href='javascript:hs(\"task_" . $task->getID() . "\",\"block\");'>[+]</a> " . $task->getDisplayName() . "\r\n\t\t\t\t\r\n\t\t\t\t<div style='margin-left:35px;'>\r\n\t\t\t\t<form method='post' action='?mode=lang&cat=" . $_REQUEST['cat'] . "&act=task_save&id=" . $task->getPathID() . "#jtask_" . $task->getID() . "'>\r\n\t\t\t\t<table>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t\t<td style='color:#454545;'>name</td>\r\n\t\t\t\t\t\t<td style='color:#454545;'>template</td>\r\n\t\t\t\t\t</tr>";
            foreach ($_CONF['langs'] as $elem) {
                $tmp = $task->getLang($elem);
                $html .= "<tr>\r\n\t\t\t\t\t\t\t<td style='color:#454545;'>" . $elem . "</td>\r\n\t\t\t\t\t\t\t<td><input type='text' name='t_name[" . $elem . "]' style='width:258px;' value='" . htmlspecialchars($tmp[0], ENT_QUOTES) . "' /></td>\r\n\t\t\t\t\t\t\t<td><input type='text' name='t_tpl[" . $elem . "]' style='width:258px;' value='" . htmlspecialchars($tmp[1], ENT_QUOTES) . "' /></td>\r\n\t\t\t\t\t\t</tr>";
            }
            $html .= "<tr>\r\n\t\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t\t<td colspan='2'><input type='submit' value='save' /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t\t</form>\r\n\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t</div>\r\n\t\t\t\t<div style='margin-left:25px;display:" . $o . ";' id='task_" . $task->getID() . "'>" . ach_render_obj_list($task->getIterator(), $task) . "</div>\r\n\t\t\t</div>";
        } else {
            $html .= "<div style='display: block; margin-bottom: 5px;'><div style='margin-left:25px;display:block;' id='task_" . $task->getID() . "'>" . ach_render_obj_list($task->getIterator(), $task) . "</div></div>";
        }
    }
    return $html;
}
Ejemplo n.º 3
0
function ach_render_task_open(&$ach)
{
    $html = "";
    $task_list = $ach->getOpen();
    $task = $task_list->getNext();
    if ($task->inDev()) {
        return $html;
    }
    $html .= "<span style='color:#999999;font-weight:bold;display:block;'>";
    if ($task->getName() != null) {
        $html .= $task->getDisplayName();
    } else {
        $html .= "[untitled]";
    }
    $html .= " <a href='?mode=player&pid=" . $_REQUEST['pid'] . "&cat=" . $_REQUEST['cat'] . "&grant=" . $task->getPath() . "'><b>Task:</b> grant</a></span>";
    if ($task->objDrawable()) {
        $html .= ach_render_obj_list($task->getIterator());
    }
    return $html;
}
Ejemplo n.º 4
0
function ach_render_task_open(&$ach)
{
    $html = "";
    $task_list = $ach->getOpen();
    $task = $task_list->getNext();
    if ($task->inDev()) {
        return $html;
    }
    if ($task->getName() != null) {
        $html .= "<tr><td><font color='#999999' size='12px'><b>" . $task->getDisplayName() . "</b></font></td></tr><tr><td>&nbsp;</td></tr>";
    }
    if ($task->objDrawable()) {
        $html .= "<tr><td>" . ach_render_obj_list($task->getIterator()) . "</td></tr>";
    }
    return $html;
}
Ejemplo n.º 5
0
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 .= "<table><tr><td><span style='color:#999999;font-weight:bold;display:block;'><a name='task_" . $task->getID() . "'>[task:]</a>" . $task->getDisplayName() . " (" . $task->getValue() . ")</span></td>";
        $html .= "<td style='background-color:#FFFFFF;padding:3px;'><nobr><a href='?mode=ach&cat=" . $_REQUEST['cat'] . "&act=dev&state=" . $task->getDev() . "&id=" . $task->getPathID() . "#task_" . $task->getID() . "'><img src='pic/";
        if ($task->inDev()) {
            $html .= "red";
        } else {
            $html .= "green";
        }
        $html .= ".gif' /></a>&nbsp;<a href='javascript:hs(\"edit_task_" . $task->getID() . "\",\"block\");'><img src='pic/icon_edit.gif'></a>";
        $html .= "&nbsp;<a href='javascript:hs(\"new_obj_" . $task->getID() . "\",\"block\");'><img src='pic/b_insrow.png'></a>";
        $html .= "&nbsp;&nbsp;&nbsp;<a href='?mode=ach&cat=" . $_REQUEST['cat'] . "&confirm=delete&id=" . $task->getPathID() . "'><img src='pic/b_drop.png'></a></nobr></td>\n\t\t\t\t\t\t\t\t\t</td></tr></table>";
        $html .= "<div id='edit_task_" . $task->getID() . "' style='margin-bottom:3px;margin-top:3px;display:none;color:#000000;background-color:#FFFFFF;'>\n\t\t\t\t\t\t<form method='post' action='?mode=ach&cat=" . $_REQUEST['cat'] . "&id=" . $task->getPathID() . "&act=task_update#task_" . $task->getID() . "'>\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<legend>edit task</legend>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>name:</td>\n\t\t\t\t\t\t\t\t\t\t<td><input type='text' name='atl_name' value='" . htmlspecialchars($task->getName(), ENT_QUOTES) . "' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\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\t<td><input type='text' name='atl_template' value='" . htmlspecialchars($task->getTemplate(), ENT_QUOTES) . "' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>yubopoints:</td>\n\t\t\t\t\t\t\t\t\t\t<td><input type='text' name='at_value' value='" . htmlspecialchars($task->getValue(), ENT_QUOTES) . "' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>parent:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<select name='at_parent'>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='null' selected='selected'>[set as base task]</option>";
        $par = $task->getParent();
        $iter = $par->getOpen();
        while ($iter->hasNext()) {
            $curr = $iter->getNext();
            if ($curr->getID() == $task->getID()) {
                continue;
            }
            $html .= "<option value='" . $curr->getID() . "'";
            if ($curr->getID() == $task->getParentID()) {
                $html .= " selected='selected'";
            }
            $html .= ">" . $curr->getDisplayName() . "</option>";
        }
        $html .= "</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>inherit objectives:</td>\n\t\t\t\t\t\t\t\t\t\t<td><input type='hidden' value='0' name='at_inherit' /><input type='checkbox' name='at_inherit' value='1'";
        if ($task->getHeritage() == 1) {
            $html .= " checked='checked'";
        }
        $html .= "/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>condition:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\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\t<option value='all'";
        if ($task->getCondition() == "all") {
            $html .= " selected='selected'";
        }
        $html .= ">all</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='any'";
        if ($task->getCondition() == "any") {
            $html .= " selected='selected'";
        }
        $html .= ">any</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='value'";
        if ($task->getCondition() == "value") {
            $html .= " selected='selected'";
        }
        $html .= ">by value</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\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\t<td><input type='text' name='at_condition_value' value='" . htmlspecialchars($task->getConditionValue(), ENT_QUOTES) . "' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>allegiance:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\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\t<option value='c_neutral|c_neutral'";
        if ($task->isTiedAlign('c_neutral', 'c_neutral')) {
            $html .= " selected='selected'";
        }
        $html .= ">neutral / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_neutral'";
        if ($task->isTiedAlign('c_kami', 'c_neutral')) {
            $html .= " selected='selected'";
        }
        $html .= ">Kami / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_neutral'";
        if ($task->isTiedAlign('c_karavan', 'c_neutral')) {
            $html .= " selected='selected'";
        }
        $html .= ">Karavan / neutral</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_fyros'";
        if ($task->isTiedAlign('c_neutral', 'c_fyros')) {
            $html .= " selected='selected'";
        }
        $html .= ">neutral / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_fyros'";
        if ($task->isTiedAlign('c_kami', 'c_fyros')) {
            $html .= " selected='selected'";
        }
        $html .= ">Kami / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_fyros'";
        if ($task->isTiedAlign('c_karavan', 'c_fyros')) {
            $html .= " selected='selected'";
        }
        $html .= ">Karavan / Fyros</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_matis'";
        if ($task->isTiedAlign('c_neutral', 'c_matis')) {
            $html .= " selected='selected'";
        }
        $html .= ">neutral / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_matis'";
        if ($task->isTiedAlign('c_kami', 'c_matis')) {
            $html .= " selected='selected'";
        }
        $html .= ">Kami / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_matis'";
        if ($task->isTiedAlign('c_karavan', 'c_matis')) {
            $html .= " selected='selected'";
        }
        $html .= ">Karavan / Matis</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_tryker'";
        if ($task->isTiedAlign('c_neutral', 'c_tryker')) {
            $html .= " selected='selected'";
        }
        $html .= ">neutral / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_tryker'";
        if ($task->isTiedAlign('c_kami', 'c_tryker')) {
            $html .= " selected='selected'";
        }
        $html .= ">Kami / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_tryker'";
        if ($task->isTiedAlign('c_karavan', 'c_tryker')) {
            $html .= " selected='selected'";
        }
        $html .= ">Karavan / Tryker</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_neutral|c_zorai'";
        if ($task->isTiedAlign('c_neutral', 'c_zorai')) {
            $html .= " selected='selected'";
        }
        $html .= ">neutral / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_kami|c_zorai'";
        if ($task->isTiedAlign('c_kami', 'c_zorai')) {
            $html .= " selected='selected'";
        }
        $html .= ">Kami / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='c_karavan|c_zorai'";
        if ($task->isTiedAlign('c_karavan', 'c_zorai')) {
            $html .= " selected='selected'";
        }
        $html .= ">Karavan / Zorai</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td colspan='2'><input type='submit' value='save' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>";
        $html .= "<div id='new_obj_" . $task->getID() . "' style='margin-bottom:3px;margin-top:3px;display:none;color:#000000;background-color:#FFFFFF;'>\n\t\t\t\t\t\t<form method='post' action='?mode=ach&cat=" . $_REQUEST['cat'] . "&id=" . $task->getPathID() . "&act=obj_insert#task_" . $task->getID() . "'>\n\t\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t\t<legend>add new objective</legend>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>name:</td>\n\t\t\t\t\t\t\t\t\t\t<td><input type='text' name='aol_name' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>type:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<select name='ao_display'>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='simple' selected='selected'>simple</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='hidden'>hidden</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='value'>value / progressbar</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='meta'>meta</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>trigger condition:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<select name='ao_condition'>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='all' selected='selected'>require all</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='any'>require any</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value='value'>value / progressbar</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>trigger value:</td>\n\t\t\t\t\t\t\t\t\t\t<td><input type='text' name='ao_value' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class='bw'>metalink:</td>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<select name='ao_metalink'>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=''> -- none --</option>";
        /*$m = $menu->getIterator();
        												while($m->hasNext()) {
        													$n = $m->getNext();
        													$html .= "<option value='' disabled='disabled'>".$n->getName()."</option>";
        
        													$m2 = $n->getIterator();
        													while($m2->hasNext()) {
        														$n2 = $m2->getNext();
        														$html .= "<option value='' 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>";
        													}
        												}*/
        $html .= $metalist;
        $html .= "</select>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td colspan='2'><input type='submit' value='add' /></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>";
        $html .= ach_render_obj_list($task->getIterator(), $task);
    }
    return $html;
}
Ejemplo n.º 6
0
function ach_render_task_open(&$ach)
{
    $html = "";
    $task_list = $ach->getOpen();
    $task = $task_list->getNext();
    if ($task->inDev()) {
        return $html;
    }
    if ($task->getName() != null) {
        $html .= "<span style='color:#999999;font-weight:bold;display:block;'>" . $task->getDisplayName() . "</span>";
    }
    if ($task->objDrawable()) {
        $html .= ach_render_obj_list($task->getIterator());
    }
    return $html;
}