.
*/ ?>
*
* -
*
*
*
*
*
*
*
*
**/
class MNavbar {
var $type;
var $node;
var $children;
var $code;
var $items = array();
public function MNavbar() {
$this->code = '';
}
public function ReceiveNode($node) {
$this->node = $node;
$this->type = $node->GetAttribute('type');
$this->ProcessChildren();
}
/**
* Contains the code inside the tag, if any,
* In almost all cases you should prepare a response to this.
**/
private function ProcessChildren() {
$children = $this->node->GetChildren();
foreach($children as $child) {
if(!$child->GetAttribute('link')) {
$child->SetAttribute('link', '#');
}
$this->code .= "
" . $child->GetAttribute('name') . "";
if($child->HasChildren()) {
$this->code .= "";
}
$this->code .= "";
}
}
// What action should the Parser take with the output, if any
public function ModuleAction() {
return array(
'set' => 'navbar'
);
}
/**
* Display module, return success/fail (true|false)
* @NOTE: Whatever is displayed will replace everything between the
* open and closing tag, so, try not to lose info! At the least log
* an error if more is taken in than can be used.
**/
public function Display() {
echo "";
return true;
}
}
?>