Example #1
0
 public function displayNav()
 {
     global $AssetPath;
     global $CpanelPath;
     global $subcat;
     global $is_um;
     $headshot = getHeadshot($_SESSION["email"], "smaller", "");
     $headshot_lg = getHeadshot($_SESSION["email"], "", "");
     $staff_page = $CpanelPath . "admin/profile.php";
     if ($_SESSION["fname"]) {
         $name = $_SESSION["fname"];
     } else {
         $name = $_SESSION["email"];
     }
     print "\n      <ul id=\"topnav\">\n      <li id=\"logospot\"><a href=\"{$CpanelPath}" . "index.php\"><img src=\"{$AssetPath}" . "images/admin/logo_v3_full.png\" /></a>\n      <div>{$headshot_lg}\n      <p> Hi {$name} </p>\n      <br style=\"clear: both\" />\n      <ul>\n      <li><a href=\"{$staff_page}\">" . _("Edit Your Profile") . "</a></li>\n      <li><a href=\"{$CpanelPath}" . "logout.php\">" . _("Log Out") . "</a></li>\n      </ul>\n      </div>\n      </li>\n      ";
     ///////////////
     // RECORDS
     // records and guides use same authentication credential
     ///////////////
     if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) {
         print "\n\t     <li";
         if ($subcat == "records") {
             print " class=\"selected\"";
         }
         print "><a href=\"{$CpanelPath}" . "records/\">" . _("Records") . "</a>\n        <div>\n         <ul>\n            <li><a href=\"{$CpanelPath}" . "records/record.php\">" . _("New Record") . "</a></li>\n            <li><a href=\"{$CpanelPath}" . "records/index.php\">" . _("Browse Items") . "</a></li>\n         </ul>\n\t\t  </div></li>";
         ///////////////
         // GUIDES
         //////////////
         print "<li";
         if ($subcat == "guides") {
             print " class=\"selected\"";
         }
         print "><a href=\"{$CpanelPath}" . "guides/\">" . _("Guides") . "</a>\n      <div>\n       <ul>\n          <li><a href=\"{$CpanelPath}" . "guides/metadata.php\">" . _("New Guide") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "guides/\">" . _("Browse Guides") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "guides/manage.php\">" . _("Manage Files") . "</a></li>\n          <!--<li><a href=\"{$CpanelPath}" . "guides/delish_url.php\">" . _("Delicious Builder") . "</a></li>-->\n          <li><a href=\"{$CpanelPath}" . "guides/link_checker.php\">" . _("Link Checker") . "</a></li>\n       </ul>\n      </div></li>";
     }
     //////////
     // FAQs
     //////////
     if (isset($_SESSION["faq"]) && $_SESSION["faq"] == 1) {
         print "\n        <li";
         if ($subcat == "faq") {
             print " class=\"selected\"";
         }
         print "><a href=\"{$CpanelPath}" . "faq/\">" . _("FAQs") . "</a>\n      <div>\n        <ul>\n          <li><a href=\"{$CpanelPath}" . "faq/faq.php\">" . _("New FAQ") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=subject\">" . _("Browse by Subject") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=holding\">" . _("Browse by Collection") . "</a></li>\n        </ul>\n      </div>\n      </li>";
     }
     // TalkBack tab
     if (isset($_SESSION["talkback"]) && $_SESSION["talkback"] == 1) {
         print "\n\t<li";
         if ($subcat == "talkback") {
             print " class=\"selected\"";
         }
         print "><a href=\"{$CpanelPath}" . "talkback/\">" . _("TalkBack") . "</a></li>";
     }
     // Videos tab
     if (isset($_SESSION["videos"]) && $_SESSION["videos"] == 1) {
         print "\n            <li><a href=\"{$CpanelPath}" . "videos/\"";
         if ($subcat == "videos") {
             print " class=\"selected\"";
         }
         print ">" . _("Videos") . "</a>\n      <div>\n        <ul>\n          <li><a href=\"{$CpanelPath}" . "videos/\">" . _("List Current") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "videos/ingest.php\">" . _("Find/Ingest") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "videos/video.php\">" . _("Manually Enter") . "</a></li>\n        </ul>\n       </div></li>";
     }
     // Stats tab
     if ($is_um == TRUE) {
         if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) {
             print "\n            <li><a href=\"{$CpanelPath}" . "stats/\"";
             if ($subcat == "stats") {
                 print " class=\"selected\"";
             }
             print ">" . _("Stats") . "</a>\n      <div>\n        <ul>\n          <li><a href=\"{$CpanelPath}" . "stats/\">" . _("Overview") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "stats/ref_stats.php\">" . _("Add Transaction") . "</a></li>\n        </ul>\n       </div></li>";
         }
     }
     // Admin tab
     if (isset($_SESSION["admin"]) && $_SESSION["admin"] == 1) {
         print "\n\t<li";
         if ($subcat == "admin") {
             print " class=\"selected\"";
         }
         print "><a href=\"{$CpanelPath}" . "admin/\">" . _("Admin") . "</a>\n      <div>\n    \t\t<ul>\n    \t\t\t<li><a href=\"{$CpanelPath}" . "admin/user.php\">" . _("Add New User") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "admin/user.php?browse\">" . _("Manage Users") . "</a></li>\n    \t\t\t<li><a href=\"{$CpanelPath}" . "admin/manage_guides.php\">" . _("Manage Guides") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "admin/guide_collections.php\">" . _("Guide Collections") . "</a></li>\n    \t\t\t<li><a href=\"{$CpanelPath}" . "admin/departments.php\">" . _("Departments") . "</a></li>\n    \t\t\t<li><a href=\"{$CpanelPath}" . "admin/sources.php\">" . _("Sources") . "</a></li>\n          <li><a href=\"{$CpanelPath}" . "admin/faq_collections.php\">" . _("FAQ Collections") . "</a></li>\n    \t\t\t<li><a href=\"{$CpanelPath}" . "edit-config.php\">" . _("Config Site") . "</a></li>\n    \t\t</ul>\n      </div>\n\t   </li>";
     }
     // determine our default search/search box text
     switch ($subcat) {
         case "records":
             $input_text = _("Search records");
             $target_url = "record.php?record_id=";
             break;
         case "guides":
             $input_text = _("Search guides");
             $target_url = "../guides/guide.php?subject_id=";
             break;
         case "faq":
             $input_text = _("Search faqs");
             $target_url = "faq.php?faq_id=";
             break;
         case "home":
             $input_text = _("Search all");
             $target_url = "../control/guides/guide.php?subject_id=";
             break;
         case "talkback":
             $input_text = _("Search talkback");
             $target_url = "talkback.php?talkback_id=";
             break;
         case "admin":
             $input_text = _("Search users");
             $target_url = "user.php?staff_id=";
             break;
         default:
             $input_text = _("Search all");
             $target_url = "guide.php?subject_id=";
             break;
     }
     print "\n    <li class=\"nohover\">";
     $input_box = new CompleteMe("sp_search", $CpanelPath . "search.php", $target_url, $input_text, $subcat, "", "private");
     $input_box->displayBox();
     print "\n    </li>";
 }
Example #2
0
 public function displayNav()
 {
     global $AssetPath;
     global $CpanelPath;
     global $subcat;
     $headshot = getHeadshot($_SESSION["email"], "smaller");
     print "\n\t<div class=\"float-left\" id=\"logo\"><a href=\"{$CpanelPath}" . "index.php\"><img src=\"{$AssetPath}" . "images/admin/logo_small.png\"  border=\"0\" class=\"logo\" alt=\"SubjectsPlus\" /></a></div>\n   <div id=\"navcats\">\n      <ul class=\"topnav\">";
     // Records tab, Guides Tab
     if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) {
         // Actually, someone with the NOFUN permission can't view records
         if (!isset($_SESSION["NOFUN"])) {
             print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "records/\"";
             if ($subcat == "records") {
                 print " class=\"selected\"";
             }
             print ">" . _("Records") . "</a>\n         <ul class=\"subnav\">\n            <li><a href=\"{$CpanelPath}" . "records/record.php\">" . _("New Record") . "</a></li>\n            <li><a href=\"{$CpanelPath}" . "records/index.php\">" . _("Browse Items") . "</a></li>\n         </ul>\n\t\t</li>";
         }
         ///////////////
         // GUIDES
         //////////////
         print "<li class=\"zoom\"><a href=\"{$CpanelPath}" . "guides/\"";
         if ($subcat == "guides") {
             print " class=\"selected\"";
         }
         print ">" . _("Guides") . "</a>\n   <ul class=\"subnav\">\n      <li><a href=\"{$CpanelPath}" . "guides/metadata.php\">" . _("New Guide") . "</a></li>\n      <li><a href=\"{$CpanelPath}" . "guides/\">" . _("Browse Guides") . "</a></li>\n      <li><a href=\"{$CpanelPath}" . "guides/manage.php\">" . _("Manage Files") . "</a></li>\n      <li><a href=\"{$CpanelPath}" . "guides/delish_url.php\">" . _("Delicious Builder") . "</a></li>\n      <li><a href=\"{$CpanelPath}" . "guides/link_checker.php\">" . _("Link Checker") . "</a></li>\n   </ul>\n</li>";
     }
     // FAQ tab
     if (isset($_SESSION["faq"]) && $_SESSION["faq"] == 1) {
         print "\n            <li class=\"zoom\"><a href=\"{$CpanelPath}" . "faq/\"";
         if ($subcat == "faq") {
             print " class=\"selected\"";
         }
         print ">FAQs</a>\n                    <ul class=\"subnav\">\n                            <li><a href=\"{$CpanelPath}" . "faq/faq.php\">" . _("New FAQ") . "</a></li>\n                            <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=subject\">" . _("Browse by Subject") . "</a></li>\n                            <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=holding\">" . _("Browse by Collection") . "</a></li>\n                    </ul>\n\n            </li>";
     }
     // TalkBack tab
     if (isset($_SESSION["talkback"]) && $_SESSION["talkback"] == 1) {
         print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "talkback/\"";
         if ($subcat == "talkback") {
             print " class=\"selected\"";
         }
         print ">TalkBack</a></li>";
     }
     // Videos tab
     if (isset($_SESSION["videos"]) && $_SESSION["videos"] == 1) {
         print "\n            <li class=\"zoom\"><a href=\"{$CpanelPath}" . "videos/\"";
         if ($subcat == "videos") {
             print " class=\"selected\"";
         }
         print ">Videos</a>\n                    <ul class=\"subnav\">\n                      <li><a href=\"{$CpanelPath}" . "videos/\">" . _("List Current") . "</a></li>\n                      <li><a href=\"{$CpanelPath}" . "videos/ingest.php\">" . _("Find/Ingest") . "</a></li>\n                      <li><a href=\"{$CpanelPath}" . "videos/video.php\">" . _("Manually Enter") . "</a></li>\n                    </ul>\n            </li>";
     }
     // Admin tab
     if (isset($_SESSION["admin"]) && $_SESSION["admin"] == 1) {
         print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "admin/\"";
         if ($subcat == "admin") {
             print " class=\"selected\"";
         }
         print ">" . _("Admin") . "</a>\n\t\t<ul class=\"subnav\">\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/user.php\">" . _("Add New User") . "</a></li>\n                    <li><a href=\"{$CpanelPath}" . "admin/user.php?browse\">" . _("Manage Users") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/manage_guides.php\">" . _("Manage Guides") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/departments.php\">" . _("Departments") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/sources.php\">" . _("Sources") . "</a></li>\n                        <li><a href=\"{$CpanelPath}" . "admin/faq_collections.php\">" . _("FAQ Collections") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "edit-config.php\">" . _("Config Site") . "</a></li>\n\t\t</ul>\n\n\t</li>";
     }
     print "</ul>\n\t\t</div>\n      <div class=\"right-nav-container\">\n      <div id=\"supersearch\">";
     // determine our default search/search box text
     switch ($subcat) {
         case "records":
             $input_text = _("Search records");
             $target_url = "record.php?record_id=";
             break;
         case "guides":
             $input_text = _("Search guides");
             $target_url = "guide.php?subject_id=";
             break;
         case "faq":
             $input_text = _("Search faqs");
             $target_url = "faq.php?faq_id=";
             break;
         case "talkback":
             $input_text = _("Search talkback");
             $target_url = "talkback.php?talkback_id=";
             break;
         case "admin":
             $input_text = _("Search users");
             $target_url = "user.php?staff_id=";
             break;
         default:
             $input_text = _("Search all");
             $target_url = "guide.php?subject_id=";
             break;
     }
     // don't show to the NOFUN crowd
     if (!isset($_SESSION["NOFUN"])) {
         $input_box = new CompleteMe("quick_search", $CpanelPath . "search.php", $target_url, $input_text, $subcat, "", "private");
         $input_box->displayBox();
     }
     print "</div>\n      <div id=\"user\">\n      <ul class=\"topnav\">\n      <li class=\"zoom\"><a>";
     print $headshot;
     print _("Hi") . ", " . $_SESSION["fname"];
     print "</a>\n         <ul class=\"subnav\">\n            <li><a href=\"#\">" . _("View My Profile") . "</a></li>\n            <li><a href=\"{$CpanelPath}" . "logout.php\">" . _("Logout") . "</a></li>\n         </ul>\n      </li>\n      </ul>\n       </div>\n      </div>\n";
 }