From fb13ea4cfa8445b99f4ceb46a1135a217d430744 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 25 Feb 2003 10:29:31 +0000 Subject: [PATCH] reformatted --- lib/visualpatterns/NavBar.inc | 315 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------- presentation/webpageTemplate.inc | 12 ++++++------ 2 files changed, 157 insertions(+), 170 deletions(-) diff --git a/lib/visualpatterns/NavBar.inc b/lib/visualpatterns/NavBar.inc index b853e76..926dd6f 100644 --- a/lib/visualpatterns/NavBar.inc +++ b/lib/visualpatterns/NavBar.inc @@ -19,150 +19,137 @@ global $default; * @author Mukhtar Dharsey * @date 22 January 2003 */ -class NavBar -{ - //variable used to pass highlighting - var $home; - var $mdocs; - var $subscriptions; - var $asearch; - var $admin; - var $prefs; - var $help; - var $logout; - var $nwColourbar; - - /** variables used for searching */ - var $sBrowseType; - var $iFolderID; - var $iDocumentID; - var $sCategoryName; - var $iDocTypeID; - - function NavBar($sTmpBrowseType, $iTmpFolderID, $iTmpDocumentID, $sTmpCategoryName, $iTmpDocTypeID) - { - global $default; - - $this->sBrowseType = $iTmpBrowseType; - $this->iFolderID = $iTmpFolderID; - $this->iDocumentID = $iTmpDocumentID; - $this->sCategoryName = $sTmpCategoryName; - $this->iDoctypeID = $iTmpDocTypeID; - - - $this->mdocs = "$default->graphicsUrl/mdocs/norm.gif"; - $this->home = "$default->graphicsUrl/home/norm.gif"; - $this->subscriptions = "$default->graphicsUrl/subscriptions/norm.gif"; - $this->asearch = "$default->graphicsUrl/asearch/norm.gif"; - $this->admin = "$default->graphicsUrl/admin/norm.gif"; - $this->prefs = "$default->graphicsUrl/prefs/norm.gif"; - $this->help = "$default->graphicsUrl/help/norm.gif"; - $this->logout = "$default->graphicsUrl/logout/norm.gif"; - - } - - - /** - * gets the url for the colour bar - * - * @param The section that needs to be highlighted - */ - function getNWColourbar() - { - return $this->nwColourBar; - } - - - - /** - * sets a highlighted section varaibles - * - * @param The section that needs to be highlighted - */ - function setHighlightedSection($section) - { - global $default; - - // check for highlighting..and highlight as required - if($section == "General") - { - $this->home = "$default->graphicsUrl/home/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/home/def.gif"; - } - - if(($section == "Manage Documents") || ($section == "Manage Categories") || ($section == "Manage Document Types")) - { - $this->mdocs = "$default->graphicsUrl/mdocs/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/mdocs/def.gif"; - } - - if($section == "Subscriptions") - { - $this->subscriptions = "$default->graphicsUrl/subscriptions/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/subscriptions/def.gif"; - } - - if($section == "Advanced Search") - { - $this->asearch = "$default->graphicsUrl/asearch/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/asearch/def.gif"; - } - - - if(substr($section, -14) == "Administration") - { - $this->admin = "$default->graphicsUrl/admin/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/admin/def.gif"; - } - - if($section == "Preferences") - { - $this->prefs = "$default->graphicsUrl/prefs/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/prefs/def.gif"; - } - - if($section == "Help") - { - $this->help = "$default->graphicsUrl/help/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/help/def.gif"; - } - - - if($section == "Logout") - { - $this->logout = "$default->graphicsUrl/logout/over.gif"; - $this->nwColourBar = "$default->graphicsUrl/logout/def.gif"; - } - } - - - - /** - * - * this function creates the navbar for a specific page... - * - * - */ - function render() - { - global $default; - - //set up headings for row 1 and 2 - $heading = "$default->graphicsUrl/heading.gif"; - $hStretched = "$default->graphicsUrl/hrepeat.gif"; - - // set colour pics for row 4 of navbar - $colourHome = "$default->graphicsUrl/home/colour.gif"; - $colourmdocs = "$default->graphicsUrl/mdocs/colour.gif"; - $coloursubscriptions = "$default->graphicsUrl/subscriptions/colour.gif"; - $colourasearch = "$default->graphicsUrl/asearch/colour.gif"; - $colouradmin = "$default->graphicsUrl/admin/colour.gif"; - $colourprefs = "$default->graphicsUrl/prefs/colour.gif"; - $colourhelp = "$default->graphicsUrl/help/colour.gif"; - $colourlogout = "$default->graphicsUrl/logout/colour.gif"; - - - // get list of sections +class NavBar { + //variable used to pass highlighting + var $home; + var $mdocs; + var $subscriptions; + var $asearch; + var $admin; + var $prefs; + var $help; + var $logout; + var $nwColourbar; + + /** variables used for searching */ + var $sBrowseType; + var $iFolderID; + var $iDocumentID; + var $sCategoryName; + var $iDocTypeID; + + function NavBar($sTmpBrowseType, $iTmpFolderID, $iTmpDocumentID, $sTmpCategoryName, $iTmpDocTypeID) { + global $default; + + $this->sBrowseType = $iTmpBrowseType; + $this->iFolderID = $iTmpFolderID; + $this->iDocumentID = $iTmpDocumentID; + $this->sCategoryName = $sTmpCategoryName; + $this->iDoctypeID = $iTmpDocTypeID; + + + $this->mdocs = "$default->graphicsUrl/mdocs/norm.gif"; + $this->home = "$default->graphicsUrl/home/norm.gif"; + $this->subscriptions = "$default->graphicsUrl/subscriptions/norm.gif"; + $this->asearch = "$default->graphicsUrl/asearch/norm.gif"; + $this->admin = "$default->graphicsUrl/admin/norm.gif"; + $this->prefs = "$default->graphicsUrl/prefs/norm.gif"; + $this->help = "$default->graphicsUrl/help/norm.gif"; + $this->logout = "$default->graphicsUrl/logout/norm.gif"; + + } + + + /** + * gets the url for the colour bar + * + * @param The section that needs to be highlighted + */ + function getNWColourbar() { + return $this->nwColourBar; + } + + + + /** + * sets a highlighted section varaibles + * + * @param The section that needs to be highlighted + */ + function setHighlightedSection($section) { + global $default; + + // check for highlighting..and highlight as required + if($section == "General") { + $this->home = "$default->graphicsUrl/home/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/home/def.gif"; + } + + if(($section == "Manage Documents") || ($section == "Manage Categories") || ($section == "Manage Document Types")) { + $this->mdocs = "$default->graphicsUrl/mdocs/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/mdocs/def.gif"; + } + + if($section == "Subscriptions") { + $this->subscriptions = "$default->graphicsUrl/subscriptions/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/subscriptions/def.gif"; + } + + if($section == "Advanced Search") { + $this->asearch = "$default->graphicsUrl/asearch/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/asearch/def.gif"; + } + + + if(substr($section, -14) == "Administration") { + $this->admin = "$default->graphicsUrl/admin/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/admin/def.gif"; + } + + if($section == "Preferences") { + $this->prefs = "$default->graphicsUrl/prefs/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/prefs/def.gif"; + } + + if($section == "Help") { + $this->help = "$default->graphicsUrl/help/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/help/def.gif"; + } + + + if($section == "Logout") { + $this->logout = "$default->graphicsUrl/logout/over.gif"; + $this->nwColourBar = "$default->graphicsUrl/logout/def.gif"; + } + } + + + + /** + * + * this function creates the navbar for a specific page... + * + * + */ + function render() { + global $default; + + //set up headings for row 1 and 2 + $heading = "$default->graphicsUrl/heading.gif"; + $hStretched = "$default->graphicsUrl/hrepeat.gif"; + + // set colour pics for row 4 of navbar + $colourHome = "$default->graphicsUrl/home/colour.gif"; + $colourmdocs = "$default->graphicsUrl/mdocs/colour.gif"; + $coloursubscriptions = "$default->graphicsUrl/subscriptions/colour.gif"; + $colourasearch = "$default->graphicsUrl/asearch/colour.gif"; + $colouradmin = "$default->graphicsUrl/admin/colour.gif"; + $colourprefs = "$default->graphicsUrl/prefs/colour.gif"; + $colourhelp = "$default->graphicsUrl/help/colour.gif"; + $colourlogout = "$default->graphicsUrl/logout/colour.gif"; + + + // get list of sections $aTopMenuLinks = array(generateControllerUrl("dashboard"), generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), @@ -171,7 +158,7 @@ class NavBar generateControllerUrl($default->siteMap->getDefaultAction("Administration")), generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), //generateControllerUrl($default->siteMap->getDefaultAction("Help")), - "help", + "help", generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); @@ -190,15 +177,15 @@ class NavBar $row4MenuImages = array($colourHome,$colourmdocs,$coloursubscriptions,$colourasearch,$colouradmin,$colourprefs,$colourhelp,$colourlogout); //set up the links - $sTopMenu = "\n\n"; - for ($i = 0; $i < count($aTopMenuLinks); $i++) { - if (strcmp($aTopMenuLinks[$i], "help") == 0) { - $sTopMenu .= "\n"; - } else { - $sTopMenu .= "\n"; - } - } - $sTopMenu .= "\n
" . (strlen($aTopMenuLinks[$i]) > 0 ? "" : "") . "
\n"; + $sTopMenu = "\n\n"; + for ($i = 0; $i < count($aTopMenuLinks); $i++) { + if (strcmp($aTopMenuLinks[$i], "help") == 0) { + $sTopMenu .= "\n"; + } else { + $sTopMenu .= "\n"; + } + } + $sTopMenu .= "\n
" . (strlen($aTopMenuLinks[$i]) > 0 ? "" : "") . "
\n"; $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8,2,$row4MenuImages); // set up rows @@ -208,7 +195,7 @@ class NavBar $row2 =""; //row 3 will be the heading subsections //$row3 = $oPatternTableLinks->render(); - $row3 = $sTopMenu; + $row3 = $sTopMenu; //array of coloured section images $row4 = $oColourTableLinks->render(); @@ -219,20 +206,20 @@ class NavBar \n " . "\n " . "\n " . "\n" . "\n" . "\n" . - "
". $row1 ."
\n " . - "graphicsUrl/arrow.gif\" >\n " . - "\n" . + "graphicsUrl/arrow.gif\" >\n " . + "\n" . //"\n " . - "sBrowseType . "\" />\n " . - "iFolderID . "\" />\n " . - "iDocumentID . "\" />\n " . - "sCategoryName . "\" />\n " . - "iDocTypeID . "\" />\n " . - "graphicsUrl/search.gif\" align = \"absmiddle\" border=\"0\" />\n " . + "sBrowseType . "\" />\n " . + "iFolderID . "\" />\n " . + "iDocumentID . "\" />\n " . + "sCategoryName . "\" />\n " . + "iDocTypeID . "\" />\n " . + "graphicsUrl/search.gif\" align = \"absmiddle\" border=\"0\" />\n " . "
". $row3 . "
". $row4 . "
\n"; + "\n"; //set the bar as html to object $toRender->setHtml($bar); diff --git a/presentation/webpageTemplate.inc b/presentation/webpageTemplate.inc index 970a2cc..0ed4866 100644 --- a/presentation/webpageTemplate.inc +++ b/presentation/webpageTemplate.inc @@ -22,9 +22,9 @@ $navbar = new NavBar($fBrowseType, $fFolderID, $fDocumentID, $fCategoryName, $fD if ($sectionName == "") -//get the section name if not specified in the url + //get the section name if not specified in the url { - $sectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); + $sectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); } @@ -56,13 +56,13 @@ if ($sectionName != "General") { $output1["links"] = $sectionArray["links"]; $output2["descriptions"] = $sectionArray["descriptions"]; - //create links - $westLinks = new PatternTableLinks($sectionArray["links"], $sectionArray["descriptions"], 40 , 1 ,1,null); - $westRender = $westLinks->render(); + //create links + $westLinks = new PatternTableLinks($sectionArray["links"], $sectionArray["descriptions"], 40 , 1 ,1,null); + $westRender = $westLinks->render(); } else { $westLinks = new PatternTableLinks(array(), array(), 40 , 1 ,1,null); - $westRender = $westLinks->render(); + $westRender = $westLinks->render(); } -- libgit2 0.21.4