Commit 7fb9d64ec3d65531e28a04f6ae8ea083f8d464ee
1 parent
88b2c345
updated formatting
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@918 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
157 additions
and
198 deletions
lib/visualpatterns/NavBar.inc
| ... | ... | @@ -6,8 +6,7 @@ require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); |
| 6 | 6 | * NavBar.inc |
| 7 | 7 | * |
| 8 | 8 | * Create the top section of the navbar.. |
| 9 | -* | |
| 10 | -* | |
| 9 | + | |
| 11 | 10 | * @author Mukhtar Dharsey |
| 12 | 11 | * @date 22 January 2003 |
| 13 | 12 | */ |
| ... | ... | @@ -15,218 +14,178 @@ require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); |
| 15 | 14 | global $default; |
| 16 | 15 | |
| 17 | 16 | /** |
| 18 | -* | |
| 19 | -* | |
| 20 | -* Contains all the functions to create the navbar... | |
| 21 | -* | |
| 17 | +* Contains all the functions to create the navbar... | |
| 22 | 18 | * |
| 23 | 19 | * @author Mukhtar Dharsey |
| 24 | 20 | * @date 22 January 2003 |
| 25 | 21 | */ |
| 26 | -class NavBar | |
| 27 | -{ | |
| 28 | - //variable used to pass highlighting | |
| 29 | - var $home; | |
| 30 | - var $mdocs; | |
| 31 | - var $subscriptions; | |
| 32 | - var $asearch; | |
| 33 | - var $admin; | |
| 34 | - var $prefs; | |
| 35 | - var $help; | |
| 36 | - var $logout; | |
| 37 | - var $nwColourbar; | |
| 38 | - | |
| 39 | - function NavBar() | |
| 40 | - { | |
| 41 | - global $default; | |
| 42 | - $this->mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | |
| 43 | - $this->home = "$default->owl_graphics_url/home/norm.gif"; | |
| 44 | - $this->subscriptions = "$default->owl_graphics_url/subscriptions/norm.gif"; | |
| 45 | - $this->asearch = "$default->owl_graphics_url/asearch/norm.gif"; | |
| 46 | - $this->admin = "$default->owl_graphics_url/admin/norm.gif"; | |
| 47 | - $this->prefs = "$default->owl_graphics_url/prefs/norm.gif"; | |
| 48 | - $this->help = "$default->owl_graphics_url/help/norm.gif"; | |
| 49 | - $this->logout = "$default->owl_graphics_url/logout/norm.gif"; | |
| 50 | - | |
| 51 | - } | |
| 52 | - | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * gets the url for the colour bar | |
| 56 | - * | |
| 57 | - * @param The section that needs to be highlighted | |
| 58 | - */ | |
| 59 | - function getNWColourbar() | |
| 60 | - { | |
| 61 | - return $this->nwColourBar; | |
| 62 | - } | |
| 63 | - | |
| 64 | - | |
| 65 | - | |
| 66 | - /** | |
| 67 | - * sets a highlighted section varaibles | |
| 68 | - * | |
| 69 | - * @param The section that needs to be highlighted | |
| 70 | - */ | |
| 71 | - function setHighlightedSection($section) | |
| 72 | - { | |
| 73 | - global $default; | |
| 74 | - | |
| 75 | - // check for highlighting..and highlight as required | |
| 76 | - if($section == "General") | |
| 77 | - { | |
| 78 | - $this->home = "$default->owl_graphics_url/home/over.gif"; | |
| 79 | - $this->nwColourBar = "$default->owl_graphics_url/home/def.gif"; | |
| 80 | - } | |
| 81 | - | |
| 82 | - if($section == "Manage Documents") | |
| 83 | - { | |
| 84 | - $this->mdocs = "$default->owl_graphics_url/mdocs/over.gif"; | |
| 85 | - $this->nwColourBar = "$default->owl_graphics_url/mdocs/def.gif"; | |
| 86 | - } | |
| 87 | - | |
| 88 | - if($section == "Subscriptions") | |
| 89 | - { | |
| 90 | - $this->subscriptions = "$default->owl_graphics_url/subscriptions/over.gif"; | |
| 91 | - $this->nwColourBar = "$default->owl_graphics_url/subscriptions/def.gif"; | |
| 92 | - } | |
| 93 | - | |
| 94 | - if($section == "Advanced Search") | |
| 95 | - { | |
| 96 | - $this->asearch = "$default->owl_graphics_url/asearch/over.gif"; | |
| 97 | - $this->nwColourBar = "$default->owl_graphics_url/asearch/def.gif"; | |
| 98 | - } | |
| 99 | - | |
| 100 | - | |
| 101 | - if($section == "Administration") | |
| 102 | - { | |
| 103 | - $this->admin = "$default->owl_graphics_url/admin/over.gif"; | |
| 104 | - $this->nwColourBar = "$default->owl_graphics_url/admin/def.gif"; | |
| 105 | - } | |
| 106 | - | |
| 107 | - if($section == "Preferences") | |
| 108 | - { | |
| 109 | - $this->prefs = "$default->owl_graphics_url/prefs/over.gif"; | |
| 110 | - $this->nwColourBar = "$default->owl_graphics_url/prefs/def.gif"; | |
| 111 | - } | |
| 112 | - | |
| 113 | - if($section == "Help") | |
| 114 | - { | |
| 115 | - $this->help = "$default->owl_graphics_url/help/over.gif"; | |
| 116 | - $this->nwColourBar = "$default->owl_graphics_url/help/def.gif"; | |
| 117 | - } | |
| 118 | - | |
| 119 | - | |
| 120 | - if($section == "Logout") | |
| 121 | - { | |
| 122 | - $this->logout = "$default->owl_graphics_url/logout/over.gif"; | |
| 123 | - $this->nwColourBar = "$default->owl_graphics_url/logout/def.gif"; | |
| 124 | - } | |
| 125 | - } | |
| 126 | - | |
| 127 | - | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * | |
| 131 | - * this function creates the navbar for a specific page... | |
| 132 | - * | |
| 133 | - * | |
| 134 | - */ | |
| 135 | - function render() | |
| 136 | - { | |
| 137 | - global $default; | |
| 138 | - | |
| 139 | - //set up headings for row 1 and 2 | |
| 140 | - $heading = "$default->owl_graphics_url/heading.gif"; | |
| 141 | - $hStretched = "$default->owl_graphics_url/hrepeat.gif"; | |
| 142 | - | |
| 143 | - // set colour pics for row 4 of navbar | |
| 144 | - $colourHome = "$default->owl_graphics_url/home/colour.gif"; | |
| 145 | - $colourmdocs = "$default->owl_graphics_url/mdocs/colour.gif"; | |
| 146 | - $coloursubscriptions = "$default->owl_graphics_url/subscriptions/colour.gif"; | |
| 147 | - $colourasearch = "$default->owl_graphics_url/asearch/colour.gif"; | |
| 148 | - $colouradmin = "$default->owl_graphics_url/admin/colour.gif"; | |
| 149 | - $colourprefs = "$default->owl_graphics_url/prefs/colour.gif"; | |
| 150 | - $colourhelp = "$default->owl_graphics_url/help/colour.gif"; | |
| 151 | - $colourlogout = "$default->owl_graphics_url/logout/colour.gif"; | |
| 152 | - | |
| 153 | - | |
| 154 | - // get list of sections | |
| 22 | +class NavBar { | |
| 23 | + //variable used to pass highlighting | |
| 24 | + var $home; | |
| 25 | + var $mdocs; | |
| 26 | + var $subscriptions; | |
| 27 | + var $asearch; | |
| 28 | + var $admin; | |
| 29 | + var $prefs; | |
| 30 | + var $help; | |
| 31 | + var $logout; | |
| 32 | + var $nwColourbar; | |
| 33 | + | |
| 34 | + function NavBar() { | |
| 35 | + global $default; | |
| 36 | + $this->mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | |
| 37 | + $this->home = "$default->owl_graphics_url/home/norm.gif"; | |
| 38 | + $this->subscriptions = "$default->owl_graphics_url/subscriptions/norm.gif"; | |
| 39 | + $this->asearch = "$default->owl_graphics_url/asearch/norm.gif"; | |
| 40 | + $this->admin = "$default->owl_graphics_url/admin/norm.gif"; | |
| 41 | + $this->prefs = "$default->owl_graphics_url/prefs/norm.gif"; | |
| 42 | + $this->help = "$default->owl_graphics_url/help/norm.gif"; | |
| 43 | + $this->logout = "$default->owl_graphics_url/logout/norm.gif"; | |
| 44 | + | |
| 45 | + } | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * gets the url for the colour bar | |
| 49 | + * | |
| 50 | + * @param The section that needs to be highlighted | |
| 51 | + */ | |
| 52 | + function getNWColourbar() { | |
| 53 | + return $this->nwColourBar; | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * sets a highlighted section varaibles | |
| 58 | + * | |
| 59 | + * @param The section that needs to be highlighted | |
| 60 | + */ | |
| 61 | + function setHighlightedSection($section) { | |
| 62 | + global $default; | |
| 63 | + | |
| 64 | + // check for highlighting..and highlight as required | |
| 65 | + if($section == "General") { | |
| 66 | + $this->home = "$default->owl_graphics_url/home/over.gif"; | |
| 67 | + $this->nwColourBar = "$default->owl_graphics_url/home/def.gif"; | |
| 68 | + } | |
| 69 | + | |
| 70 | + if($section == "Manage Documents") { | |
| 71 | + $this->mdocs = "$default->owl_graphics_url/mdocs/over.gif"; | |
| 72 | + $this->nwColourBar = "$default->owl_graphics_url/mdocs/def.gif"; | |
| 73 | + } | |
| 74 | + | |
| 75 | + if($section == "Subscriptions") { | |
| 76 | + $this->subscriptions = "$default->owl_graphics_url/subscriptions/over.gif"; | |
| 77 | + $this->nwColourBar = "$default->owl_graphics_url/subscriptions/def.gif"; | |
| 78 | + } | |
| 79 | + | |
| 80 | + if($section == "Advanced Search") { | |
| 81 | + $this->asearch = "$default->owl_graphics_url/asearch/over.gif"; | |
| 82 | + $this->nwColourBar = "$default->owl_graphics_url/asearch/def.gif"; | |
| 83 | + } | |
| 84 | + | |
| 85 | + | |
| 86 | + if($section == "Administration") { | |
| 87 | + $this->admin = "$default->owl_graphics_url/admin/over.gif"; | |
| 88 | + $this->nwColourBar = "$default->owl_graphics_url/admin/def.gif"; | |
| 89 | + } | |
| 90 | + | |
| 91 | + if($section == "Preferences") { | |
| 92 | + $this->prefs = "$default->owl_graphics_url/prefs/over.gif"; | |
| 93 | + $this->nwColourBar = "$default->owl_graphics_url/prefs/def.gif"; | |
| 94 | + } | |
| 95 | + | |
| 96 | + if($section == "Help") { | |
| 97 | + $this->help = "$default->owl_graphics_url/help/over.gif"; | |
| 98 | + $this->nwColourBar = "$default->owl_graphics_url/help/def.gif"; | |
| 99 | + } | |
| 100 | + | |
| 101 | + if($section == "Logout") { | |
| 102 | + $this->logout = "$default->owl_graphics_url/logout/over.gif"; | |
| 103 | + $this->nwColourBar = "$default->owl_graphics_url/logout/def.gif"; | |
| 104 | + } | |
| 105 | + } | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * this function creates the navbar for a specific page... | |
| 109 | + */ | |
| 110 | + function render() { | |
| 111 | + global $default; | |
| 112 | + | |
| 113 | + //set up headings for row 1 and 2 | |
| 114 | + $heading = "$default->owl_graphics_url/heading.gif"; | |
| 115 | + $hStretched = "$default->owl_graphics_url/hrepeat.gif"; | |
| 116 | + | |
| 117 | + // set colour pics for row 4 of navbar | |
| 118 | + $colourHome = "$default->owl_graphics_url/home/colour.gif"; | |
| 119 | + $colourmdocs = "$default->owl_graphics_url/mdocs/colour.gif"; | |
| 120 | + $coloursubscriptions = "$default->owl_graphics_url/subscriptions/colour.gif"; | |
| 121 | + $colourasearch = "$default->owl_graphics_url/asearch/colour.gif"; | |
| 122 | + $colouradmin = "$default->owl_graphics_url/admin/colour.gif"; | |
| 123 | + $colourprefs = "$default->owl_graphics_url/prefs/colour.gif"; | |
| 124 | + $colourhelp = "$default->owl_graphics_url/help/colour.gif"; | |
| 125 | + $colourlogout = "$default->owl_graphics_url/logout/colour.gif"; | |
| 126 | + | |
| 127 | + | |
| 128 | + // get list of sections | |
| 155 | 129 | $aTopMenuLinks = array(generateControllerUrl("dashboard"), |
| 156 | - generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), | |
| 157 | - generateControllerUrl($default->siteMap->getDefaultAction("Subscriptions")), | |
| 158 | - generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), | |
| 159 | - generateControllerUrl($default->siteMap->getDefaultAction("Administration")), | |
| 130 | + generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), | |
| 131 | + generateControllerUrl($default->siteMap->getDefaultAction("Subscriptions")), | |
| 132 | + generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), | |
| 133 | + generateControllerUrl($default->siteMap->getDefaultAction("Administration")), | |
| 160 | 134 | generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), |
| 161 | - generateControllerUrl($default->siteMap->getDefaultAction("Help")), | |
| 135 | + generateControllerUrl($default->siteMap->getDefaultAction("Help")), | |
| 162 | 136 | generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); |
| 163 | 137 | |
| 164 | 138 | |
| 165 | - // create array of images for navbar sections | |
| 139 | + // create array of images for navbar sections | |
| 166 | 140 | $aTopMenuImages = array($this->home, |
| 167 | - $this->mdocs, | |
| 168 | - $this->subscriptions, | |
| 169 | - $this->asearch, | |
| 170 | - $this->admin, | |
| 171 | - $this->prefs, | |
| 172 | - $this->help, | |
| 173 | - $this->logout); | |
| 174 | - | |
| 175 | - | |
| 176 | - // create array of menu colour images | |
| 141 | + $this->mdocs, | |
| 142 | + $this->subscriptions, | |
| 143 | + $this->asearch, | |
| 144 | + $this->admin, | |
| 145 | + $this->prefs, | |
| 146 | + $this->help, | |
| 147 | + $this->logout); | |
| 148 | + | |
| 149 | + | |
| 150 | + // create array of menu colour images | |
| 177 | 151 | $row4MenuImages = array($colourHome,$colourmdocs,$coloursubscriptions,$colourasearch,$colouradmin,$colourprefs,$colourhelp,$colourlogout); |
| 178 | - | |
| 152 | + | |
| 179 | 153 | //set up the links |
| 180 | 154 | $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8,2,$aTopMenuImages); |
| 181 | - $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8,2,$row4MenuImages); | |
| 182 | - | |
| 183 | - // set up rows | |
| 184 | - //row one image | |
| 185 | - $row1 = "<img src = ". $heading. ">"; | |
| 186 | - //row 2 will be a search bar | |
| 187 | - $row2 =""; | |
| 188 | - //row 3 will be the heading subsections | |
| 189 | - $row3 = $oPatternTableLinks->render(); | |
| 190 | - //array of coloured section images | |
| 191 | - $row4 = $oColourTableLinks->render(); | |
| 192 | - | |
| 193 | - $toRender = new PatternCustom; | |
| 194 | - | |
| 195 | - //bar is the actaul html creation of the nav bar | |
| 196 | - $bar= " | |
| 197 | - <Table cellpadding = \"1\" cellspacing = \"1\" border=\"1\" width=\"100%\" height=\"100%\"> | |
| 198 | - | |
| 199 | - <tr height=\"20%\"><td background = " . $hStretched ." width =\"100%\">". $row1 ."</td></tr> | |
| 200 | - | |
| 201 | - <tr height=\"30%\"> <td VALIGN = \"absmiddle\" background = " . $hStretched ." width =\"100%\" NOWRAP > | |
| 202 | - <img align = \"absmiddle\" src = \"$default->owl_graphics_url/arrow.gif\" ></img> | |
| 203 | - <INPUT type=\"Text\" name=\"searchField\" width=\"30\" height = \"10\" align = \"absmiddle\" > | |
| 204 | - <INPUT type=\"image\" name=\"search\" value=\"Search\" src=\"$default->owl_graphics_url/search.gif\" align = \"absmiddle\" border=\"0\"> | |
| 205 | - </td> | |
| 206 | - | |
| 207 | - </tr> | |
| 208 | - | |
| 209 | - <tr height=\"25%\" ><td width =\"10%\">". $row3 . "</td></tr> | |
| 210 | - | |
| 211 | - <tr height=\"25%\"><td width =\"100%\">". $row4 . "</td></tr> | |
| 212 | - | |
| 213 | - </table> | |
| 214 | - | |
| 215 | - "; | |
| 216 | - | |
| 217 | - | |
| 218 | - //set the bar as html to object | |
| 219 | - $toRender->setHtml($bar); | |
| 220 | - | |
| 221 | - //render the object | |
| 222 | - return $toRender->render(); | |
| 223 | - | |
| 224 | - } | |
| 155 | + $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 8,2,$row4MenuImages); | |
| 225 | 156 | |
| 157 | + // set up rows | |
| 158 | + //row one image | |
| 159 | + $row1 = "<img src = ". $heading. ">"; | |
| 160 | + //row 2 will be a search bar | |
| 161 | + $row2 =""; | |
| 162 | + //row 3 will be the heading subsections | |
| 163 | + $row3 = $oPatternTableLinks->render(); | |
| 164 | + //array of coloured section images | |
| 165 | + $row4 = $oColourTableLinks->render(); | |
| 226 | 166 | |
| 167 | + $toRender = new PatternCustom; | |
| 227 | 168 | |
| 169 | + //bar is the actaul html creation of the nav bar | |
| 170 | + $bar= " | |
| 171 | + <Table cellpadding = \"1\" cellspacing = \"1\" border=\"1\" width=\"100%\" height=\"100%\"> | |
| 172 | + <tr height=\"20%\"><td background = " . $hStretched ." width =\"100%\">". $row1 ."</td></tr> | |
| 173 | + <tr height=\"30%\"> <td VALIGN = \"absmiddle\" background = " . $hStretched ." width =\"100%\" NOWRAP > | |
| 174 | + <img align = \"absmiddle\" src = \"$default->owl_graphics_url/arrow.gif\" ></img> | |
| 175 | + <INPUT type=\"Text\" name=\"searchField\" width=\"30\" height = \"10\" align = \"absmiddle\" > | |
| 176 | + <INPUT type=\"image\" name=\"search\" value=\"Search\" src=\"$default->owl_graphics_url/search.gif\" align = \"absmiddle\" border=\"0\"> | |
| 177 | + </td> | |
| 178 | + </tr> | |
| 179 | + <tr height=\"25%\" ><td width =\"10%\">". $row3 . "</td></tr> | |
| 180 | + <tr height=\"25%\"><td width =\"100%\">". $row4 . "</td></tr> | |
| 181 | + </table> | |
| 182 | + "; | |
| 228 | 183 | |
| 229 | -} | |
| 230 | - | |
| 184 | + //set the bar as html to object | |
| 185 | + $toRender->setHtml($bar); | |
| 231 | 186 | |
| 187 | + //render the object | |
| 188 | + return $toRender->render(); | |
| 189 | + } | |
| 190 | +} | |
| 232 | 191 | ?> |
| 233 | 192 | \ No newline at end of file | ... | ... |