Show class.1.php syntax highlighted
<?php
class module_menu extends module_class {
public $items = array ();
function _getResources() {
$TA = new TA($this->_current);
$TA->addQuery(TA::SELECT,"xcs_module_menu");
$TA->addParam("name");
$TA->addParam("link");
$TA->ORDER("name",TA::ASCENDING);
$TA->Execute();
$category = $this->_current->output__items;
$this->_createResource($category);
while ($object=$TA->Result()->FetchObject()) {
$this->_addResource($category,$object->name,$object->link);
}
$TA->End();
return $this->_returnResources();
}
function getItems() {
$TA = new TA($this->_current);
$TA->addQuery(TA::SELECT,"xcs_module_menu");
$TA->WHERE("`status`='1' AND (`group`='0' OR `group`='".User::$profile->group."')");
$TA->ORDER("height",TA::ASCENDING);
$TA->Execute();
while ($result = $TA->Result()->FetchObject()) {
$result->link = str_replace("&","&",$result->link);
$this->items[] = $result;
}
$TA->End();
}
}
class module_menu_admin extends module_class {
public $items = array ();
function getItems() {
global $XCS;
$TA = new TA($this->_current);
$TA->addQuery(TA::SELECT,"xcs_module_menu","items");
$TA->ORDER("height",TA::ASCENDING);
$TA->addQuery(TA::SELECT,"xcs_engine_ranks","ranks");
$TA->Execute();
$ranks = array ();
while ($rank = $TA->Result("ranks")->FetchObject()) {
$ranks[] = $rank;
}
while ($item = $TA->Result("items")->FetchObject()) {
for ($i = 0; $i < sizeof($ranks); $i ++) {
if ($item->group == 0) {
$item->rank = $XCS->localeString("engine", "group0");
break;
}
if ($ranks[$i]->group == $item->group) {
$item->rank = $ranks[$i]->rank;
break;
}
}
$item->link = str_replace("&","&",$item->link);
$this->items[] = $item;
}
$TA->End();
}
function getItemByID($id) {
$TA = new TA($this->_current);
$TA->addQuery(TA::SELECT,"xcs_module_menu");
$TA->WHERE("id=".$id);
$TA->LIMIT(1);
$TA->Execute();
$retval = $TA->Result()->FetchObject();
$retval->link = str_replace("&","&",$retval->link);
$TA->End();
return $retval;
}
function getNextHeight() {
$TA = new TA($this->_current);
$TA->addQuery(TA::SELECT,"xcs_module_menu");
$TA->addParam("height");
$TA->ORDER("height",TA::DESCENDING);
$TA->LIMIT(1);
$TA->Execute();
$result = $TA->Result()->FetchObject();
$TA->End();
if (!$result)
$retval = 0;
else
$retval = $result->height + 1;
return $retval;
}
}
?>
See more files for this project here