示例#1
0
 public static function configurePage(Template $t, $title, $bodyContent = null, $jsExtra = null)
 {
     $t->insertSlot("TITLE", $title);
     $currentPage = DocumentHelper::getCurrentPageName();
     if ($bodyContent !== null) {
         $t->insertSlot("BODY_CONTENT", $bodyContent);
     }
     if ($jsExtra !== null) {
         $t->insertBlock("JS_EXTRA", $jsExtra);
     }
     if (SessionHelper::isAdmin()) {
         // logged in as admin
         $t->insertSlot("LOGIN_TEXT", "LOG OUT " . SessionHelper::getName());
         $t->insertSlot("LOGIN_LINK", "logout.php");
     } else {
         $t->insertBlock("LOGIN", "");
     }
     // menu - highlight current page
     $t->insertSlot("CLASS_ABOUT", $currentPage == "about.php" ? "current" : "");
     $t->insertSlot("CLASS_BOOKINGS", $currentPage == "bookings.php" ? "current" : "");
     $t->insertSlot("CLASS_VALET_PARKING", $currentPage == "valet_parking.php" ? "current" : "");
     $t->insertSlot("CLASS_VEHICLE_STORAGE", $currentPage == "vehicle_storage.php" ? "current" : "");
     $t->insertSlot("CLASS_POOL_CAR", $currentPage == "pool_car.php" ? "current" : "");
     $t->insertSlot("CLASS_RATES", $currentPage == "rates.php" ? "current" : "");
     $t->insertSlot("CLASS_VIDEO", $currentPage == "video.php" ? "current" : "");
 }