00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00022 class ICLCSLayout extends SShodorLayout
00023 {
00024
00025
00026
00027 function layoutTopBar($page, $ms, $dl)
00028 {
00029 global $PATH;
00030 $ctitle = $page->getSlot('CollName');
00031 $nw1 = $nw2 = $nw3 = " ";
00032 switch($dl){
00033 case 'ThreeNavWells':$nw1 = $page->getSlot('TopBarNavWell1');
00034 case 'TwoNavWells':$nw2 = $page->getSlot('TopBarNavWell2');
00035 case 'OneNavWell': $nw3 = $page->getSlot('TopBarNavWell3');
00036 default: break;
00037 }
00038 if ($nw2 == ""){ $nw2 = $nw1; $nw1 = " "; }
00039 if ($nw3 == ""){ $nw3 = $nw2; $nw2 = " "; }
00040
00041 $homeURL = SPath::getFullPath('Project');
00042
00043
00044
00045 $html =<<<END_HTML
00046
00047 <!--************************************
00048 TopBar
00049 ************************************-->
00050
00051 <tbody id="TopBar">
00052 <tr>
00053 <td>
00054 <div id="TopBarBanner">
00055 <a href="$PATH[home]" class="bannerLink" id="ICLCSHome"></a>
00056 <a href="$PATH[chemAtIllinois]" class="bannerLink" id="ChemAtIll"></a>
00057 <a href="$PATH[collegeMedicine]" class="bannerLink" id="CollMedicine"></a>
00058 <a href="$PATH[ncsa]" class="bannerLink" id="NCSA"></a>
00059 <a href="$PATH[acCentral]" class="bannerLink" id="ACCentral"></a>
00060 </div>
00061 </td>
00062 </tr>
00063 </tbody>
00064 END_HTML;
00065 $page->setMetaSlot('TopBar', $html);
00066 }
00067
00068
00069
00080 public function layoutPageTitle ($page, $ms, $dl)
00081 {
00082 if ($page->getSlot('PageTitleRightText') != "") {
00083 $rightSide = "<div class=\"PageTitleRightText\">" . $page->getSlot('PageTitleRightText')
00084 . "</div>";
00085 } else {
00086 $rightSide = "";
00087 }
00088
00089 $ptitle = $page->getSlot('PageName');
00090 $html =<<<END_HTML
00091
00092 <!--************************************
00093 PageTitle
00094 ************************************-->
00095
00096 <tbody id="PageTitle">
00097 <tr>
00098 <td class="pageLeftBorder pageRightBorder">
00099 $rightSide
00100 <h1>$ptitle</h1>
00101 </td>
00102 </tr>
00103 </tbody>
00104 END_HTML;
00105 $page->setMetaSlot('PageTitle', $html);
00106 }
00107
00108
00109
00110
00121 public function layoutPathBar ($page, $ms, $l)
00122 {
00123 $ptitle = $page->getSlot('PageName');
00124 $path = $page->getSlot('Path');
00125
00126 $html =<<<END_HTML
00127
00128 <!--************************************
00129 PathBar
00130 ************************************-->
00131
00132 <tbody id="PathBar">
00133 <tr>
00134 <td class="pageLeftBorder pageRightBorder" id="PathBarTd">
00135 $path > $ptitle
00136 </td>
00137 </tr>
00138 </tbody>
00139 END_HTML;
00140 $page->setMetaSlot('PathBar', $html);
00141 }
00142
00143
00144
00145
00146
00158 public function layoutWell ($wellname, $page, $ms, $l)
00159 {
00160
00161 $html =<<<END_HTML
00162
00163 <!--************************************
00164 $wellname
00165 ************************************-->
00166 <tbody id="$wellname">
00167 <tr>
00168 END_HTML;
00169
00170 $col2 = $col3 = $leftSideBar = $rightSideBar = "";
00171 $wrapperId = $wellname . "Wrapper";
00172
00173
00174 $wnc1 = $wellname . "Column1";
00175 $mainContent = ($wellname == "ContentWell") ? $page->getSlot('Main') : $page->getSlot("$wellname");
00176 $col1 = $this->packageColumn($mainContent, $wellname, '1');
00177 $wellTdName = $wellname . "Td";
00178
00179 $wellStart = <<<ENDSTART
00180 <td class="pageLeftBorder pageRightBorder" id="$wellTdName">
00181 <div id="UpperFeatureWellDiv" align="center">
00182 <table class="WellWrapper" id="$wrapperId" border="0" cellspacing="0" cellpadding="0">
00183 <tr>
00184 ENDSTART;
00185 $wellEnd = <<<ENDEND
00186 </tr>
00187 </table>
00188 </div>
00189 </td>
00190 ENDEND;
00191
00192 $wellEnd .=<<<END_HTML
00193 </tr>
00194 END_HTML;
00195
00196 $wellEnd .= "</tbody>";
00197
00198
00199
00200 switch($l){
00201 case 'Start':
00202 $page->setMetaSlot("$wellname", $html . $wellStart);
00203 return;
00204 case 'End':
00205 $page->setMetaSlot("$wellname", $wellEnd);
00206 return;
00207 case 'LeftSideBarOnly':
00208 $leftSideBar = $this->packageSideBar($page->getSlot($wellname . 'SideBar'), 'Left');
00209 $rightSideBar = "";
00210 break;
00211 case 'RightSideBarOnly':
00212 $leftSideBar = "";
00213 $rightSideBar = $this->packageSideBar($page->getSlot($wellname . 'SideBar'), 'Right');
00214 break;
00215 case 'BothSideBars':
00216 $leftSideBar = $this->packageSideBar($page->getSlot($wellname . 'SideBar'), 'Left');
00217 $rightSideBar = $this->packageSideBar($page->getSlot($wellname .'SideBar2'), 'Right');
00218 break;
00219 case 'ThreeColumns':
00220 $col3 = $this->packageColumn($page->getSlot($wellname . "Column3"), $wellname, '3');
00221
00222 case 'TwoColumns':
00223 $col2 = $this->packageColumn($page->getSlot($wellname . "Column2"), $wellname, '2');
00224 break;
00225 case 'OneColumn':
00226 case 'NoSideBars':
00227 default:
00228 break;
00229 }
00230
00231
00232 $html .=<<<END_HTML
00233 $wellStart
00234 $leftSideBar
00235 $col1
00236 $col2
00237 $col3
00238 $rightSideBar
00239 $wellEnd
00240 END_HTML;
00241
00242
00243 $page->setMetaSlot("$wellname", $html);
00244 }
00245
00246
00247
00248
00259 public function layoutBottomBar ($page, $ms, $l)
00260 {
00261 $leftText = $page->getSlot('BottomBarLeftText');
00262 $rightText = $page->getSlot('BottomBarRightText');
00263 $bbrt = ($rightText == "") ? "" :
00264 "<div style=\"float:right\" id=\"BottomBarRightText\">$rightText</div>";
00265 $yearNow = date('Y');
00266 $html =<<<END_HTML
00267
00268 <!--************************************
00269 BottomBar
00270 ************************************-->
00271 <tbody id="BottomBar"><tr>
00272 <td class="pageLeftBorder pageRightBorder contentTd">
00273 $bbrt
00274 <div id="BottomBarLeftText">
00275 Institute for Chemistry Literacy Through Computational Science<br/>
00276 National Center for Supercomputing Applications Cybereducation<br/>
00277 1205 W Clark St.<br/>
00278 Urbana, Illinois, 61801, USA<br/>
00279 217.244.0409 $leftText
00280 </div>
00281 </td></tr></tbody>
00282
00283 END_HTML;
00284 $page->setMetaSlot('BottomBar', $html);
00285 }
00286 }
00287
00288
00289 ?>