/**
* The required files
*/
require_once(HTML_MENU_PAGE_PATH.'/MenuVertical.php');
/**
* Generates a Menu Right element
* <code>
* +----------------------------+---------+
* | | menu1
* | | menu2
* | | :
* +----------------------------+---------+
* Usage:
* $menu = new MenuRight($datareader,$text,$width,$class,$border,
* $cellpadding,$cellspacing,$summary,$caption);
* print $menu->getHtml();
* Or
* MenuRight:display($datareader,$text,$width,$class,$border,
* $cellpadding,$cellspacing,$summary,$caption);
* </code>
* @package menu
*/
class MenuRight extends MenuVertical {
/**
* Constructor
* @param DataReader $datareader The Data Reader object
* @param String $text The text header for the table
* @param String $width The Width for the table
* @param String $class The CSS Class name to use
* @param String $border The Border
* @param String $cellpadding The CellSpacing
* @param String $cellspacing The CellPadding
* @param String $summary The Summary
* @param String $caption The Caption
*/
function MenuRight($datareader='',$text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
$theText = $text !=''?$text :MENU_RIGHT_TEXT;
$theWidth = $width!=''?$width:MENU_RIGHT_VIEW_WIDTH;
$theClass = $class!=''?$class:MENU_RIGHT_VIEW_CLASS;
$theBorder = MENU_RIGHT_VIEW_BORDER;
$theCellpadding = MENU_RIGHT_VIEW_CELLPADDING;
$theCellspacing = MENU_RIGHT_VIEW_CELLSPACING;
$this->layout = LINK_LAYOUT_LI | LINK_LAYOUT_TRIANGLE;
$this->MenuVertical($datareader,$theText,$theWidth,$theClass,$theBorder,$theCellpadding,$theCellspacing,$summary,$caption);
}
/**
* Get the CSS class Name for this component
* @return String The CSS class name
*/
function getCssClass() {
return CSS_MENU_RIGHT;
}
/**
* Toogle the request parameters which will minimize or maximize this component
* @return array The array of key=>value pair
*/
function getMinimize() {
return $this->getToogle(REQUEST_LINK_SHOW, LINK_SHOW, LINK_SHOW_MENU_RIGHT);
}
/**
* Get the html for the right menu links
* @return String The html
*/
function getHtml() {
$html = $this->html;
if (LINK_SHOW & LINK_SHOW_MENU_RIGHT && HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
if (CACHE_MENU && $this->getCacheFileName(CACHE_MENU_PATH)!='' && file_exists($this->getCacheFileName(CACHE_MENU_PATH))) {
$html .= $this->content($this->getCacheFileName(CACHE_MENU_PATH));
} else {
$html .= "<!-- MenuRight -->\r\n";
$html .= $this->getColumns();
if (CACHE_MENU) {
$this->save($html, CACHE_MENU_PATH);
}
}
} else {
$html .= $this->getMaximize();
}
return $html;
}
/**
* Display html
* <code>
* Usage:
* MenuRight::display($datareader,$text,$width,$class,$border,
* $cellpadding,$cellspacing,$summary,$caption);
* </code>
* @static
* @param DataReader $datareader The Data Reader object
* @param String $text The text header for the table
* @param String $width The Width for the table
* @param String $class The CSS Class name to use
* @param String $border The Border
* @param String $cellpadding The CellSpacing
* @param String $cellspacing The CellPadding
* @param String $summary The Summary
* @param String $caption The Caption
*/
function display($datareader='',$text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
$html = new MenuRight($datareader,$text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
$html->addHtml();
}
}
?>