Imitation officexp style left page list

Source: Internet
Author: User
Tags define definition border color dotnet version
<?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 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", "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

<table bgcolor= "$menuBackColo" border=0 cellspacing=0 cellpadding=0 width= "100%" height= "1" >
<tr height= "1" >
&LT;TD bgcolor= "White" ></td>
</tr>
</table>
<table bgcolor= "$menuBackColor" border=1 cellspacing=0 cellpadding=0 bordercolor= "$menuBackColor" width= "100%" height= "$MH" >
&LT;TR valign= "center" height= "100%" >
&LT;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" >
&LT;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 = "")
* Make menu items
* $Label = Project Title
* $Description = Project Introduction
* $URL = Super Connection Address
* $Target = Hyperlink target frame, defaults to $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>
&LT;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)
* Create category two menu.
* $Label = Level two category menu title
*/
function Menuaddsubsection ($ItemLabel) {
$menuSubSectionBackColor = $this->menusubsectionbackcolor;
$menuSubSectionFontColor = $this->menusubsectionfontcolor;
Echo <<<eod

<tr bgcolor= "$menuSubSectionBackColor" >
&LT;TD align=center width= "100%" ><font color= "$menuSubSectionFontColor" > $ItemLabel </font></td >
</tr>
EOD;
}

/**
* Menuaddsubsectionline ()
* Production of Project segmentation line, using a height of 2 pictures
*/
function Menuaddsubsectionline () {
Echo <<<eod

&LT;TR valign= "center" >
&LT;TD align=center width= "100%" height= "2" bgcolor= "White" >
<table border=0 cellspacing=0 cellpadding=0 width= "100%" height= "1" >
&LT;TR valign= "center" height= "2" >
&LT;TD bgcolor= "White" ></td>
</tr>
</table>
</td>
</tr>
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;

if ($target = = "") $target = $this->deftarget;
$URL = $this->buildurl ($URL);
$MH = $this->menubarheight-2;
Echo <<<eod

<table border=0 cellspacing=0 cellpadding=0 width= "100%" height= "1" >
&LT;TR valign= "Center" height= "1" >
&LT;TD bgcolor= "White" ></td>
</tr>
</table>
<table bgcolor= "$menuBackColor" border=1 cellspacing=0 cellpadding=0 bordercolor= "$menuBackColor" width= "100%" height= "SMH" >
<tr height= "100%" valign= "Center" >
&LT;TD border=3 valign= "Middle" width= "100%" height= "100%" Bordercolordark=lightgrey Bordercolorlight=lightgrey =center style= "Cursor:hand", "title=" $SectionDesc "onmouseover=" status= ' $SectionDesc '; "onmouseout=" status= ";" onclick= "window.open (' $URL ', ' $target ');" ><font color= "#000000" > $SectionName </font></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width= "100%" height= "1" >
<tr height= "1" >
&LT;TD bgcolor= "BLACK" ></td>
</tr>
</table>
EOD;
}

/**
* 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;
}

function Run () {
Global $PHP _self;
$MenuFontSize = $this->menufontsize;
$MenuBackColor = $this->menubackcolor;
Echo <<<eod
<style>
TD {Font-size: $MenuFontSize; font-family: "Verdana", "Arial", "Song Body";}
</style>
<body leftmargin=0 topmargin=0 rightmargin=0 bgcolor= "$MenuBackColor" >
EOD;

/**
* Create Menu
*/
$this->menustartsection (2, "Code World");
$this->menuadditem ("Joy ASP", "Welcome to Joy ASP", "$PHP _self?key=page&id=joy asp");
$this->menuadditem ("Java World", "Welcome to the Java World", "$PHP _self?key=page&id=java World");
$this->menuadditem ("dotnet Times", "Welcome to the dotnet Era", "$PHP _self?key=page&id=dotnet era");
$this->menuadditem ("Visual Basic", "Welcome to Visual Basic", "$PHP _self?key=page&id=visual basic");
$this->menuadditem ("Delphi", "Welcome to Visit Delphi", "$PHP _self?key=page&id=delphi");
$this->menuendsection ();

$this->menustartsection (3, "Happy Moment");
$this->menuadditem ("Traditional jokes", "traditional jokes", "$PHP _self?key=page&id= traditional Jokes");
$this->menuadditem ("Modern Jokes", "modern Jokes", "$PHP _self?key=page&id= Modern Jokes");
$this->menuaddsubsection ("Children's class");
$this->menuadditem ("Campus joke", "Campus joke", "$PHP _self?key=page&id= campus joke");
$this->menuadditem ("Children's jokes", "Children's jokes", "$PHP _self?key=page&id= Children's jokes");
$this->menuadditem ("Juvenile joke", "juvenile joke", "$PHP _self?key=page&id= juvenile Joke");
$this->menuaddsubsectionline ();
$this->menuadditem ("Middle School Time joke", "Middle School Time Joke", "$PHP _self?key=page&id= Middle School Time joke");
$this->menuaddsubsection ("adult jokes");
$this->menuadditem ("colored jokes", "colored jokes", "$PHP _self?key=page&id= with colored jokes");
$this->menuadditem ("joke Forest", "joke Forest", "$PHP _self?key=page&id= joke Forest");
$this->menuendsection ();

$this->menusectionasitem (3, "Menu Introduction", "Menu Introduction", "$PHP _self?key=about");

$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);
?>


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.