Commit d7f0e11cb0c63f456d611db012327c4d400d44f4
1 parent
a4703b06
changed certain widths and hights for table rows
added functions to navbar to get sections etc still pre-limary...lots of fine tuning... git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@455 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
118 additions
and
88 deletions
lib/visualpatterns/NavBar.inc
| @@ -3,22 +3,29 @@ | @@ -3,22 +3,29 @@ | ||
| 3 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); | 3 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | -* Class NavBar.inc | 6 | +* NavBar.inc |
| 7 | * | 7 | * |
| 8 | -* Contains all the functions to create the navbar...as well as possibly handling the | ||
| 9 | -* westpayload section. | 8 | +* Create the top section of the navbar.. |
| 10 | * | 9 | * |
| 11 | * | 10 | * |
| 12 | * @author Mukhtar Dharsey | 11 | * @author Mukhtar Dharsey |
| 13 | -* @date 20 January 2003 | 12 | +* @date 22 January 2003 |
| 14 | */ | 13 | */ |
| 15 | 14 | ||
| 16 | global $default; | 15 | global $default; |
| 17 | 16 | ||
| 17 | +/** | ||
| 18 | +* | ||
| 19 | +* | ||
| 20 | +* Contains all the functions to create the navbar... | ||
| 21 | +* | ||
| 22 | +* | ||
| 23 | +* @author Mukhtar Dharsey | ||
| 24 | +* @date 22 January 2003 | ||
| 25 | +*/ | ||
| 18 | class NavBar | 26 | class NavBar |
| 19 | { | 27 | { |
| 20 | //variable used to pass highlighting | 28 | //variable used to pass highlighting |
| 21 | - var $highlightedSection; | ||
| 22 | var $home; | 29 | var $home; |
| 23 | var $mdocs; | 30 | var $mdocs; |
| 24 | var $asearch; | 31 | var $asearch; |
| @@ -26,93 +33,106 @@ class NavBar | @@ -26,93 +33,106 @@ class NavBar | ||
| 26 | var $prefs; | 33 | var $prefs; |
| 27 | var $help; | 34 | var $help; |
| 28 | var $logout; | 35 | var $logout; |
| 36 | + var $nwColourbar; | ||
| 29 | 37 | ||
| 30 | - function setHighlightedSection($currentSection) | 38 | + function NavBar() |
| 31 | { | 39 | { |
| 32 | - return $this->$highlightedSection = $currentSection; | 40 | + global $default; |
| 41 | + $this->mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | ||
| 42 | + $this->home = "$default->owl_graphics_url/home/norm.gif"; | ||
| 43 | + $this->asearch = "$default->owl_graphics_url/asearch/norm.gif"; | ||
| 44 | + $this->admin = "$default->owl_graphics_url/admin/norm.gif"; | ||
| 45 | + $this->prefs = "$default->owl_graphics_url/prefs/norm.gif"; | ||
| 46 | + $this->help = "$default->owl_graphics_url/help/norm.gif"; | ||
| 47 | + $this->logout = "$default->owl_graphics_url/logout/norm.gif"; | ||
| 48 | + | ||
| 33 | } | 49 | } |
| 34 | 50 | ||
| 35 | - | ||
| 36 | - // this function creates the navbar for a specific page... | ||
| 37 | - // Todo take parameter to set page highlighting | ||
| 38 | - function render() | 51 | + |
| 52 | + /** | ||
| 53 | + * gets the url for the colour bar | ||
| 54 | + * | ||
| 55 | + * @param The section that needs to be highlighted | ||
| 56 | + */ | ||
| 57 | + function getNWColourbar() | ||
| 58 | + { | ||
| 59 | + return $this->nwColourBar; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * sets a highlighted section varaibles | ||
| 66 | + * | ||
| 67 | + * @param The section that needs to be highlighted | ||
| 68 | + */ | ||
| 69 | + function setHighlightedSection($section) | ||
| 39 | { | 70 | { |
| 40 | global $default; | 71 | global $default; |
| 41 | 72 | ||
| 42 | - if($this->$highlightedSection == "General") | 73 | + // check for highlighting..and highlight as required |
| 74 | + if($section == "General") | ||
| 43 | { | 75 | { |
| 44 | - $home = "$default->owl_graphics_url/home/over.gif"; | ||
| 45 | - } | ||
| 46 | - else | ||
| 47 | - { | ||
| 48 | - $home = "$default->owl_graphics_url/home/norm.gif"; | 76 | + $this->home = "$default->owl_graphics_url/home/over.gif"; |
| 77 | + $this->nwColourBar = "$default->owl_graphics_url/home/def.gif"; | ||
| 49 | } | 78 | } |
| 50 | 79 | ||
| 51 | - if($this->$highlightedSection == "Manage Documents") | ||
| 52 | - { | ||
| 53 | - $mdocs = "$default->owl_graphics_url/mdocs/over.gif"; | ||
| 54 | - } | ||
| 55 | - else | 80 | + if($section == "Manage Documents") |
| 56 | { | 81 | { |
| 57 | - $mdocs = "$default->owl_graphics_url/mdocs/norm.gif"; | 82 | + $this->mdocs = "$default->owl_graphics_url/mdocs/over.gif"; |
| 83 | + $this->nwColourBar = "$default->owl_graphics_url/mdocs/def.gif"; | ||
| 58 | } | 84 | } |
| 59 | 85 | ||
| 60 | - if($this->$highlightedSection == "Advanced Search") | ||
| 61 | - { | ||
| 62 | - $asearch = "$default->owl_graphics_url/asearch/over.gif"; | ||
| 63 | - } | ||
| 64 | - else | 86 | + if($section == "Advanced Search") |
| 65 | { | 87 | { |
| 66 | - $asearch = "$default->owl_graphics_url/asearch/norm.gif"; | 88 | + $this->asearch = "$default->owl_graphics_url/asearch/over.gif"; |
| 89 | + $this->nwColourBar = "$default->owl_graphics_url/asearch/def.gif"; | ||
| 67 | } | 90 | } |
| 68 | 91 | ||
| 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 | 92 | ||
| 78 | - if($this->$highlightedSection == "Preferences") | 93 | + if($section == "Administration") |
| 79 | { | 94 | { |
| 80 | - $prefs = "$default->owl_graphics_url/prefs/over.gif"; | 95 | + $this->admin = "$default->owl_graphics_url/admin/over.gif"; |
| 96 | + $this->nwColourBar = "$default->owl_graphics_url/admin/def.gif"; | ||
| 81 | } | 97 | } |
| 82 | - else | 98 | + |
| 99 | + if($section == "Preferences") | ||
| 83 | { | 100 | { |
| 84 | - $prefs = "$default->owl_graphics_url/prefs/norm.gif"; | 101 | + $this->prefs = "$default->owl_graphics_url/prefs/over.gif"; |
| 102 | + $this->nwColourBar = "$default->owl_graphics_url/prefs/def.gif"; | ||
| 85 | } | 103 | } |
| 86 | 104 | ||
| 87 | - if($this->$highlightedSection == "Help") | ||
| 88 | - { | ||
| 89 | - $help = "$default->owl_graphics_url/help/over.gif"; | ||
| 90 | - } | ||
| 91 | - else | 105 | + if($section == "Help") |
| 92 | { | 106 | { |
| 93 | - $help = "$default->owl_graphics_url/help/norm.gif"; | 107 | + $this->help = "$default->owl_graphics_url/help/over.gif"; |
| 108 | + $this->nwColourBar = "$default->owl_graphics_url/help/def.gif"; | ||
| 94 | } | 109 | } |
| 95 | 110 | ||
| 96 | - if($this->$highlightedSection == "Logout") | ||
| 97 | - { | ||
| 98 | - $logout = "$default->owl_graphics_url/logout/over.gif"; | ||
| 99 | - } | ||
| 100 | - else | 111 | + |
| 112 | + if($section == "Logout") | ||
| 101 | { | 113 | { |
| 102 | - $logout = "$default->owl_graphics_url/logout/norm.gif"; | 114 | + $this->logout = "$default->owl_graphics_url/logout/over.gif"; |
| 115 | + $this->nwColourBar = "$default->owl_graphics_url/logout/def.gif"; | ||
| 103 | } | 116 | } |
| 117 | + } | ||
| 118 | + | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * | ||
| 123 | + * this function creates the navbar for a specific page... | ||
| 124 | + * | ||
| 125 | + * | ||
| 126 | + */ | ||
| 127 | + function render() | ||
| 128 | + { | ||
| 129 | + global $default; | ||
| 104 | 130 | ||
| 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 | - | 131 | + //set up headings for row 1 and 2 |
| 113 | $heading = "$default->owl_graphics_url/heading.gif"; | 132 | $heading = "$default->owl_graphics_url/heading.gif"; |
| 114 | $hStretched = "$default->owl_graphics_url/hrepeat.gif"; | 133 | $hStretched = "$default->owl_graphics_url/hrepeat.gif"; |
| 115 | 134 | ||
| 135 | + // set colour pics for row 4 of navbar | ||
| 116 | $colourHome = "$default->owl_graphics_url/home/colour.gif"; | 136 | $colourHome = "$default->owl_graphics_url/home/colour.gif"; |
| 117 | $colourmdocs = "$default->owl_graphics_url/mdocs/colour.gif"; | 137 | $colourmdocs = "$default->owl_graphics_url/mdocs/colour.gif"; |
| 118 | $colourasearch = "$default->owl_graphics_url/asearch/colour.gif"; | 138 | $colourasearch = "$default->owl_graphics_url/asearch/colour.gif"; |
| @@ -122,11 +142,7 @@ class NavBar | @@ -122,11 +142,7 @@ class NavBar | ||
| 122 | $colourlogout = "$default->owl_graphics_url/logout/colour.gif"; | 142 | $colourlogout = "$default->owl_graphics_url/logout/colour.gif"; |
| 123 | 143 | ||
| 124 | 144 | ||
| 125 | - | ||
| 126 | - | ||
| 127 | - // build the top menu of links | ||
| 128 | - | ||
| 129 | - // get list of sections | 145 | + // get list of sections |
| 130 | $aTopMenuLinks = array(generateControllerUrl("dashboard"), | 146 | $aTopMenuLinks = array(generateControllerUrl("dashboard"), |
| 131 | generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), | 147 | generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), |
| 132 | generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), | 148 | generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), |
| @@ -134,11 +150,22 @@ class NavBar | @@ -134,11 +150,22 @@ class NavBar | ||
| 134 | generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), | 150 | generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), |
| 135 | generateControllerUrl($default->siteMap->getDefaultAction("Help")), | 151 | generateControllerUrl($default->siteMap->getDefaultAction("Help")), |
| 136 | generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); | 152 | generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); |
| 137 | - | ||
| 138 | - $aTopMenuImages = array($home,$mdocs,$asearch,$admin,$prefs,$help,$logout); | ||
| 139 | - | 153 | + |
| 154 | + | ||
| 155 | + // create array of images for navbar sections | ||
| 156 | + $aTopMenuImages = array($this->home, | ||
| 157 | + $this->mdocs, | ||
| 158 | + $this->asearch, | ||
| 159 | + $this->admin, | ||
| 160 | + $this->prefs, | ||
| 161 | + $this->help, | ||
| 162 | + $this->logout); | ||
| 163 | + | ||
| 164 | + | ||
| 165 | + // create array of menu colour images | ||
| 140 | $row4MenuImages = array($colourHome,$colourmdocs,$colourasearch,$colouradmin,$colourprefs,$colourhelp,$colourlogout); | 166 | $row4MenuImages = array($colourHome,$colourmdocs,$colourasearch,$colouradmin,$colourprefs,$colourhelp,$colourlogout); |
| 141 | 167 | ||
| 168 | + //set up the links | ||
| 142 | $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$aTopMenuImages); | 169 | $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$aTopMenuImages); |
| 143 | $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$row4MenuImages); | 170 | $oColourTableLinks = new PatternTableLinks($aTopMenuLinks, null, 1, 7,2,$row4MenuImages); |
| 144 | 171 | ||
| @@ -152,30 +179,33 @@ class NavBar | @@ -152,30 +179,33 @@ class NavBar | ||
| 152 | //array of coloured section images | 179 | //array of coloured section images |
| 153 | $row4 = $oColourTableLinks->render(); | 180 | $row4 = $oColourTableLinks->render(); |
| 154 | 181 | ||
| 155 | - $toRender = new PatternCustom; | 182 | + $toRender = new PatternCustom; |
| 156 | 183 | ||
| 157 | - //bar width based on main page sizes...80% of width(600)..30% of height(800) | ||
| 158 | - $bar= " | ||
| 159 | - <html> | 184 | + //bar is the actaul html creation of the nav bar |
| 185 | + $bar= " | ||
| 186 | + <html> | ||
| 160 | 187 | ||
| 161 | - <Table border=\"0\" width=\"100%\" height=\"100%\"> | 188 | + <Table cellpadding = \"0\" cellspacing = \"1\" border=\"1\" width=\"100%\" height=\"100%\"> |
| 162 | 189 | ||
| 163 | - <tr><td background = " . $hStretched ." width =\"100%\" height=\"20%\"></td></tr> | 190 | + <tr height=\"20%\"><td background = " . $hStretched ." width =\"100%\">". $row1 ."</td></tr> |
| 164 | 191 | ||
| 165 | - <tr><td background = " . $hStretched ." width =\"100%\" height=\"20%\"> | 192 | + <tr height=\"20%\"><td background = " . $hStretched ." width =\"100%\" ></td></tr> |
| 166 | 193 | ||
| 167 | - <tr><td height= \"25%\">". $row3 . "</td></tr> | 194 | + <tr height=\"10%\" ><td width =\"100%\">". $row3 . "</td></tr> |
| 168 | 195 | ||
| 169 | - <tr><td height=\"25%\">". $row4 . "</td></tr> | 196 | + <tr height=\"10%\"><td width =\"100%\">". $row4 . "</td></tr> |
| 170 | 197 | ||
| 171 | - </table> | 198 | + </table> |
| 172 | 199 | ||
| 173 | - </html> | ||
| 174 | - "; | 200 | + </html> |
| 201 | + "; | ||
| 175 | 202 | ||
| 176 | - $toRender->setHtml($bar); | ||
| 177 | - | ||
| 178 | - return $toRender->render(); | 203 | + |
| 204 | + //set the bar as html to object | ||
| 205 | + $toRender->setHtml($bar); | ||
| 206 | + | ||
| 207 | + //render the object | ||
| 208 | + return $toRender->render(); | ||
| 179 | 209 | ||
| 180 | } | 210 | } |
| 181 | 211 |
lib/visualpatterns/PatternMainPage.inc
| @@ -63,7 +63,7 @@ class PatternMainPage { | @@ -63,7 +63,7 @@ class PatternMainPage { | ||
| 63 | </head> | 63 | </head> |
| 64 | <body> | 64 | <body> |
| 65 | <form id=\"MainForm\" action=\"".$this->sFormAction."\" method=\"get\"> | 65 | <form id=\"MainForm\" action=\"".$this->sFormAction."\" method=\"get\"> |
| 66 | - <table border=\"1\" width=\"850\" height=\"600\">\n | 66 | + <table border=\"1\" width=\"800\" height=\"600\">\n |
| 67 | <tr height=\"18%\">\n | 67 | <tr height=\"18%\">\n |
| 68 | <td width=\"5%\">"; | 68 | <td width=\"5%\">"; |
| 69 | if (isset($this->oNorthWestPayload)) { | 69 | if (isset($this->oNorthWestPayload)) { |
lib/visualpatterns/PatternTableLinks.inc
| @@ -55,13 +55,13 @@ class PatternTableLinks { | @@ -55,13 +55,13 @@ class PatternTableLinks { | ||
| 55 | function & render() { | 55 | function & render() { |
| 56 | $iArraySize = array_count_values($this->aLinks); | 56 | $iArraySize = array_count_values($this->aLinks); |
| 57 | $iArrayCount = 0; | 57 | $iArrayCount = 0; |
| 58 | - $sToRender = "<table width=\"100%\" height=\"100%\">\n"; | 58 | + $sToRender = "<table width=\"100%\" height=\"100%\" cellspacing = \"0\">\n"; |
| 59 | 59 | ||
| 60 | //build the table | 60 | //build the table |
| 61 | for ($i = 0; $i < $this->iRows; $i++) { | 61 | for ($i = 0; $i < $this->iRows; $i++) { |
| 62 | - $sToRender = $sToRender . "<tr>\n"; | 62 | + $sToRender = $sToRender . "<tr >\n"; |
| 63 | for ($j = 0; $j < $this->iColumns; $j++) { | 63 | for ($j = 0; $j < $this->iColumns; $j++) { |
| 64 | - $sToRender = $sToRender . "<td>"; | 64 | + $sToRender = $sToRender . "<td cellspacing = \"0\">"; |
| 65 | if ($iArrayCount < $iArraySize) { | 65 | if ($iArrayCount < $iArraySize) { |
| 66 | $sToRender = $sToRender . "<a href=\"" . $this->aLinks[$iArrayCount] . "\" />"; | 66 | $sToRender = $sToRender . "<a href=\"" . $this->aLinks[$iArrayCount] . "\" />"; |
| 67 | if ($this->iLinkType == TEXT) { | 67 | if ($this->iLinkType == TEXT) { |