Exemplo n.º 1
0
 function buildPageHtml()
 {
     $stdout = "";
     /* RESTORE if test tabs needed */
     /*
     if (SHOW_TEST_TABS) {
         // -- GET switches, used in test site
         functions::gpc_declare_input("nostartpageboxes",true, true,array(),true);
         // -- Optionally display startpage boxes
         if (isset($_REQUEST["nostartpageboxes"])) {
           $_SESSION["nostartpageboxes"] = $GLOBALS["nostartpageboxes"];
         }
     } */
     // ---------------------------------------------------------------------------
     // PAGE PREAMBLE
     // ---------------------------------------------------------------------------
     // -- Document Type
     $stdout .= DOCTYPE . "\r\n\r\n";
     // ---------------------------------------------------------------------------
     // <HTML> OPEN TAG
     // ---------------------------------------------------------------------------
     // Conditional IE Classes
     //   An alternative to using separate conditionally loaded IE CSS files
     //     http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
     //   NB: IE9 is here assumed to be standards-compliant
     // HTML5 Cache Manifest (offline reading)
     //   http://en.wikipedia.org/wiki/Cache_manifest_in_HTML5
     //   http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html
     $attributes = "lang='" . LANGUAGE_CODE . "'" . "";
     $stdout .= "<!--[if lt IE 7]>      <html " . $attributes . " class='ie6'> <![endif]-->\r\n" . "<!--[if IE 7]>         <html " . $attributes . " class='ie7'> <![endif]-->\r\n" . "<!--[if IE 8]>         <html " . $attributes . " class='ie8'> <![endif]-->\r\n" . "<!--[if gt IE 8]><!--> <html " . $attributes . ">             <!--<![endif]-->\r\n" . "\r\n";
     // ---------------------------------------------------------------------------
     // <HEAD> ELEMENT
     // ---------------------------------------------------------------------------
     $stdout .= "  <head>\r\n\r\n";
     // ---------------------------------------
     // -- Load <head> elements
     //    Invoke after loading menu array config parameters
     // ---------------------------------------
     if (!isset($GLOBALS[SUBSITE]["head"])) {
         $this->buildPageAuxHead();
     }
     foreach ($GLOBALS[SUBSITE]["head"] as $legend => $cd) {
         if (!empty($cd)) {
             $stdout .= $cd;
         }
     }
     if (count($GLOBALS[SUBSITE]["head"])) {
         $stdout .= "\r\n";
     }
     // ---------------------------------------
     // -- Styles (defined in 'layout.php'; extra in 'data/block_margintabs' and document->buildLayoutUpdate())
     // ---------------------------------------
     $txt = "";
     if (isset($GLOBALS[SUBSITE]["stylesheets"])) {
         foreach ($GLOBALS[SUBSITE]["stylesheets"] as $media => $arr) {
             $txt .= $this->buildPageAuxStylesheets($media, $arr);
         }
     }
     if (isset($GLOBALS[SUBSITE]["stylesheets-conditional"])) {
         foreach ($GLOBALS[SUBSITE]["stylesheets-conditional"] as $iecond => $sarr) {
             foreach ($sarr as $media => $arr) {
                 $txt .= $this->buildPageAuxStylesheets($media, $arr, $iecond);
             }
         }
     }
     if (!empty($txt)) {
         $stdout .= $txt . "\r\n";
     } else {
         // -- Fix for the FOUC problem for MSIE;
         //    See: http://bluerobot.com/web/css/fouc.asp/,
         //    http://www.webkit.org/blog/66/the-fouc-problem/
         //    and http://en.wikipedia.org/wiki/Flash_of_unstyled_content
         $stdout .= "    <script type='text/javascript'> </script>\r\n\r\n";
     }
     // ---------------------------------------
     // -- Scripts (defined in 'config.php')
     //    Moved to end of document
     // ---------------------------------------
     if (isset($GLOBALS[SUBSITE]["scripts-head"])) {
         foreach ($this->getConfig("scripts-head") as $type => $arr) {
             $stdout .= $this->buildPageAuxScripts($type, $arr) . "\r\n";
         }
     }
     if (isset($GLOBALS[SUBSITE]["scripts-head-conditional"])) {
         foreach ($GLOBALS[SUBSITE]["scripts-head-conditional"] as $iecond => $sarr) {
             foreach ($sarr as $type => $arr) {
                 $stdout .= $this->buildPageAuxScripts($type, $arr, $iecond) . "\r\n";
             }
         }
     }
     // ---------------------------------------
     // -- Google Analytics script
     //  http://code.google.com/apis/analytics/
     //  https://www.google.com/analytics/settings/ (old site)
     //
     // Asynchronous tracking (recommended):
     //  http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=174090
     // ---------------------------------------
     if (!IS_TESTSERVER && !in_array(SUBSITECRUMB, array("_admin"))) {
         $stdout .= "    <script type='text/javascript'>\r\n" . "      var _gaq = _gaq || [];\r\n" . "      _gaq.push(['_setAccount', '" . GOOGLE_ANALYTICS_ACCOUNT . "']);\r\n" . "      _gaq.push(['_setDomainName', '" . GOOGLE_ANALYTICS_DOMAIN . "']);\r\n" . "      _gaq.push(['_trackPageview']);\r\n" . "      (function() {\r\n" . "        var ga = document.createElement('script'); " . "ga.type = 'text/javascript'; ga.async = true;\r\n" . "        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') " . "+ '.google-analytics.com/ga.js';\r\n" . "        var s = document.getElementsByTagName('script')[0]; " . "s.parentNode.insertBefore(ga, s);\r\n" . "      })();\r\n" . "    </script>\r\n\r\n";
     } else {
         $stdout .= "    <!-- suppressed Google Analytics code -->\r\n\r\n";
     }
     // ---------------------------------------
     $stdout .= "  </head>\r\n\r\n\r\n";
     // ---------------------------------------------------------------------------
     // FLUSH TO HTTP RESPONSE
     //   See: http://developer.yahoo.com/performance/rules.html#flush
     // ---------------------------------------------------------------------------
     //    flush();
     // ---------------------------------------------------------------------------
     // <BODY> START TAG, POSSIBLY WITH JAVASCRIPT CALLS
     // ---------------------------------------------------------------------------
     $bodyattributes = "";
     // --- ID
     //     bodyid = ["display"|"timetable"|"slideshow"|"search"|...]
     //     Set in 'PATH_MENU/m_*' as $pg[SUBSITE]["bodyid"]
     unset($bodyattributes_id);
     if ($this->getConfig("bodyid")) {
         $bodyattributes_id[] = $this->getConfig("bodyid");
     }
     if (isset($bodyattributes_id)) {
         $bodyattributes .= " id='" . implode(" ", $bodyattributes_id) . "'";
     }
     // --- CLASS
     //     body.wiki
     //     body.nobackground
     //     body.nobanner
     //     body.wide
     $bclasses = array("tabbed", "nobackground", "nobanner", "wide", "medwide", "rightwide", "nopagetitle", "nosearchfocus", "nobanneronprint", "nomenu");
     $bodyattributes_class = array();
     foreach ($bclasses as $bclass) {
         if ($this->getConfig($bclass) && isset($bodyattributes_class) && !in_array($bclass, $bodyattributes_class)) {
             $bodyattributes_class[] = $bclass;
         }
     }
     if ($this->getConfig("theme") != "") {
         $bodyattributes_class[] = $this->getConfig("theme");
     }
     if (IS_TESTSERVER && IS_INDEXPAGE && (isset($_SESSION["nostartpageboxes"]) && $_SESSION["nostartpageboxes"])) {
         $bodyattributes_class[] = "nostartpageboxes";
     }
     // -- Optionally display screen resolution background
     if (IS_TESTSERVER) {
         functions::gpc_declare_input("nw_screenresolution", false, true, array(), true);
         if ($_SESSION["nw_screenresolution"]) {
             $bodyattributes_class[] = "nw_screenresolution";
         }
     }
     if ($this->getConfig("nolist")) {
         $bodyattributes_class[] = "noindex";
     }
     /* RESTORE if test tabs needed */
     /*
     if (SHOW_TEST_TABS && isset($GLOBALS["frontselect"])) {
           $bodyattributes_class[] = "frontselect".$GLOBALS["frontselect"];
     } */
     // --- SCRIPT
     //$bodyattributes_script[] = "";
     // --- TOTAL
     if (isset($bodyattributes_class) && count($bodyattributes_class)) {
         $bodyattributes .= " class='" . implode(" ", $bodyattributes_class) . "'";
     }
     if (isset($bodyattributes_script) && count($bodyattributes_script)) {
         $bodyattributes .= implode(" ", $bodyattributes_script);
     }
     // --- ONLOAD
     unset($bodyattributes_onload);
     // ======================================================================
     //TODO: these should be put in some config file
     // initiate google map in colophon (call before 'focus'):
     if (isInPath("googlemap")) {
         $bodyattributes_onload[] = "initmap(\"googlemap-map-canvas\",12)";
     }
     // ======================================================================
     // ======================================================================
     //TODO: these should be put in some config file
     if (auth::isLoginRequired() && !auth::isAuthenticated()) {
         $bodyattributes_onload[] = "document.getElementById(\"auth_username\").focus()";
     } elseif (SHOW_SEARCH && !$this->getConfig("nosearchfocus")) {
         if (isInPath("/people/search/") && !isset($_REQUEST["pqry"])) {
             $bodyattributes_onload[] = "document.getElementById(\"pqry\").focus()";
         } elseif (SHOW_SEARCH && isInPath("/search/") && !isset($_REQUEST["qry"]) && !isset($_REQUEST["sqry"])) {
             // orca search form
             $bodyattributes_onload[] = "document.getElementById(\"qry\").focus()";
         } else {
             // simple search form
             $bodyattributes_onload[] = "document.getElementById(\"sqry\").focus()";
             // keep but don't use
         }
     } elseif ($this->getConfig("nosearchfocus") && !isset($_REQUEST["qry"]) && !isset($_REQUEST["sqry"]) && !isset($_REQUEST["pqry"])) {
         if ((isInPath("/" . PATH_NEWS . "/") || isInPath("/" . PATH_NEWSTEST . "/")) && isset($_REQUEST["cmt_text"])) {
             $bodyattributes_onload[] = "document.getElementById(\"cmt_text\").focus()";
         } else {
             // mainly captcha form
             $bodyattributes_onload[] = "document.getElementById(\"" . CAPTCHA_ID . "\").focus()";
         }
     }
     // ======================================================================
     // $bodyattributes_onload[] = "window.location.reload(true)"; //NOP
     if (isset($bodyattributes_onload) && !IS_PRINT) {
         $bodyattributes .= " onLoad='" . implode(";", $bodyattributes_onload) . "'";
     }
     // ---
     $stdout .= "  <body" . $bodyattributes . (HIDE_BACKGROUND_IMAGE ? " style='background-image:none!important'" : "") . ">\r\n" . "\r\n";
     //Only during test period:
     $stdout .= TESTSERVER_FLAG;
     //if (IS_TESTSERVER) $stdout.= "<h1 style='position:fixed;width:50%;margin:0;color:red;top:0px;left:0px;opacity:0.2'>[TESTSERVER]</h1>\r\n\r\n";
     //if (IS_ON_KTH_SERVER) $stdout.= "<h1 style='position:fixed;width:50%;margin:0;color:red;top:0px;left:0px;opacity:0.2'>[VIRTUAL SERVER]</h1>\r\n\r\n";
     // ---------------------------------------------------------------------------
     // PAGE CONTENT
     //   containers -> regions -> blocks
     //   [set in 'layout/<nr>/layout' and 'sites/SUBSITE/config_SUBSITE']
     // ---------------------------------------------------------------------------
     // DEBUG --
     $newlayout = false;
     if ($newlayout) {
         // -- DEBUG
         // *** Handling of the "new layout" has not been debugged yet! ***
         $stdout .= "\r\n" . "    <!-- ========================================================= -->\r\n\r\n\r\n";
         $data = "";
         foreach ($GLOBALS[SUBSITE]["layout"] as $containerId => $callback) {
             $data = $this->renderCallback($callback);
             if (!empty($data)) {
                 $stdout .= "    <div id='" . $containerId . "'" . ($this->getConfig("isindex") ? " class='index'" : "") . ">\r\n\r\n" . $data . "    </div> <!-- " . $containerId . " -->\r\n\r\n\r\n" . "    <!-- ========================================================= -->\r\n\r\n\r\n";
             }
         }
         // end foreach
         // DEBUG --
     } else {
         // -- DEBUG
         $stdout .= "\r\n" . "    <!-- ========================================================= -->\r\n\r\n\r\n";
         foreach ($GLOBALS[SUBSITE]["containers"] as $cont => $regs) {
             $data = "";
             foreach ($regs as $r) {
                 if ($r != "colophon" || !$this->getConfig("nocolophon")) {
                     if (count($GLOBALS[SUBSITE]["regions"][$r])) {
                         $txt = "";
                         if (is_array($GLOBALS[SUBSITE]["regions"][$r])) {
                             foreach ($GLOBALS[SUBSITE]["regions"][$r] as $feat) {
                                 if (!empty($feat)) {
                                     $txt .= functions::outputFunctionCall($feat);
                                 }
                             }
                         }
                         if (!empty($txt)) {
                             $data .= "      <div id='region-" . $r . "'" . (isset($GLOBALS[SUBSITE]["classes"]["region-" . $r]) ? " class='" . $GLOBALS[SUBSITE]["classes"]["region-" . $r] . "'" : "") . ">\r\n\r\n" . $txt . "      </div> <!-- " . $r . " -->\r\n\r\n";
                         }
                     }
                 }
             }
             $data = trim($data);
             if (!empty($data)) {
                 $stdout .= "    <div id='container-" . $cont . "'" . ($this->getConfig("isindex") ? " class='index'" : "") . ">\r\n\r\n" . "      " . $data . "\r\n\r\n" . "    </div> <!-- " . $cont . " -->\r\n\r\n\r\n" . "    <!-- ========================================================= -->\r\n\r\n\r\n";
             }
         }
         // end foreach
         // DEBUG --
     }
     // -- DEBUG
     // ---------------------------------------------------------------------------
     // IMAGE PRELOADING
     // ---------------------------------------------------------------------------
     /* this is NOT particularly useful...
         $stdout .=
           "    <div style='display:none'>\r\n" .
           "      <img src='_css/img/_splash/sprite-splash-nordita.png' alt='' style='width:1px;height:1px;'>\r\n" .
           "      <img src='img/backdrop_pentaflakes_1200_win.jpg' alt='' style='width:1px;height:1px;'>\r\n" .
           "    </div>\r\n" .
           "\r\n";
     */
     // ---------------------------------------------------------------------------
     // JAVASCRIPTS AT END OF DOCUMENT
     //   See http://developer.yahoo.com/performance/rules.html#js_bottom
     // ---------------------------------------------------------------------------
     if (isset($GLOBALS[SUBSITE]["scripts"])) {
         foreach ($GLOBALS[SUBSITE]["scripts"] as $type => $arr) {
             $stdout .= $this->buildPageAuxScripts($type, $arr) . "\r\n";
         }
     }
     if (isset($GLOBALS[SUBSITE]["scripts-conditional"])) {
         foreach ($GLOBALS[SUBSITE]["scripts-conditional"] as $iecond => $sarr) {
             foreach ($sarr as $type => $arr) {
                 $stdout .= $this->buildPageAuxScripts($type, $arr, $iecond);
             }
         }
     }
     $stdout .= "\r\n";
     // ---------------------------------------------------------------------------
     // END OF <BODY> AND <HTML> TAGS
     // ---------------------------------------------------------------------------
     $stdout .= "  </body>\r\n\r\n" . "</html>\r\n\r\n\r\n\r\n";
     // ---------------------------------------------------------------------------
     return $stdout;
 }
Exemplo n.º 2
0
 public static function BmyMenu($id = "mymenu", $class = "")
 {
     // class="centered"
     $stdout = $userIcon = $menuitems = $logoutLink = $contentblock = "";
     $menuitem = array();
     if (!defined("SEPARATE_LOGIN")) {
         define("SEPARATE_LOGIN", "<span style='color:#777' title='separate login required'>(&#8270;)</span> ");
     }
     // -------------------------------
     // -- check if bar might not be needed
     // -------------------------------
     if (!auth::isAuthenticated() && auth::isLoginType("inline") || auth::isLoginRequested() || !auth::isAuthenticated() && !auth::isLoginRequired() && !auth::isLoginAllowed() || $GLOBALS["documentClass"]->getConfig("nobanner")) {
         return "";
     }
     // -------------------------------
     // -- return with login icon if logout requested
     // -------------------------------
     if (auth::checkLogout()) {
         $stdout = auth::drawLoginLink();
         if (empty($stdout)) {
             return "";
         }
         return "        <div" . (!empty($id) ? " id='block-login'" : "") . ">\r\n" . $stdout . "        </div> <!-- " . $id . " -->\r\n" . "\r\n";
     }
     // -------------------------------
     // -- obtain data
     // -------------------------------
     $username = auth::getUsername();
     $userData = functions::callMethod('people', 'lib/people', 'getUserData', $username);
     $userFullName = isset($userData["nw_fullname"]) ? $userData["nw_fullname"] : "";
     // -------------------------------
     // -- collect output snippets
     // -------------------------------
     $iconfile = PATH_PEOPLE . "/48x48/" . $username . "-48.png";
     if (file_exists(INCLEVEL . $iconfile)) {
         $userIcon = "         <div class='my-usericon'>\r\n" . "           <a href='people/staff/index.php?u=" . $username . "'>" . "<img src='" . $iconfile . "' alt='" . $userFullName . "' title='" . $userFullName . "'>" . "</a>\r\n" . "         </div>\r\n" . "\r\n";
     }
     $logoutLink = "         <div id='my-logout'>\r\n" . "           <form method='post' action='" . PATH_FROM_DOCROOT . "'>\r\n" . "             <input type='hidden' name='login' value='0'>\r\n" . "             <input type='submit' value='[Logout]' class='fakelink bold'>\r\n" . "           </form>\r\n" . "         </div>\r\n" . "\r\n";
     $menuitem["fullname"] = array("label" => !empty($userFullName) ? $userFullName : "My Personal Data", "content" => array("1" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate CMS login required</em></p>\r\n" . "                  <p><em>Note that the &quot;Employees and Alumni&quot; (EA) database of Nordita is independent of the HR database of KTH, so you might want to check both.</em></p>\r\n" . "                  <ul>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='http://cms.nordita.org/?q=ea/356353008'>View and Edit My Personal Info</a> <span class='nowrap'>[CMS-EA]</span></li>\r\n" . "                  </ul>\r\n", "2" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate KTH login required</em></p>\r\n" . "                  <ul>\r\n" . "                  <li>" . SEPARATE_LOGIN . "<a href='https://hrweb.admin.kth.se/' target='_blank'>Edit My Home Address &amp;c</a><br><em>Egenrapportering &#8594; Mina&nbsp;Sidor &#8594; Mina&nbsp;Personuppgifter</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://login.kth.se/password/change?l=en' target='_blank'>Change My KTH Password</a></li>\r\n" . (!empty($userData["acc_kth"]) ? "                    <li>" . SEPARATE_LOGIN . "<a href='https://www.kth.se/profile/" . $userData["acc_kth"] . "/' target='_blank'>Edit My KTH Online Profile</a></li>\r\n" : "") . "                    <li>" . SEPARATE_LOGIN . "<a href='https://www.kth.se/internt/minasidor/installningar/mail.jsp?l=en_UK&null=' target='_blank'>Edit My E-Mail Forwarding Address</a></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://www.kth.se/internt/minasidor/installningar/mail.jsp?l=en_UK&null=' target='_blank'>Check My E-Mail Aliases</a></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://login.sys.kth.se/peapshow.html' target='_blank'>Show My Eduroam Password (&quot;Network Secret&quot;)</a></li>\r\n" . "                  </ul>\r\n", "3" => "                  <ul>\r\n" . "                    <li><a href='eduroam/'>Wireless Login Using Eduroam</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                  </ul>\r\n"));
     $menuitem["myemployment"] = array("label" => "My Employment", "content" => array("1" => "", "2" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate KTH login required</em></p>\r\n" . "                  <p><em>Note that some of the sevices below do not apply for Nordita fellows (=scholarships)</em></p>\r\n" . "                  <ul>\r\n" . "                    <li><a href='http://intra.kth.se/en/anstallning' target='_blank'>My Employment at KTH</a> (Overview)</li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://www.flexpay.se/fps/setLanguage.do?&amp;languageId=12' target='_blank'>Employment Benefits &quot;KTH&nbsp;For&nbsp;Me&quot;</a></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://hrweb.admin.kth.se/' target='_blank'>Salary Specification</a><br><em>Egenrapportering &#8594; Mina&nbsp;Sidor &#8594; Lönespec&nbsp;Online &#8594; check+button [lönespec&nbsp;online&nbsp;(presentation)]</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://hrweb.admin.kth.se/' target='_blank'>Register Vacation</a><br><em>Egenrapportering &#8594; Mina&nbsp;Ärenden &#8594; Ledigheter</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://hrweb.admin.kth.se/' target='_blank'>Register Sick Leave</a><br><em>Egenrapportering &#8594; Mina&nbsp;Ärenden &#8594; Sjuk&nbsp;&amp;&nbsp;Vård&nbsp;av...</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://hrweb.admin.kth.se/' target='_blank'>Register Overtime</a><br><em>Egenrapportering &#8594; Mina&nbsp;Ärenden &#8594; Övertid&nbsp;&amp;&nbsp;Mertid</em></li>\r\n" . "                  </ul>\r\n", "3" => "                  <ul>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                  </ul>\r\n"));
     $menuitem["mytravels"] = array("label" => "My Travels", "content" => array("1" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate CMS login required</em></p>\r\n" . "                  <ul>\r\n" . "                    <li><a href='" . URL_PREFIX . "/travel/' target='_blank'>View Nordita &quot;Who Is Where&quot; Travel Schedule</a></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='" . URL_PREFIX . "/travel/private/edit-confirm.php' target='_blank'>Edit My Travels in Nordita Travel Schedule</a></li>\r\n" . "                    <li><a href='intranet/job/travels/scholarship/request/' target='_blank'>Travel Request</a> (only for Nordita fellows/scholarships)</li>\r\n" . "                  </ul>\r\n", "2" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate KTH login required</em></p>\r\n" . "                  <p><em>The KTH-RES system should only be used by Nordita employees (not fellows/scholarships)</em></p>\r\n" . "                  <ul>\r\n" . "                    <li><a href='http://intra.kth.se/en/administration/kth-res' target='_blank'>KTH-RES</a> (Overview and Guides)</li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://kth.ebuilder.se/' target='_blank'>Book New Travel</a> (only for employees)<br><em>Travel &#8594; Booking</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://kth.ebuilder.se/' target='_blank'>Manage Travel Bills</a> (only for employees)<br><em>Travel &#8594; Travel&nbsp;bill</em></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='https://kth.ebuilder.se/ebbooking/profile/personprofile.do' target='_blank'>Edit My KTH-RES Profile</a></li>\r\n" . "                  </ul>\r\n", "3" => "                  <ul>\r\n" . "                    <li><a href='intranet/job/travels/'>Travel</a></li>\r\n" . "                    <li><a href='intranet/job/travels/employment/'>Travel for Employees</a></li>\r\n" . "                    <li><a href='intranet/job/travels/scholarship/'>Travel for Scholarships</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                  </ul>\r\n"));
     $menuitem["myguests"] = array("label" => "My Guests", "content" => array("1" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate CMS login required</em></p>\r\n" . "                  <ul>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='http://cms.nordita.org/?q=vm/1735395761/1961830993'>See People I Invite</a> <span class='nowrap'>[CMS-VM]</span></li>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='http://cms.nordita.org/?q=vm/1735395761/1181421194'>Register New Guest</a> <span class='nowrap'>[CMS-VM]</span></li>\r\n" . "                  </ul>\r\n", "2" => "", "3" => "                  <ul>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                  </ul>\r\n"));
     $menuitem["myevents"] = array("label" => "My Events", "content" => array("1" => "                  <p>" . SEPARATE_LOGIN . "<em>means separate CMS login required</em></p>\r\n" . "                  <ul>\r\n" . "                    <li>" . SEPARATE_LOGIN . "<a href='http://cms.nordita.org/?q=vm/3862121824'>Manage Events I Organize</a> <span class='nowrap'>[CMS-VM]</span></li>\r\n" . "                  </ul>\r\n", "2" => "", "3" => "                  <ul>\r\n" . "                    <li><a href='organizers/index.php'>For Organizers of Nordita Events</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                    <li><a href='" . $_SERVER["REQUEST_URI"] . "#'>Dummy Link...</a></li>\r\n" . "                  </ul>\r\n"));
     // -- NB.
     //    The three columns in the panels need to be realized as a <table> rather than as positioned
     //    <div> (eg. as <div class='col c1of3'> etc). For the jQuery UI tabs generated panels to have
     //    a non-zero height, the content must not be positioned as absolute, fixed or float; just
     //    position relative cannot generate three parallel columns; this leaves <table> as only option.
     foreach ($menuitem as $target => $item) {
         $menuitems .= "              <li class='" . $target . "'>" . "<a href='" . (!empty($item["url"]) ? $item["url"] : $_SERVER["REQUEST_URI"] . "#" . $target) . "'>" . $item["label"] . "</a>" . "</li>\r\n";
         if (!is_array($item["content"])) {
             $content = "              &nbsp;";
         } else {
             $content = "              <table><tr>\r\n" . "                <td>\r\n" . "                  <h4>Nordita</h4>\r\n" . (!empty($item["content"][1]) ? $item["content"][1] : "                  <p>&#8212;</p>\r\n") . "                </td>\r\n" . "                <td>\r\n" . "                  <h4>KTH</h4>\r\n" . (!empty($item["content"][2]) ? $item["content"][2] : "                  <p>&#8212;</p>\r\n") . "                </td>\r\n" . "                <td>\r\n" . "                  <h4>Nordita Help Pages</h4>\r\n" . (!empty($item["content"][3]) ? $item["content"][3] : "                  <p>&#8212;</p>\r\n") . "                </td>\r\n" . "              </tr></table>\r\n";
         }
         $contentblock .= "            <div id='" . $target . "'>\r\n" . $content . "            </div>\r\n" . "\r\n";
     }
     // -------------------------------
     // -- output data
     // -------------------------------
     $stdout = "      <div" . (!empty($id) ? " id='block-" . $id . "'" : "") . (!empty($class) ? " class='" . $class . "'" : "") . ">\r\n" . "\r\n" . "        <div>\r\n" . "\r\n" . $userIcon . "          <div id='my-tabs'>\r\n" . "\r\n" . "            <ul>\r\n" . $menuitems . "            </ul>\r\n" . "\r\n" . $contentblock . "          </div> <!-- my-tabs -->\r\n" . "\r\n" . $logoutLink . "        </div>\r\n" . "\r\n" . "      </div> <!-- " . $id . " -->\r\n" . "\r\n";
     return $stdout;
 }