<?php
/**
* Imitation officexp style of the left page list
* --------------------------------------------------------------------------------
* Blood to 2/19/2002 4:47:11 PM affixed to Visual Basic
*
* Xu Zuning (nagging) transplanted in 3/2/2002
* OOP Version
*
*/
Class About {
function Run () {
Echo <<<eod
<style>
body {font-size:9pt; font-family: "Verdana", "Arial", "Song";}
</style>
<body>
<center>
<br>
<br>
About this menu
<br>
<br>
Description, this menu program can only be used in the version above IE 5, netspace can not be used, the recommended use of IE 6 official Chinese version
</center>
</body>
EOD;
}
}
Class Page {
function run ($id 1) {
Global $id;
Echo <<<eod
<style>
body {font-size:9pt; font-family: "Verdana", "Arial", "Song";}
</style>
<body>
<center>
<br>
<br>
Welcome to visit $id
</center>
</body>
EOD;
}
}
Class Menu {
var $MenuOn = 0; Define the number of category menus
var $MenuBackColor = "Lightgrey"; Define category Menu Background color
var $MenuFontSize = "9pt"; Define Category Menu Font
var $MenuBarHeight = 20; Define category Menu Height
var $ItemTextColor = "#000000"; Define category menu item text color
var $ItemBackColor = "Lightgrey"; Define category menu item background color
var $TopMenuHeight = 0; Define the spacing between the category menu and the top
var $SelectedItemDarkBorder = "#08246B"; Defines the dark border color of a category menu item when the mouse is moved above
var $SelectedItemLightBorder = "#08246B"; Defines the light border color of a category menu item when the mouse is moved above
var $SelectedItemBackgroundColor = "#B5BED6"; Defines the background color of a category menu item when the mouse is moved above
var $menuSubSectionBackColor = "Darkgray"; Define level two menu background color
var $menuSubSectionFontColor = "Black"; Define level two menu font color
var $defTarget = "main"; Define a menu item hyperlink default target frame
/**
* Menustartsection ($Seq, $Label)
* Make category Menu
* $Seq = Category Menu serial number, use menu serial number to control boot is display order
* $Label = Category Menu Title
*/
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
/**
* Menuaddsubsectionline ()
* Production of Project segmentation line, using a height of 2 pictures
*/
function Menuaddsubsectionline () {
Echo <<<eod
/**
* Menuendsection ()
* Category Menu End
*/
function Menuendsection () {
Echo <<<eod
</table>
</div>
EOD;
}
/**
* Menusectionasitem ($Label, $Description, $URL, $Target = "")
* Make a category menu with a hyperlink, similar to a menu item, can be used directly
* $Label = Category Menu Title
* $Description = Category Menu Introduction
* $URL = Super Connection Address
* $Target = Hyperlink target frame, defaults to $deftarget
*/
function Menusectionasitem ($SectionSeq, $SectionName, $SectionDesc, $URL, $target = "") {
$menuBackColor = $this->menubackcolor;
$MenuBarHeight = $this->menubarheight;
/**
* Replace the space in the hyperlink with the + number
*/
function BuildUrl ($inURL) {
Return Str_replace ("", "+", $inURL);
}
/**
* Output JavaScript Script
*/
function Scriptout () {
$DH = $this->topmenuheight+ ($this->menubarheight * $this->menuon);
Echo <<<eod
<script language=javascript>
var availheight//Definition of Available heights
var lastsection//Defines the menu that will be opened to close
var thissection//Define the menu you want to open now
var timerdelay=15//define and set latency
var Menuactive=false//Determination of current active menu
var visibleheight//Defines display height, determines whether scroll bars are displayed
var aniratio//Definition menu shows the speed of sliding
function getsizing () {
The available height when the menu is opened
availheight=document.body.clientheight-$DH
if (availheight<=0) {
Lastsection.style.display= ' None ';
}else {
Change the ratio of menu display sliding speed
aniratio=0.75; Set speed
if (availheight>200) {aniratio=0.667;}
if (availheight>500) {aniratio=0.5}///According to the available height adjustment speed
Lastsection.style.height=availheight;
lastsection.style.overflow= ' visible ';
Lastsection.style.display= ';
Visibleheight=parseint (Lastsection.clientheight);
if (visibleheight>availheight) {lastsection.style.overflow= ' auto ';} else{lastsection.style.overflow= ' hidden ';
}
}
function Slidemenu () {
Menu Slide function
if (parseint (LastSection.style.height) >1) {
Lastsection.style.height=parseint (parseint (LastSection.style.height) *aniratio);
Thissection.style.height=availheight-parseint (LastSection.style.height);
var movetimer=settimeout ("Slidemenu ()", timerdelay);
}else {
Complete menu slide, show new open menu, Hide front to open menu
Lastsection.style.display= ' None ';
Thissection.style.height=availheight;
Menuactive=false;
if (visibleheight>availheight) {thissection.style.overflow= ' auto ';};
thissection.style.marginright=0;
Lastsection=thissection;
Cleartimeout (Movetimer);
}
}
function Startsection (thesection) {
Start the slide menu to detect whether the menu is clicked
if (Menuactive==false) {
if (lastsection!=thesection) {
Menuactive=true;
Thissection=thesection;
lastsection.style.overflow= ' hidden ';
thissection.style.overflow= ' visible ';
Thissection.style.display= ';
Visibleheight=parseint (Thissection.clientheight);
thissection.style.overflow= ' hidden ';
Thissection.style.display= ' None ';
Thissection.style.height=1;
lastsection.style.height=availheight-1;
Lastsection.style.display= ';
Thissection.style.display= ';
Slidemenu ()
}
}
}
Window.onresize=getsizing
Open a menu with the default ordinal number first on startup
Lastsection=document.all.menusection1;
Lastsection.style.display= ';
Getsizing ();
</script>
EOD;
}
$this->menustartsection (1, "personal favorites");
$this->menuadditem ("dotnet Times", "Welcome to the dotnet Era", "$PHP _self?key=page&id=dotnet era");
$this->menuendsection ();
Set personal favorites as Startup menu
$this->menuon = 4;
$this->scriptout ();
echo "</body>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 ();
}
}
}
?>
<?php
/** Run **/
$app = new Application;
$app->run ($key, $id);
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.