This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/lib/menu.php

50 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2011-01-13 14:45:19 +00:00
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/lib/menu.php,v 1.2 2009/04/19 04:03:05 wurley Exp $
/**
* @package leenooksApp
* @author Deon George
*
* Abstract class which represents the Menu view ; the draw() method
* must be implemented by subclasses
*
* @see Menu_HTML
*/
abstract class Menu {
# Datastore server represented by this tree
protected $index = null;
protected function __construct($index) {
$this->index = $index;
}
static public function getInstance($index) {
$menu = get_cached_item($index,'menu');
if (! $menu) {
$menu = $_SESSION[APPCONFIG]->getValue('appearance','menu');
eval('$menu = new '.$menu.'($index);');
set_cached_item($index,'menu','null',$menu);
}
return $menu;
}
/**
* Get the server Object for this tree
*
* @return object Server Object for this tree
*/
protected function getServer() {
return $_SESSION[APPCONFIG]->getServer($this->index);
}
public function getDatastore() {
return isset($_SESSION[APPCONFIG]->datastore->object[$this->index]) ? $_SESSION[APPCONFIG]->datastore->object[$this->index] : null;
}
/**
* Displays the Menu
*/
abstract public function draw();
}
?>