Commit b45cccd8f0c84edb1d01edf45ce3baafbfcde2d8
1 parent
a8ad9464
added pre-limary Navbar.inc
needs more work git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@433 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
188 additions
and
0 deletions
lib/web/NavBar.inc
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); | |
| 4 | + | |
| 5 | +/** | |
| 6 | +* Class NavBar.inc | |
| 7 | +* | |
| 8 | +* Contains all the functions to create the navbar...as well as possibly handling the | |
| 9 | +* westpayload section. | |
| 10 | +* | |
| 11 | +* | |
| 12 | +* @author Mukhtar Dharsey | |
| 13 | +* @date 20 January 2003 | |
| 14 | +*/ | |
| 15 | + | |
| 16 | +global $default; | |
| 17 | + | |
| 18 | +class NavBar | |
| 19 | +{ | |
| 20 | + //variable used to pass highlighting | |
| 21 | + var $highlightedSection; | |
| 22 | + var $home; | |
| 23 | + var $mdocs; | |
| 24 | + var $asearch; | |
| 25 | + var $admin; | |
| 26 | + var $prefs; | |
| 27 | + var $help; | |
| 28 | + var $logout; | |
| 29 | + | |
| 30 | + function setHighlightedSection($currentSection) | |
| 31 | + { | |
| 32 | + return $this->$highlightedSection = $currentSection; | |
| 33 | + } | |
| 34 | + | |
| 35 | + | |
| 36 | + // this function creates the navbar for a specific page... | |
| 37 | + // Todo take parameter to set page highlighting | |
| 38 | + function render() | |
| 39 | + { | |
| 40 | + global $default; | |
| 41 | + | |
| 42 | + if($this->$highlightedSection == "General") | |
| 43 | + { | |
| 44 | + $home = "$default->owl_graphics_url/home/over.gif"; | |
| 45 | + } | |
| 46 | + else | |
| 47 | + { | |
| 48 | + $home = "$default->owl_graphics_url/home/norm.gif"; | |
| 49 | + } | |
| 50 | + | |
| 51 | + if($this->$highlightedSection == "Manage Documents") | |
| 52 | + { | |
| 53 | + $mdocs = "$default->owl_graphics_url/mdocs/over.gif"; | |
| 54 | + } | |
| 55 | + else | |
| 56 | + { | |
| 57 | + $mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | |
| 58 | + } | |
| 59 | + | |
| 60 | + if($this->$highlightedSection == "Advanced Search") | |
| 61 | + { | |
| 62 | + $asearch = "$default->owl_graphics_url/asearch/over.gif"; | |
| 63 | + } | |
| 64 | + else | |
| 65 | + { | |
| 66 | + $asearch = "$default->owl_graphics_url/asearch/norm.gif"; | |
| 67 | + } | |
| 68 | + | |
| 69 | + if($this->$highlightedSection == "Administration") | |
| 70 | + { | |
| 71 | + $admin = "$default->owl_graphics_url/admin/over.gif"; | |
| 72 | + } | |
| 73 | + else | |
| 74 | + { | |
| 75 | + $admin = "$default->owl_graphics_url/admin/norm.gif"; | |
| 76 | + } | |
| 77 | + | |
| 78 | + if($this->$highlightedSection == "Preferences") | |
| 79 | + { | |
| 80 | + $prefs = "$default->owl_graphics_url/prefs/over.gif"; | |
| 81 | + } | |
| 82 | + else | |
| 83 | + { | |
| 84 | + $prefs = "$default->owl_graphics_url/prefs/norm.gif"; | |
| 85 | + } | |
| 86 | + | |
| 87 | + if($this->$highlightedSection == "Help") | |
| 88 | + { | |
| 89 | + $help = "$default->owl_graphics_url/help/over.gif"; | |
| 90 | + } | |
| 91 | + else | |
| 92 | + { | |
| 93 | + $help = "$default->owl_graphics_url/help/norm.gif"; | |
| 94 | + } | |
| 95 | + | |
| 96 | + if($this->$highlightedSection == "Logout") | |
| 97 | + { | |
| 98 | + $logout = "$default->owl_graphics_url/logout/over.gif"; | |
| 99 | + } | |
| 100 | + else | |
| 101 | + { | |
| 102 | + $logout = "$default->owl_graphics_url/logout/norm.gif"; | |
| 103 | + } | |
| 104 | + | |
| 105 | + | |
| 106 | + //$mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | |
| 107 | + //$asearch = "$default->owl_graphics_url/asearch/norm.gif"; | |
| 108 | + //$admin = "$default->owl_graphics_url/admin/norm.gif"; | |
| 109 | + //$prefs = "$default->owl_graphics_url/prefs/norm.gif"; | |
| 110 | + //$help = "$default->owl_graphics_url/help/norm.gif"; | |
| 111 | + //$logout = "$default->owl_graphics_url/logout/norm.gif"; | |
| 112 | + | |
| 113 | + $heading = "$default->owl_graphics_url/heading.gif"; | |
| 114 | + $hStretched = "$default->owl_graphics_url/hrepeat.gif"; | |
| 115 | + | |
| 116 | + $colourHome = "$default->owl_graphics_url/home/colour.gif"; | |
| 117 | + $colourmdocs = "$default->owl_graphics_url/mdocs/colour.gif"; | |
| 118 | + $colourasearch = "$default->owl_graphics_url/asearch/colour.gif"; | |
| 119 | + $colouradmin = "$default->owl_graphics_url/admin/colour.gif"; | |
| 120 | + $colourprefs = "$default->owl_graphics_url/prefs/colour.gif"; | |
| 121 | + $colourhelp = "$default->owl_graphics_url/help/colour.gif"; | |
| 122 | + $colourlogout = "$default->owl_graphics_url/logout/colour.gif"; | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + // build the top menu of links | |
| 128 | + | |
| 129 | + // get list of sections | |
| 130 | + $aTopMenuLinks = array(generateControllerUrl("dashboard"), | |
| 131 | + generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), | |
| 132 | + generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), | |
| 133 | + generateControllerUrl($default->siteMap->getDefaultAction("Administration")), | |
| 134 | + generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), | |
| 135 | + generateControllerUrl($default->siteMap->getDefaultAction("Help")), | |
| 136 | + generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); | |
| 137 | + | |
| 138 | + $aTopMenuImages = array($home,$mdocs,$asearch,$admin,$prefs,$help,$logout); | |
| 139 | + | |
| 140 | + $row4MenuImages = array($colourHome,$colourmdocs,$colourasearch,$colouradmin,$colourprefs,$colourhelp,$colourlogout); | |
| 141 | + | |
| 142 | + $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$aTopMenuImages); | |
| 143 | + $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$row4MenuImages); | |
| 144 | + | |
| 145 | + // set up rows | |
| 146 | + //row one image | |
| 147 | + $row1 = "<img src = ". $heading. ">"; | |
| 148 | + //row 2 will be a search bar | |
| 149 | + $row2 =""; | |
| 150 | + //row 3 will be the heading subsections | |
| 151 | + $row3 = $oPatternTableLinks->render(); | |
| 152 | + //array of coloured section images | |
| 153 | + $row4 = $oColourTableLinks->render(); | |
| 154 | + | |
| 155 | + $toRender = new PatternCustom; | |
| 156 | + | |
| 157 | + //bar width based on main page sizes...80% of width(600)..30% of height(800) | |
| 158 | + $bar= " | |
| 159 | + <html> | |
| 160 | + | |
| 161 | + <Table border=\"0\" width=\"100%\" height=\"100%\"> | |
| 162 | + | |
| 163 | + <tr><td background = " . $hStretched ." width =\"100%\" height=\"20%\"></td></tr> | |
| 164 | + | |
| 165 | + <tr><td background = " . $hStretched ." width =\"100%\" height=\"20%\"> | |
| 166 | + | |
| 167 | + <tr><td height= \"25%\">". $row3 . "</td></tr> | |
| 168 | + | |
| 169 | + <tr><td height=\"25%\">". $row4 . "</td></tr> | |
| 170 | + | |
| 171 | + </table> | |
| 172 | + | |
| 173 | + </html> | |
| 174 | + "; | |
| 175 | + | |
| 176 | + $toRender->setHtml($bar); | |
| 177 | + | |
| 178 | + return $toRender->render(); | |
| 179 | + | |
| 180 | + } | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | +} | |
| 186 | + | |
| 187 | + | |
| 188 | +?> | |
| 0 | 189 | \ No newline at end of file | ... | ... |