仿OfficeXP风格的左边版面列表_PHP
程序员文章站
2022-04-21 07:51:04
...
/**
* 仿OfficeXP风格的左边版面列表
* --------------------------------------------------------------------------------
* blood 于 2/19/2002 4:47:11 PM 加贴在 Visual Basic
*
* 徐祖宁(唠叨) 移植于 3/2/2002
* OOP 版
*
*/
class Frame {
function run() {
global $PHP_SELF;
echo
Menu Sample
EOD;
}
}
class About {
function run() {
echo
关于此菜单
说明,此菜单程序只能使用在IE 5以上的版本使用,NetSpace下不能使用,推荐使用IE 6正式中文版
EOD;
}
}
class Page {
function run($id1) {
global $id;
echo
欢迎访问 $id
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;
}
/**
* 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 = $this->MenuBarHeight-2;
echo
EOD;
}
/**
* 将超连接中的空格替换为+号
*/
function buildURL($inURL) {
return str_replace(" ","+",$inURL);
}
/**
* 输出javascript脚本
*/
function scriptOut() {
$dh = $this->TopMenuHeight+($this->MenuBarHeight * $this->menuOn);
echo
EOD;
}
function run() {
global $PHP_SELF;
$MenuFontSize = $this->MenuFontSize;
$MenuBackColor = $this->MenuBackColor;
echo
EOD;
/**
* 创建菜单
*/
$this->menuStartSection(2, "代码世界");
$this->menuAddItem("Joy ASP", "欢迎访问Joy ASP", "$PHP_SELF?key=page&id=Joy ASP");
$this->menuAddItem("Java 世界", "欢迎访问Java 世界", "$PHP_SELF?key=page&id=Java 世界");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuAddItem("Visual Basic", "欢迎访问Visual Basic", "$PHP_SELF?key=page&id=Visual Basic");
$this->menuAddItem("Delphi", "欢迎访问Delphi", "$PHP_SELF?key=page&id=Delphi");
$this->menuEndSection();
$this->menuStartSection(3, "开心一刻");
$this->menuAddItem("传统笑话", "传统笑话", "$PHP_SELF?key=page&id=传统笑话");
$this->menuAddItem("近代笑话", "近代笑话", "$PHP_SELF?key=page&id=近代笑话");
$this->menuAddSubSection("儿童类");
$this->menuAddItem("校园笑话", "校园笑话", "$PHP_SELF?key=page&id=校园笑话");
$this->menuAddItem("幼儿笑话", "幼儿笑话", "$PHP_SELF?key=page&id=幼儿笑话");
$this->menuAddItem("少年笑话", "少年笑话", "$PHP_SELF?key=page&id=少年笑话");
$this->menuAddSubSectionLine();
$this->menuAddItem("中学时代笑话", "中学时代笑话", "$PHP_SELF?key=page&id=中学时代笑话");
$this->menuAddSubSection("成人笑话");
$this->menuAddItem("带颜色的笑话", "带颜色的笑话", "$PHP_SELF?key=page&id=带颜色的笑话");
$this->menuAddItem("笑话林", "笑话林", "$PHP_SELF?key=page&id=笑话林");
$this->menuEndSection();
$this->menuSectionAsItem(3, "菜单简介", "菜单简介", "$PHP_SELF?key=about");
$this->menuStartSection(1, "个人收藏夹");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuEndSection();
// 将个人收藏夹定为启动菜单
$this->menuOn = 4;
$this->scriptOut();
echo "\n";
}
}
class Application {
var $frame;
var $menu;
var $page;
var $about;
function Application() {
$this->frame = new Frame;
$this->about = new About;
$this->page = new Page;
$this->menu = new Menu;
}
function run($key,$id="") {
switch($key) {
case "menu":
$this->menu->run();
break;
case "page":
$this->page->run($id);
break;
case "about":
$this->about->run();
break;
default:
$this->frame->run();
}
}
}
?>
/** 运行 **/
$app = new Application;
$app->run($key,$id);
?>
* 仿OfficeXP风格的左边版面列表
* --------------------------------------------------------------------------------
* blood 于 2/19/2002 4:47:11 PM 加贴在 Visual Basic
*
* 徐祖宁(唠叨) 移植于 3/2/2002
* OOP 版
*
*/
class Frame {
function run() {
global $PHP_SELF;
echo
EOD;
}
}
class About {
function run() {
echo
关于此菜单
说明,此菜单程序只能使用在IE 5以上的版本使用,NetSpace下不能使用,推荐使用IE 6正式中文版
EOD;
}
}
class Page {
function run($id1) {
global $id;
echo
欢迎访问 $id
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
$SectionName |
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 = $this->MenuBarHeight-2;
echo
$SectionName |
EOD;
}
/**
* 将超连接中的空格替换为+号
*/
function buildURL($inURL) {
return str_replace(" ","+",$inURL);
}
/**
* 输出javascript脚本
*/
function scriptOut() {
$dh = $this->TopMenuHeight+($this->MenuBarHeight * $this->menuOn);
echo
EOD;
}
function run() {
global $PHP_SELF;
$MenuFontSize = $this->MenuFontSize;
$MenuBackColor = $this->MenuBackColor;
echo
EOD;
/**
* 创建菜单
*/
$this->menuStartSection(2, "代码世界");
$this->menuAddItem("Joy ASP", "欢迎访问Joy ASP", "$PHP_SELF?key=page&id=Joy ASP");
$this->menuAddItem("Java 世界", "欢迎访问Java 世界", "$PHP_SELF?key=page&id=Java 世界");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuAddItem("Visual Basic", "欢迎访问Visual Basic", "$PHP_SELF?key=page&id=Visual Basic");
$this->menuAddItem("Delphi", "欢迎访问Delphi", "$PHP_SELF?key=page&id=Delphi");
$this->menuEndSection();
$this->menuStartSection(3, "开心一刻");
$this->menuAddItem("传统笑话", "传统笑话", "$PHP_SELF?key=page&id=传统笑话");
$this->menuAddItem("近代笑话", "近代笑话", "$PHP_SELF?key=page&id=近代笑话");
$this->menuAddSubSection("儿童类");
$this->menuAddItem("校园笑话", "校园笑话", "$PHP_SELF?key=page&id=校园笑话");
$this->menuAddItem("幼儿笑话", "幼儿笑话", "$PHP_SELF?key=page&id=幼儿笑话");
$this->menuAddItem("少年笑话", "少年笑话", "$PHP_SELF?key=page&id=少年笑话");
$this->menuAddSubSectionLine();
$this->menuAddItem("中学时代笑话", "中学时代笑话", "$PHP_SELF?key=page&id=中学时代笑话");
$this->menuAddSubSection("成人笑话");
$this->menuAddItem("带颜色的笑话", "带颜色的笑话", "$PHP_SELF?key=page&id=带颜色的笑话");
$this->menuAddItem("笑话林", "笑话林", "$PHP_SELF?key=page&id=笑话林");
$this->menuEndSection();
$this->menuSectionAsItem(3, "菜单简介", "菜单简介", "$PHP_SELF?key=about");
$this->menuStartSection(1, "个人收藏夹");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuEndSection();
// 将个人收藏夹定为启动菜单
$this->menuOn = 4;
$this->scriptOut();
echo "\n";
}
}
class Application {
var $frame;
var $menu;
var $page;
var $about;
function Application() {
$this->frame = new Frame;
$this->about = new About;
$this->page = new Page;
$this->menu = new Menu;
}
function run($key,$id="") {
switch($key) {
case "menu":
$this->menu->run();
break;
case "page":
$this->page->run($id);
break;
case "about":
$this->about->run();
break;
default:
$this->frame->run();
}
}
}
?>
/** 运行 **/
$app = new Application;
$app->run($key,$id);
?>
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
相关文章
相关视频
- 详解win10下PHP的安装配置(以php5.6为...
- php Swoole实现毫秒定时计划任务(详解)
- 一文详解Windows和Linux环境下怎么安装配...
- 【DTM】PHP协程客户端v0.1 beta版本发...
- 仿OfficeXP风格的左边版面列表_PHP
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
- 最新文章
- 热门排行
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论