仿OfficeXP风格的左边版面列表
作者: 佚名 来源: 本站教程 点击: 日期: 2007-01-11
<?php
/**
* 仿OfficeXP风格的左边版面列表
* --------------------------------------------------------------------------------
* blood 于 2/19/2002 4:47:11 PM 加贴在 Visual Basic
*
* 徐祖宁(唠叨) 移植于 3/2/2002
* OOP 版
*
*/
class Frame {
function run() {
global $PHP_SELF;
echo <<<EOD
<HTML>
<HEAD>
<TITLE>Menu Sample</TITLE>
<SCRIPT LANGUAGE="JavaScript">
if (window != top) top.location.href = location.href;
</SCRIPT>
</HEAD>
<FRAMESET cols="161,*">
<FRAME MARGINWIDTH="0" SRC="$PHP_SELF?key=menu" NAME="menu" SCROLLING=no NORESIZE>
<FRAME MARGINWIDTH="0" SRC="$PHP_SELF?key=about" NAME="main" scrolling=auto NORESIZE>
</FRAMESET>
</HTML>
EOD;
}
}
class About {
function run() {
echo <<<EOD
<style>
body { font-size: 9pt; font-family:"Verdana", "Arial", "宋体"; }
</style>
<body>
<center>
<br>
<br>
关于此菜单
<br>
<br>
说明,此菜单程序只能使用在IE 5以上的版本使用,NetSpace下不能使用,推荐使用IE 6正式中文版
</center>
</body>
EOD;
}
}
class Page {
function run($id1) {
global $id;
echo <<<EOD
<style>
body { font-size: 9pt; font-family:"Verdana", "Arial", "宋体"; }
</style>
<body>
<center>
<br>
<br>
欢迎访问 $id
</center>
</body>
EOD;
}
}
class Menu {
var $MenuOn = 0; //定义分类菜单数目
var $MenuBackColor = "lightgrey"; //定义分类菜单背景颜色
var $MenuFontSize = "9pt"; //定义分类菜单字体
var $MenuBarHeight = 20; //定义分类菜单高度
var $ItemTextColor = "#000000"; //定义分类菜单项目文字颜色
var $ItemBackColor = "lightgrey"; //定义分类菜单项目背景颜色
var $TopMenuHeight = 0; //定义分类菜单与顶部的间距
var $SelectedItemDarkBorder = "#08246B"; //定义分类菜单项目在鼠标移动到上面时的暗边框颜色
var $SelectedItemLightBorder = "#08246B"; //定义分类菜单项目在鼠标移动到上面时的亮边框颜色
var $SelectedItemBackgroundColor = "#B5BED6"; //定义分类菜单项目在鼠标移动到上面时的背景颜色
var $menuSubSectionBackColor = "darkgray"; //定义二级菜单背景颜色
var $menuSubSectionFontColor = "black"; //定义二级菜单菜单字体颜色
var $defTarget = "main"; //定义菜单项目超连接默认目标框架
/**
* menuStartSection($Seq, $Label)
* 制作分类菜单
* $Seq = 分类菜单序列号,使用菜单序列号控制启动是显示顺序
* $Label = 分类菜单标题
*/
function menuStartSection($SectionSeq, $SectionName) {
$menuBackColor = $this->menuBackColor;
$MenuBarHeight = $this->MenuBarHeight;
$MenuFontSize = $this->MenuFontSize;
$menuSection = $this->menuSection;
$ItemBackColor = $this->ItemBackColor;
$mh = $this->MenuBarHeight-2;
echo <<<EOD
<table bgcolor="$menuBackColo" border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr height="1">
<td bgcolor="white"></td>
</tr>
</table>
<table bgcolor="$menuBackColor" border=1 cellspacing=0 cellpadding=0 bordercolor="$menuBackColor" width="100%" height="$mh">
<tr vAlign="center" height="100%">
<td nowrap border=3 width="100%" height="100%" bordercolordark=lightgrey bordercolorlight=lightgrey align=center style="cursor:hand;" title="$SectionName" onmouseover="status=’$SectionName’;" onmouseout="status=’’;" onclick="StartSection(menuSection$SectionSeq);">$SectionName</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr height="1">
<td bgcolor="Black"></td>
</tr>
</table>
<div name=menuSection$SectionSeq id=menuSection$SectionSeq style="display:’none’;overflow:hidden; height:1px;marginRight:0px;">
<table bgcolor=$ItemBackColor style="marginRight=0px;" border=1 cellspacing=0 cellpadding=0 bordercolor="$ItemBackColor" width="100%">
EOD;
}
/**
* menuAddItem($Label, $Description, $URL, $Target="")
* 制作菜单项目
* $Label = 项目标题
* $Description = 项目简介
* $URL = 超连接地址
* $Target = 超连接目标框架,默认为$defTarget
*/
function menuAddItem($itemLabel, $StatusText, $URL, $target="") {
$SelectedItemDarkBorder = $this->SelectedItemDarkBorder;
$SelectedItemLightBorder = $this->SelectedItemLightBorder;
$SelectedItemBackgroundColor = $this->SelectedItemBackgroundColor;
$ItemTextColor = $this->ItemTextColor;
if($target == "") $target = $this->defTarget;
$URL = $this->buildURL($URL);
echo <<<EOD
<tr>
<td width="100%" align=left style="cursor:hand;" title="$StatusText" onmouseover="this.borderColorDark=’$SelectedItemDarkBorder’;this.borderColorLight=’$SelectedItemLightBorder’;this.style.backgroundColor=’$SelectedItemBackgroundColor’;this.style.color=’black’;status=’$StatusText’;" onmouseout="this.borderColorDark=’’;this.borderColorLight=’’;this.style.backgroundColor=’’;status=’’;" onclick="window.open(’$URL’,’$target’);"><font color="$ItemTextColor">$itemLabel</font></td>
</tr>
EOD;
}
/**
* menuAddSubSection($Label)
* 制作二级分类菜单。
* $Label = 二级分类菜单标题
*/
function menuAddSubSection($ItemLabel) {
$menuSubSectionBackColor = $this->menuSubSectionBackColor;
$menuSubSectionFontColor = $this->menuSubSectionFontColor;
echo <<<EOD
<tr bgcolor="$menuSubSectionBackColor">
<td align=center width="100%"><font color="$menuSubSectionFontColor">$ItemLabel</font></td>
</tr>
EOD;
}
/**
* menuAddSubSectionLine()
* 制作项目分割线,使用高度为2的图片
*/
function menuAddSubSectionLine() {
echo <<<EOD
<tr vAlign="center">
<td align=center width="100%" height="2" bgcolor="white">
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr vAlign="center" height="2">
<td bgcolor="white"></td>
</tr>
</table>
</td>
</tr>
EOD;
}
/**
* menuEndSection()
* 分类菜单结束
*/
function menuEndSection() {
echo <<<EOD
</table>
</div>
EOD;
}
/**
* menuSectionAsItem($Label, $Description, $URL, $Target="")
* 制作带超连接的分类菜单,类似菜单项目,可以直接使用
* $Label = 分类菜单标题
* $Description = 分类菜单简介
* $URL = 超连接地址
* $Target = 超连接目标框架,默认为$defTarget
*/
function menuSectionAsItem($SectionSeq, $SectionName, $SectionDesc, $URL, $target="") {
$menuBackColor = $this->menuBackColor;
$MenuBarHeight = $this->MenuBarHeight;
if($target == "") $target = $this->defTarget;
$URL = $this->buildURL($URL);
$mh
【文章评论 】
【收藏本文 】
【推荐好友 】
【打印本文 】
【论坛讨论 】
相关文章:
文章评论: (条)
责任编辑:一分 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。