Exemple #1
0
// -------------------------------------------------------------------------
// --> Additional definitions in (output after the styles defined here):
//       document->buildLayoutUpdate()
// -----------------------
// -- STYLESHEETS
// -----------------------
if (USE_MINIFIED) {
    $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "min.css";
    $GLOBALS[SUBSITE]["stylesheets"]["print"][] = "print.min.css";
} else {
    $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "screen.css";
    $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "widget.css";
    $GLOBALS[SUBSITE]["stylesheets"]["print"][] = "print.css";
}
/* Load after 'screen.css' and 'widget.css' */
if (SHOW_MYMENU && auth::isAuthenticated() && !auth::isLogoutRequested()) {
    $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "loginbar.css";
}
if (SHOW_TEST_TABS) {
    $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "margintabs.css";
}
// -----------------------
// -- STYLESHEETS-CONDITIONAL
// -----------------------
/* Keep for later editing
  $GLOBALS[SUBSITE]["stylesheets-conditional"]["lt IE 6"]["screen"][] = "hacks/msie5.css";
*/
// =========================================================================
// =========================================================================
// -- COMMON SITE-WIDE SCRIPT FILES
//
Exemple #2
0
 private function buildConfigOfPageUpdate()
 {
     // -----------------------------------------------------------
     // -- (1) Update $this->configOfPage with menu configuration of current page
     // -----------------------------------------------------------
     if (isset($this->allMenusArray[$this->pagePath])) {
         foreach ($this->allMenusArray[$this->pagePath] as $field => $value) {
             $this->setConfig($field, $value);
         }
     }
     // -----------------------------------------------------------
     // -- (2) Massage some of the fields in $this->configOfPage
     // -----------------------------------------------------------
     if (!$this->getConfig("requirelogin") && $this->getConfig("access")) {
         $this->setConfig("logintype", "link");
     }
     // -----------------------
     if ($this->getConfig("listincontext")) {
         $this->setConfig("notintopmenu", 1);
     }
     // -----------------------
     // Login form should always be 'medwide'
     // -----------------------
     if (auth::isLoginType("inline") && (!auth::isAuthenticated() || auth::isLogoutRequested() || !auth::isAccessGranted())) {
         $this->setConfig("wide", 0);
         $this->setConfig("medwide", 1);
         $this->setConfig("rightwide", 0);
         //$this->setConfig("nocolophon", 1);
     }
     // -----------------------
     // Any kind of login form must have stylesheet 'loginform.css'
     // -----------------------
     if ((auth::isLoginRequired() || auth::isLoginAllowed()) && (!auth::isAuthenticated() || auth::isLogoutRequested())) {
         $GLOBALS[SUBSITE]["stylesheets"]["all"][] = "loginform.css";
     }
     // -----------------------
     if (IS_ERRORPAGE) {
         $this->setConfig("title", "Oops! Something seems to have gone wrong...");
         $this->setConfig("bodyid", "error");
     }
     //    if (IS_TESTSERVER) {
     //      $this->setConfig("robots","noindex,nofollow,noodp,noydir");
     //    }
     //TODO: convert to current framework
     /*
         if ($this->getConfig("wide") ) {
           unset($GLOBALS["blocks"]["top"]);
           unset($GLOBALS["blocks"]["subtree"]);
           unset($GLOBALS["blocks"]["fixedimage"]);
           unset($GLOBALS["blocks"]["splashimage"]);
           unset($GLOBALS["blocks"]["sidebar"]);
           $GLOBALS["blocks"]["twotop"] = 1;
         } else if ($this->getConfig("medwide") ) {
           unset($GLOBALS["blocks"]["sidebar"]);
         }
     */
     // For 'people/doorlabel'
     if (isset($_REQUEST["us"]) && count($_REQUEST["us"]) <= 4) {
         $this->setConfig("nobanner", 1);
         $this->setConfig("nobackground", 1);
         $this->setConfig("nocolophon", 1);
         $this->setConfig("nopagetitle", 1);
     }
     // -----------------------
     if (isset($_REQUEST["eventlist_select"])) {
         $this->setConfig("url", functions::callMethod("event", "lib/event", "getEventListUrl"));
     }
     // -----------------------
     if (isset($_REQUEST["statistics_preprints"])) {
         switch ($_REQUEST["preprints_type"]) {
             case "word":
                 $this->setConfig("plaincss", 1);
                 $this->setConfig("nomenu", 1);
                 $this->setConfig("nocss", 1);
                 $this->setConfig("nocolophon", 1);
                 $this->setConfig("nobanner", 1);
                 $this->setConfig("nosearch", 1);
                 $this->setConfig("nopagetitle", 1);
                 $this->setConfig("nobackground", 1);
                 break;
             case "text":
                 $this->setConfig("bodyid", "text");
                 break;
         }
     }
     // -----------------------
     // If received data from login form, check authentication and redirect on success:
     // -----------------------
     if ((isset($_REQUEST["auth_submitted"]) || isset($_SESSION["mypear_auth_attempted"])) && auth::checkLogin()) {
         $this->setConfig("url", $_SERVER["PHP_SELF"]);
     }
     // -----------------------
     // Possibly modify $this->configOfPage["bannertext"]
     // -- Initiated to "Nordic Institute <span class='only_online'><br></span>for
     //    Theoretical Physics" in 'config_SUBSITE.php'.
     // -- NB that YB apps pages should be self-sufficient
     // -----------------------
     // Legacy YB-style, with page title in banner box; probably no longer used
     if ($this->getConfig("titleinbanner") && !$this->getConfig("nopagetitle")) {
         $this->setConfig("bannertext", $this->getConfig("title"));
     }
     /* RESTORE if test tabs needed */
     /*
     if (SHOW_TEST_TABS && IS_INDEXPAGE && isset($GLOBALS["frontselect"]) && ($GLOBALS["frontselect"]==10)) $this->setConfig("bannertext",""); */
     // -----------------------
     // Set $this->configOfPage["titletag"]
     // -- TITLE TAG IN <HEAD>
     //    TITLE and TITLE_EXTENSION are defined in 'config.php'
     // -----------------------
     $thetitle = "";
     if (IS_ERRORPAGE) {
         $thetitle = TITLE . " - " . $this->httpstatus_sc . " " . $this->httpstatus_reason;
     } elseif (IS_INDEXPAGE) {
         $thetitle = TITLE . " - " . TITLE_EXTENSION;
     } elseif (!empty($_REQUEST["iid"])) {
         if (!isset($GLOBALS["newsClass"])) {
             if (!class_exists("fromdb_nwnews", FALSE)) {
                 require_once PATH_CLASSES . "/fromdb/nwnews.php";
             }
             $GLOBALS["newsClass"] = new fromdb_nwnews();
         }
         $thearticle = $GLOBALS["newsClass"]->getIssue(NEWS_ANYISSUE, $_REQUEST["iid"]);
         $issue = !empty($thearticle["issue_year"]) && !empty($thearticle["issue_number"]) ? ". " . $thearticle["issue_year"] . ", Issue " . $thearticle["issue_number"] : "";
         $thetitle = "Nordita Newsletter" . $issue . " - " . TITLE;
     } elseif (!empty($_REQUEST["u"])) {
         $userdata = functions::callMethod('people', 'lib/people', 'getPeopleArray');
         $fullname = isset($userdata[$_REQUEST["u"]]) && !empty($userdata[$_REQUEST["u"]]["nw_fullname"]) ? $userdata[$_REQUEST["u"]]["nw_fullname"] . " - " : "";
         $thetitle = $fullname . TITLE;
     } elseif ($this->getConfig("title")) {
         $thetitle = $this->getConfig("title") . " - " . TITLE;
     } elseif (!empty($_REQUEST["htmltitel"])) {
         $thetitle = $_REQUEST["htmltitel"] . " - " . TITLE;
     }
     $this->setConfig("titletag", $thetitle);
     /* RESTORE if test tabs needed */
     /*
     if (SHOW_TEST_TABS && IS_INDEXPAGE && !empty($GLOBALS["frontselect"])) $this->setConfig("titletag","[" . $GLOBALS["frontselect"] . "] " . $this->getConfig("titletag")); */
 }
Exemple #3
0
 public static function Btopmenu($id = "topmenu", $blockclass = "", $liclass = "")
 {
     $stdout = "";
     if (IS_ENTRANCE) {
         return "";
     }
     $work = $GLOBALS["documentClass"]->getMenuThisTop();
     $txt = "";
     foreach ($work as $subpage) {
         if (auth::isAccessGranted($subpage["access"])) {
             if (!empty($subpage)) {
                 $txt .= "            <li class='" . (!empty($liclass) ? $liclass . " " : "") . ($subpage["active"] && !empty($subpage["path"]) ? "expanded" : "collapsed") . ($subpage["path"] == PUBLICCRUMB ? " last " : "") . "'><a href='" . $subpage["url"] . "'>" . str_replace(TEST_PREFIX, "", str_replace(EXTERNAL_LINK, "", $subpage["title"])) . "</a></li>\r\n";
             }
         }
     }
     /* RESTORE if test tabs needed */
     /*
     if (SHOW_TEST_TABS && IS_INDEXPAGE && ($GLOBALS["frontselect"]==10)) $txt = "            <li style='float:none;height:auto;margin:0px;padding:2px 15px 0px 65px;text-decoration:none;font-size:1.4em;font-weight:normal;font-family:\"Baskerville\",\"Times\",\"Times New Roman\",serif;letter-spacing:0.2em;'>The Nordic Institute for Theoretical Physics</li>\r\n"; */
     $stdout = "        <div id='block-" . $id . "'" . (!empty($blockclass) ? " class='" . $blockclass . "'" : "") . ">\r\n" . "          <ul>\r\n" . ($GLOBALS["documentClass"]->getConfig("requirelogin") && (!auth::isAuthenticated() || auth::isLogoutRequested()) ? "" : $txt) . "          </ul>\r\n" . "        </div> <!-- " . $id . " -->\r\n" . "\r\n";
     return $stdout;
 }