程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> OfficeXP_menu_classOOP版

OfficeXP_menu_classOOP版

編輯:關於PHP編程

Menu Sample EOD; } } class About { function run() { echo << body { font-size: 9pt; font-family:"Verdana", "Arial", "宋體"; }


關於此菜單
說明,此菜單程序只能使用在IE 5以上的版本使用,NetSpace下不能使用,推薦使用IE 6正式中文版
EOD; } } class Page { function run($id1) { global $id; echo << body { font-size: 9pt; font-family:"Verdana", "Arial", "宋體"; }

歡迎訪問 $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 <<SelectedItemDarkBorder; $SelectedItemLightBorder = $this->SelectedItemLightBorder; $SelectedItemBackgroundColor = $this->SelectedItemBackgroundColor; $ItemTextColor = $this->ItemTextColor; if($target == "") $target = $this->defTarget; $URL = $this->buildURL($URL); echo <<$itemLabel EOD; } /** * menuAddSubSection($Label) * 制作二級分類菜單。 * $Label = 二級分類菜單標題 */ function menuAddSubSection($ItemLabel) { $menuSubSectionBackColor = $this->menuSubSectionBackColor; $menuSubSectionFontColor = $this->menuSubSectionFontColor; echo <<$ItemLabel EOD; } /** * menuAddSubSectionLine() * 制作項目分割線,使用高度為2的圖片 */ function menuAddSubSectionLine() { echo <<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 <<MenuFontSize; $MenuBackColor = $this->MenuBackColor; echo << td { font-size: $MenuFontSize; font-family:"Verdana", "Arial", "宋體"; } 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 " "; } } 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(); } } } ?> run($key,$id); ?>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved