2012-06-25 13:04:51 +00:00
|
|
|
<?php
|
2012-07-02 16:56:13 +00:00
|
|
|
class AdmCategory extends AchCategory {
|
2012-08-20 13:52:35 +00:00
|
|
|
#########################
|
|
|
|
# PHP 5.3 compatible
|
|
|
|
# AdmDispatcher_trait replaces this in PHP 5.4
|
|
|
|
|
2012-08-07 15:41:50 +00:00
|
|
|
|
|
|
|
function removeNode($id) {
|
|
|
|
$res = $this->getChildDataByID($id);
|
|
|
|
if($res != null) {
|
|
|
|
$res->delete_me();
|
|
|
|
$this->removeChild($id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateNode($id) { // PROBABLY USELESS!
|
|
|
|
$res = $this->getChildDataByID($id);
|
|
|
|
if($res != null) {
|
|
|
|
$res->update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getPathID($path = "") {
|
|
|
|
if($path != "") {
|
|
|
|
$path = ";".$path;
|
|
|
|
}
|
|
|
|
$path = $this->getID().$path;
|
|
|
|
if($this->parent != null) {
|
|
|
|
return $this->parent->getPathID($path);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $path;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getElementByPath($pid) {
|
|
|
|
$tmp = explode(";",$pid);
|
|
|
|
if($tmp[0] == $this->getID()) {
|
|
|
|
if(sizeof($tmp) > 1) {
|
|
|
|
$c = $this->getChildDataByID($tmp[1]);
|
|
|
|
if($c != null) {
|
|
|
|
unset($tmp[0]);
|
|
|
|
return $c->getElementByPath(implode(";",$tmp));
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2012-08-20 13:52:35 +00:00
|
|
|
#########################
|
2012-06-25 13:04:51 +00:00
|
|
|
|
2012-07-08 16:11:25 +00:00
|
|
|
function AdmCategory($id,$race,$cult = null,$civ = null) {
|
|
|
|
parent::__construct($id,$race,$cult,$civ);
|
2012-06-25 13:04:51 +00:00
|
|
|
}
|
|
|
|
|
2012-07-02 16:56:13 +00:00
|
|
|
protected function makeChild($d) {
|
2012-08-20 13:52:35 +00:00
|
|
|
$a = new AdmAchievement($d,$this);
|
|
|
|
return $a;
|
2012-06-25 13:04:51 +00:00
|
|
|
}
|
2012-07-02 16:56:13 +00:00
|
|
|
|
|
|
|
#@overrides AdmDispatcher::insertNode()
|
|
|
|
function insertNode($n) {
|
2012-06-25 13:04:51 +00:00
|
|
|
$n->insert();
|
2012-07-02 16:56:13 +00:00
|
|
|
$this->addOpen($n);
|
2012-06-25 13:04:51 +00:00
|
|
|
}
|
2012-12-10 14:07:13 +00:00
|
|
|
|
|
|
|
function setLang($lang,$txt) {
|
|
|
|
global $DBc;
|
|
|
|
|
|
|
|
$DBc->sqlQuery("INSERT INTO ach_category_lang (acl_category,acl_lang,acl_name) VALUES ('".$this->getID()."','".$DBc->sqlEscape($lang)."','".$DBc->sqlEscape($txt)."') ON DUPLICATE KEY UPDATE acl_name='".$DBc->sqlEscape($txt)."'");
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLang($lang) {
|
|
|
|
global $DBc;
|
|
|
|
|
|
|
|
$res = $DBc->sqlQuery("SELECT acl_name FROM ach_category_lang WHERE acl_category='".$this->getID()."' AND acl_lang='".$DBc->sqlEscape($lang)."'");
|
|
|
|
return $res[0]['acl_name'];
|
|
|
|
}
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
global $DBc;
|
|
|
|
}
|
2012-06-25 13:04:51 +00:00
|
|
|
}
|
|
|
|
?>
|