";
if($_ADMIN->isAdmin()) {
$c .= " Admin
";
}
if($_ADMIN->isCSR()) {
$c .= " CSR
";
}
#$c .= ach_render_menu();
$c .= " |
";
if($_REQUEST['mode'] == "lang" && $_ADMIN->isAdmin()) {
$c .= "Language Editor";
$user = array();
$user['id'] = 0;
$user['lang'] = 'en';
$user['name'] = 'Talvela';
$user['race'] = "r_matis";
$user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral";
$_USER = new RyzomUser($user);
//menu
require_once("include/adm_render_lang.php");
$menu = new AdmMenu($_REQUEST['cat']);
$c .= "
";
$c .= adm_render_menu($menu);
$c .= " |
";
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AdmCategory($open,'%','%','%');
if($_REQUEST['act'] == "insert_atom") {
$obj = $cat->getElementByPath($_REQUEST['id']);
if($obj != null) {
$atom = new AdmAtom(array(),$obj);
$atom->setRuleset($_REQUEST['atom_ruleset']);
$atom->setMandatory($_REQUEST['atom_mandatory']);
$atom->setObjective($obj->getID());
$obj->insertNode($atom);
}
}
if($_REQUEST['act'] == "update_atom") {
$atom = $cat->getElementByPath($_REQUEST['id']);
if($atom != null) {
$atom->setRuleset($_REQUEST['atom_ruleset']);
$atom->setMandatory($_REQUEST['atom_mandatory']);
$atom->update();
}
}
if($_REQUEST['act'] == "delete") {
$elem = $cat->getElementByPath($_REQUEST['id']);
$par = $elem->getParent();
$par->removeNode($elem->getID());
}
$c .= atom_render_category($cat);
}
#a:p:o:a
$c .= " |
";
}
if($_REQUEST['mode'] == "atom" && $_ADMIN->isAdmin()) {
$c .= "Tigger Settings";
$user = array();
$user['id'] = 0;
$user['lang'] = 'en';
$user['name'] = 'Talvela';
$user['race'] = "r_matis";
$user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral";
$_USER = new RyzomUser($user);
//menu
require_once("include/adm_render_atom.php");
$menu = new AdmMenu($_REQUEST['cat']);
$c .= "
";
$c .= adm_render_menu($menu);
$c .= " |
";
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AdmCategory($open,'%','%','%');
if($_REQUEST['act'] == "insert_atom") {
$obj = $cat->getElementByPath($_REQUEST['id']);
if($obj != null) {
$atom = new AdmAtom(array(),$obj);
$atom->setRuleset($_REQUEST['atom_ruleset']);
$atom->setMandatory($_REQUEST['atom_mandatory']);
$atom->setObjective($obj->getID());
$obj->insertNode($atom);
}
}
if($_REQUEST['act'] == "update_atom") {
$atom = $cat->getElementByPath($_REQUEST['id']);
if($atom != null) {
$atom->setRuleset($_REQUEST['atom_ruleset']);
$atom->setMandatory($_REQUEST['atom_mandatory']);
$atom->update();
}
}
if($_REQUEST['act'] == "delete") {
$elem = $cat->getElementByPath($_REQUEST['id']);
$par = $elem->getParent();
$par->removeNode($elem->getID());
}
$c .= atom_render_category($cat);
}
#a:p:o:a
$c .= " |
";
}
if($_REQUEST['mode'] == "menu" && $_ADMIN->isAdmin()) {
$c .= "Menu Settings";
$user = array();
$user['id'] = 1;
$user['lang'] = 'en';
$user['name'] = 'Talvela';
$user['race'] = "r_matis";
$user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral";
$_USER = new RyzomUser($user);
require_once("include/adm_render_menu.php");
$menu = new AdmMenu(false);
if($_REQUEST['act'] == "insert") {
$n = new AdmMenuNode(array(),null);
$n->setID(null);
$n->setInDev(true);
$n->setName($_REQUEST['acl_name']);
$n->setImage($_REQUEST['ac_image']);
$n->setParentID($_REQUEST['ac_parent']);
$menu->insertNode($n);
}
if($_REQUEST['act'] == "delete") {
$menu->removeNode($_REQUEST['ac_id']);
}
if($_REQUEST['act'] == "update") {
$menu->updateNode($_REQUEST['ac_id'],array("acl_name"=>$_REQUEST['acl_name'],"ac_image"=>$_REQUEST['ac_image']));
}
if($_REQUEST['act'] == "dev") {
$curr = $menu->getNode($_REQUEST['ac_id']);
$curr->setInDev(($_REQUEST['state'] != 1));
}
$c .= adm_render_menu($menu);
}
if($_REQUEST['mode'] == "ach" && $_ADMIN->isAdmin()) {
$c .= "Achievement Settings";
$user = array();
$user['id'] = 0;
$user['lang'] = 'en';
$user['name'] = 'Talvela';
$user['race'] = "r_matis";
$user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral";
$_USER = new RyzomUser($user);
//menu
require_once("include/adm_render_ach.php");
$menu = new AdmMenu($_REQUEST['cat']);
$c .= "
";
$c .= adm_render_menu($menu);
$c .= " |
";
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new AdmCategory($open,$_REQUEST['race'],$_REQUEST['cult'],$_REQUEST['civ']);
if($_REQUEST['act'] == "ach_move") {
$ach = $cat->getChildDataByID($_REQUEST['id']);
if($ach != null) {
$ach->setCategory($_REQUEST['new_cat']);
$ach->update();
$cat->removeChild($ach->getID());
}
}
if($_REQUEST['act'] == "ach_insert") {
$ach = new AdmAchievement(array(),$cat);
$ach->setCategory($cat->getID());
$ach->setName($_REQUEST['aal_name']);
$ach->setTemplate($_REQUEST['aal_template']);
$ach->setTieCult($_REQUEST['aa_tie_cult']);
$ach->setTieCiv($_REQUEST['aa_tie_civ']);
$ach->setImage($_REQUEST['aa_image']);
$cat->insertNode($ach);
$perk = new AdmPerk(array(),$ach);
$perk->setAchievement($ach->getID());
$perk->setName($_REQUEST['apl_name']);
$perk->setTemplate($_REQUEST['apl_template']);
$perk->setValue($_REQUEST['ap_value']);
$perk->setCondition($_REQUEST['ap_condition']);
$perk->setConditionValue($_REQUEST['ap_condition_value']);
$ach->insertNode($perk);
}
if($_REQUEST['act'] == "ach_update") {
$ach = $cat->getChildDataByID($_REQUEST['id']);
if($ach != null) {
$ach->setName($_REQUEST['aal_name']);
$ach->setTemplate($_REQUEST['aal_template']);
$ach->setTieCult($_REQUEST['aa_tie_cult']);
$ach->setTieCiv($_REQUEST['aa_tie_civ']);
$ach->setImage($_REQUEST['aa_image']);
$ach->update();
}
}
if($_REQUEST['act'] == "perk_insert") {
$ach = $cat->getChildDataByID($_REQUEST['id']);
if($ach != null) {
$perk = new AdmPerk(array(),$ach);
$perk->setAchievement($ach->getID());
$perk->setName($_REQUEST['apl_name']);
$perk->setTemplate($_REQUEST['apl_template']);
$perk->setValue($_REQUEST['ap_value']);
#MISSING: parent
$perk->setParentID($_REQUEST['ap_parent']);
$perk->setCondition($_REQUEST['ap_condition']);
$perk->setConditionValue($_REQUEST['ap_condition_value']);
$ach->insertNode($perk);
$ach->orderPerks();
$perk->update();
}
}
if($_REQUEST['act'] == "perk_update") {
$perk = $cat->getElementByPath($_REQUEST['id']);
if($perk != null) {
$perk->setName($_REQUEST['apl_name']);
$perk->setTemplate($_REQUEST['apl_template']);
$perk->setValue($_REQUEST['ap_value']);
$perk->setParentID($_REQUEST['ap_parent']);
$perk->setCondition($_REQUEST['ap_condition']);
$perk->setConditionValue($_REQUEST['ap_condition_value']);
$ach = $perk->getParent();
$ach->orderPerks();
$perk->update();
}
}
if($_REQUEST['act'] == "obj_insert") {
$perk = $cat->getElementByPath($_REQUEST['id']);
if($perk != null) {
$obj = new AdmObjective(array(),$perk);
$obj->setName($_REQUEST['aol_name']);
$obj->setCondition($_REQUEST['ao_condition']);
$obj->setValue($_REQUEST['ao_value']);
$obj->setDisplay($_REQUEST['ao_display']);
$obj->setMetalink($_REQUEST['ao_metalink']);
$obj->setPerk($perk->getID());
$perk->insertNode($obj);
}
}
if($_REQUEST['act'] == "obj_update") {
$obj = $cat->getElementByPath($_REQUEST['id']);
if($obj != null) {
$obj->setName($_REQUEST['aol_name']);
$obj->setCondition($_REQUEST['ao_condition']);
$obj->setValue($_REQUEST['ao_value']);
$obj->setDisplay($_REQUEST['ao_display']);
$obj->setMetalink($_REQUEST['ao_metalink']);
$obj->update();
}
}
if($_REQUEST['act'] == "delete") {
$elem = $cat->getElementByPath($_REQUEST['id']);
$par = $elem->getParent();
$par->removeNode($elem->getID());
}
if($_REQUEST['act'] == "dev") {
$curr = $cat->getElementByPath($_REQUEST['id']);
$curr->setInDev(($_REQUEST['state'] != 1));
}
$c .= adm_render_category($cat);
}
#a:p:o:a
$c .= " |
";
//category
}
if($_REQUEST['mode'] == "player" && $_ADMIN->isCSR()) {
$c .= "Player Administration";
$DBc_char = new mySQL($_CONF['mysql_error']);
$DBc_char->connect($_CONF['char_mysql_server'],$_CONF['char_mysql_user'],$_CONF['char_mysql_pass'],$_CONF['char_mysql_database']);
//menu
require_once("include/adm_render_csr.php");
if(!is_user($_REQUEST['pid'])) { // no user ID
$c .= csr_render_find_player();
}
else {
$user = array();
$user['id'] = $_REQUEST['pid'];
$user['lang'] = 'en';
$user['name'] = 'Talvela';
$user['race'] = "r_matis";
$user['civilization'] = "c_neutral";
$user['cult'] = "c_neutral";
$_USER = new RyzomUser($user);
$menu = new AchMenu($_REQUEST['cat']);
$open = $menu->getOpenCat();
if($open != 0) {
$cat = new CSRCategory($open,null,$_REQUEST['cult'],$_REQUEST['civ']);
if($_REQUEST['grant'] != "") {
$cat->grantNode($_REQUEST['grant'],$_USER->getID());
}
if($_REQUEST['deny'] != "") {
$cat->denyNode($_REQUEST['deny'],$_USER->getID());
}
}
$c .= "
".csr_render_yubopoints($user['id'])." |
";
$c .= csr_render_menu($menu);
$c .= " |
";
$open = $menu->getOpenCat();
if($open != 0) {
$c .= csr_render_category($cat);
}
$c .= " |
";
}
}
#$c .= ach_render_content();
$c .= " |