当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::callMethod方法代码示例

本文整理汇总了PHP中functions::callMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::callMethod方法的具体用法?PHP functions::callMethod怎么用?PHP functions::callMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


在下文中一共展示了functions::callMethod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSignature

 static function getSignature()
 {
     //people::loadClass();
     $stdout = "";
     // ------------------------------
     // Obtain user data
     // ------------------------------
     functions::gpc_declare_input("usr", false);
     functions::gpc_declare_input("beenthere", false, true);
     $userdata = functions::callMethod('people', 'lib/people', 'doorlabelData');
     // yes, get doorlabel data
     if (empty($userdata)) {
         return BLURB_SORRY_PEOPLE_SEARCH;
     }
     // ------------------------------
     // Adapt user data
     // ------------------------------
     $entry = array();
     if (isset($GLOBALS["usr"]) && $GLOBALS["usr"]) {
         $entry = $userdata[$GLOBALS["usr"]];
         if ($entry["nw_user"] == "sigste") {
             $entry["nw_fullname"] = str_replace("igurdur", "igurður", $entry["nw_fullname"]);
         }
         if (!class_exists("fromdb_cv", FALSE)) {
             require_once PATH_CLASSES . "/fromdb/cv.php";
         }
         $dbCv = new fromdb_cv();
         $cvitems = $dbCv->getCvs();
         $entry["nw_cv"] = isset($cvitems[$entry["nw_user"]]) ? $cvitems[$entry["nw_user"]] : "";
     }
     // ------------------------------
     // Output user data or input form
     // ------------------------------
     if (count($entry)) {
         $sig = self::constructSignatures($entry, "en");
         //$userdata = functions::callMethod('people','lib/people','doorlabelData'); // yes, get doorlabel data
         //$stdout .= self::outputSignature($userdata[$GLOBALS["usr"]]);
         //$showform = 0;
         /* FOR SIGNATURE FILES
               header("Content-Type: application/octet-stream");
               print utf8_decode(self::outputSignature($entry));
               die();
         */
         $stdout .= "<div class='col-content-left'>\r\n" . "  <ul class='tightlist'>\r\n" . "    <li class='bottommargin'>Select a <a href='" . $_SERVER["PHP_SELF"] . "?usr=" . $GLOBALS["usr"] . "#text'><strong>text signature</strong></a></li>\r\n" . "    <li class='bottommargin'>Select a <a href='" . $_SERVER["PHP_SELF"] . "?usr=" . $GLOBALS["usr"] . "#graphic'><strong>graphic (HTML formatted) signature</strong></a></li>\r\n" . "  <li class='bottommargin'>" . "<a href='" . $_SERVER["PHP_SELF"] . "#maildb_doorlabel'><strong>Back to E-Mail Signature Page</strong></a></li>\r\n" . "  </ul>\r\n" . "</div> <div class='col-content-right'>\r\n" . functions::OutputWikiPage('0', '2458') . "</div><div style='clear:both'><br></div>\r\n" . "\r\n";
         foreach ($sig as $type => $si) {
             $stdout .= PAGE_BREAK . "<hr id='" . $type . "' style='margin-top:2em'>\r\n";
             foreach ($si as $id => $s) {
                 $stdout .= "<h4>" . ucfirst($type) . " Signature Example #" . $id . "</h4>\r\n" . self::outputSignature($s, $type) . "\r\n" . "\r\n";
             }
         }
     } else {
         // leave vertical space for error messages
         unset($GLOBALS["usr"]);
         $stdout .= self::outputSignatureForm($userdata);
     }
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:57,代码来源:

示例2: outputStaticDisplayColumns

 public static function outputStaticDisplayColumns()
 {
     $column = array();
     // -- CLOCK + CURRENT EVENT + APOD
     $column[1] = "          <div class='@ col narrow'>\r\n" . "\r\n" . self::outputDisplayTime("display-time") . "            <div class='column-clear'></div>\r\n" . "\r\n" . "[BUS]" . "            <div class='column-clear'></div>\r\n" . "\r\n" . functions::callMethod("event", "lib/event", "outputEventCurrentEntrance", "display-currentevent") . functions::callMethod("widget", "lib/widget", "Wapod", "display-apod", "widget-table") . "            <div class='column-clear'></div>\r\n" . "\r\n" . "          </div> <!-- col narrow -->\r\n" . "\r\n";
     // -- COLLOQUIUM + TIP OF THE DAY + VISITORS
     $content = functions::callMethod("event", "lib/event", "outputColloquiumWidget", "display-colloquium", "month", "widget-table") . self::outputDisplayTip("display-tip") . functions::callMethod('event', 'lib/event', 'OutputArrivingVisitors', 'display-visitors', 'today');
     if (empty($content)) {
         $content = functions::callMethod("preprint", "lib/preprint", "OutputRecentPreprints", "display-preprints", "", "", "0", "1", "1");
     }
     $column[2] = "          <div class='@ col medium'>\r\n" . "\r\n" . $content . "            <div class='column-clear'></div>\r\n" . "\r\n" . "          </div> <!-- col medium -->\r\n" . "\r\n";
     return $column;
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例3: outputPositionsDropdown

 public static function outputPositionsDropdown($text = "data", $id = "position_id", $maxChars = 35)
 {
     $stdout = "";
     $data = array();
     functions::gpc_declare_input($id, "", false);
     // -----------------------------
     // -- Obtain data
     // -----------------------------
     $campaigns = functions::callMethod('fromdb_nwpositions', 'fromdb/nwpositions', 'getCampaigns');
     if (empty($campaigns)) {
         return "";
     }
     foreach ($campaigns as $regend => $arr) {
         foreach ($arr as $idx => $a) {
             $data[$regend . " " . $idx] = array($id => $a[$id], "title" => isset($a["title"]) ? $a["title"] : "", "regend" => isset($a["regend"]) ? $a["regend"] : "");
         }
     }
     krsort($data);
     // -----------------------------
     // -- Dropdown list
     // -----------------------------
     $dropdownList = "            <strong>Select the Nordita position</strong> for which you want to display the " . $text . ":\r\n" . "            <br><select name='" . $id . "' onchange='submit()' style='font-size:1.1em'>\r\n" . "              <option value='0'>-&#45;- select from list -&#45;-</option>\r\n";
     foreach ($data as $pos) {
         $lbl = functions::truncateStringByWord($pos["title"], $maxChars);
         $lbl = substr($pos["title"], 0, $maxChars);
         if ($maxChars < strlen($pos["title"])) {
             $lbl .= "...";
         }
         $dropdownList .= "              <option value='" . $pos["position_id"] . "'" . (isset($_REQUEST[$id]) && $pos[$id] == $_REQUEST[$id] ? " selected" : "") . (strtotime($pos["regend"]) >= time() ? " class='future'>" . $pos["regend"] . " &nbsp; " . $lbl : " class='past'>" . $pos["regend"] . " &nbsp; [" . $lbl . "]") . "</option>\r\n";
     }
     // end foreach
     $dropdownList .= "            </select>\r\n" . "\r\n";
     // -----------------------------
     $stdout .= "        <div class='only_online'>\r\n" . "          <form " . "action='" . $_SERVER["PHP_SELF"] . "' " . "method='POST' " . "enctype='multipart/form-data' " . "name='ST1'>\r\n" . $dropdownList . "          </form>\r\n" . "        </div>\r\n" . "\r\n";
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:36,代码来源:

示例4: authenticateByMypear

 public static function authenticateByMypear($login, $pwd)
 {
     if (!OK_TO_CALL_MYPEAR && !IS_TESTSERVER) {
         return false;
     }
     //TODO: translate from ($login,$pwd) to MyPear GPC input data
     // --------------------------------------
     // -- Load the entire myPear framework (about 47 classes).
     //    This will also run myPear authentication, and if successful, the variables
     //    $_SESSION["bAuth"]["email"] and bAuth::$av
     //    are created, and the browser is redirected to the requested page.
     //    MyPear authentication is run by bAuth->__construct().
     //    If authentication is handled by myPear, the session variable
     //    $_SESSION["mypear_auth_attempted"] is set in order to capture
     //    authentication failiure.
     // --------------------------------------
     $_SESSION["mypear_auth_attempted"] = 1;
     if (IS_TESTSERVER) {
         echo "<h3>Classes before bAuth()</h3>";
         print_r(get_declared_classes());
     }
     auth::initializeBauth();
     if (IS_TESTSERVER) {
         echo "<hr><h3>Classes after bAuth()</h3>";
         print_r(get_declared_classes());
     }
     // 0-130 (PHP) 131-132 (nw) 133-180 (myPear)
     // --------------------------------------
     // -- If authentication was done by myPear, translate authentication results to
     //    NW-style variables
     // --------------------------------------
     if (!isset($_SESSION["nwAuth"]["authenticated"]) && isset($_SESSION["bAuth"]["email"])) {
         $_SESSION["nwAuth"]["authenticated"] = $_SESSION["bAuth"]["email"];
     }
     if (!isset($_SESSION["nwAuth"]["identity"]) && isset(bAuth::$av)) {
         self::setUsername(bAuth::$av->getIdentity());
         // username
         $_SESSION["nwAuth"]["identity"] = bAuth::$av->nameSimple();
         // full name
         // Bugfix for strange UTF-8 decoding error...
         $_SESSION["nwAuth"]["identity"] = str_replace(chr(227), chr(195), utf8_decode($_SESSION["nwAuth"]["identity"]));
         $_SESSION["nwAuth"]["institute"] = bAuth::$av->getInst();
         // institute
         if (self::getUsername() == "hvzm") {
             $_SESSION["nwAuth"]["institute"] = "Nordita";
         }
         // fix
         if (in_array(self::getUsername(), array("yb", "iourib"))) {
             $_SESSION["nwAuth"]["institute"] = "AlbaNova,Nordita";
         }
         // fix
         //TODO: tillfällig fix; kolla vad detta svarar mot i bAuth->$av
         $userdata = functions::callMethod('people', 'lib/people', 'getPeopleArray');
         $_SESSION["nwAuth"]["employeegrp"] = isset($userdata[self::getUsername()]) && isset($userdata[self::getUsername()]["nw_employeeTitleGrp"]) ? $userdata[self::getUsername()]["nw_employeeTitleGrp"] : "";
     }
 }
开发者ID:,项目名称:,代码行数:56,代码来源:

示例5: getEventCalendarData

 public static function getEventCalendarData($selectAll = FALSE)
 {
     functions::gpc_declare_input("vert", 0, true);
     $allConfids = self::getAgendaConferenceIdsForNorditaEvents();
     if (!is_array($allConfids) || empty($allConfids)) {
         return array();
     }
     $calendar = array();
     $proglist = array();
     $eventIdToTitle = array();
     $eventIdToPath = array();
     $grid = array();
     foreach ($allConfids as $confId) {
         $oneprogram = functions::callMethod('event', 'lib/event', 'getEventByAgendaid', $confId);
         if (!empty($oneprogram)) {
             $yr = date("Y", $oneprogram["from"]);
             if (substr($oneprogram["startdate"], -5) != "01-01" && ($selectAll || date("Y") <= $yr)) {
                 $calendar[$yr][date("z", $oneprogram["from"])][] = $oneprogram["id"];
                 $calendar[$yr][date("z", $oneprogram["to"])][] = -$oneprogram["id"];
                 $eventIdToTitle[$oneprogram["id"]] = $oneprogram["title"];
                 $eventIdToPath[$oneprogram["id"]] = $oneprogram["subpath"];
                 unset($coord);
                 if (isset($oneprogram["chairs"]) && is_array($oneprogram["chairs"])) {
                     foreach ($oneprogram["chairs"] as $ch) {
                         $coord[] = $ch["av_firstname"] . " " . $ch["av_lastname"];
                     }
                 }
                 $proglist[$oneprogram["startdate"]] = array("title" => $oneprogram["title"], "id" => $oneprogram["id"], "subpath" => $oneprogram["subpath"], "startdate" => $oneprogram["startdate"], "chairlist" => isset($coord) ? implode(", ", $coord) : "", "enddate" => $oneprogram["enddate"], "blurb" => "", "eventtype" => $oneprogram["eventtype"], "period" => $oneprogram["period"]);
             }
         }
     }
     // end foreach
     ksort($calendar);
     foreach ($calendar as $yr => $cal) {
         ksort($cal);
         $calendar[$yr] = $cal;
     }
     ksort($proglist);
     foreach ($calendar as $yr => $cal) {
         $firsttime = mktime(0, 0, 0, 1, 1, $yr);
         $lastday = date("z", mktime(0, 0, 0, 12, 31, $yr));
         $idx = array();
         for ($day = 0; $day <= $lastday; $day++) {
             $thistime = mktime(0, 0, 0, 1, $day + 1, $yr);
             $thisdate = date("j", $thistime);
             $thismonth = date("n", $thistime);
             if (isset($calendar[$yr][$day])) {
                 foreach ($calendar[$yr][$day] as $v) {
                     if ($v < 0) {
                         unset($idx[abs($v)]);
                     } else {
                         $idx[$v] = $v;
                     }
                 }
             }
             if ($GLOBALS["vert"]) {
                 $grid[$yr][$thisdate][$thismonth] = join(" ", $idx);
                 for ($i = $thisdate + 1; $i <= 31; $i++) {
                     // fill to end of month
                     $grid[$yr][$i][$thismonth] = NULL;
                 }
             } else {
                 $grid[$yr][$thismonth][$thisdate] = join(" ", $idx);
                 for ($i = $thisdate + 1; $i <= 31; $i++) {
                     // fill to end of month
                     $grid[$yr][$thismonth][$i] = NULL;
                 }
             }
             // end if
         }
         // end foreach
     }
     return array("proglist" => $proglist, "eventIdToTitle" => $eventIdToTitle, "eventIdToPath" => $eventIdToPath, "grid" => $grid);
 }
开发者ID:,项目名称:,代码行数:74,代码来源:

示例6: getEventsParticipants

 function getEventsParticipants($confid, $onlyaccepted = true, $allowrejected = false)
 {
     if (is_array($confid)) {
         return array();
     }
     // --------------------------
     // We can't trust VM data to be updated correctly, if changes are made to
     // participant data in the Agenda. Take data directly form the Agenda, by
     // way of the nw_events database.
     $basic = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getEventsParticipantsBasicdata', $confid);
     // --------------------------
     $statusString = $onlyaccepted ? "AND (V.v_status = 'STATUS_YES')" : ($allowrejected ? "" : "AND (V.v_status <> 'STATUS_NO')");
     $sql = "\n      SELECT\n        E.e_name,\n        A.av_firstname AS 'firstname',\n        A.av_lastname AS 'lastname',\n        A.av_salutation AS 'salutation',\n        A.av_institute AS 'institute',\n        A.av_city AS 'city',\n        A.av_residentship AS 'country',\n        A.av_email AS 'email',\n        A.av_photo AS 'photo',\n        FROM_UNIXTIME(V.v_start,'%Y-%m-%d') AS 'start',\n        FROM_UNIXTIME(V.v_end,'%Y-%m-%d') AS 'end',\n        GREATEST(IFNULL(X.exp_travel,0),IFNULL(X.exp_travel_est,0)) AS 'exp_travel',\n        GREATEST(IFNULL(X.exp_living,0),IFNULL(X.exp_living_est,0)) AS 'exp_living',\n        GREATEST(IFNULL(X.exp_perdiem,0),IFNULL(X.exp_perdiem_est,0)) AS 'exp_perdiem',\n        GREATEST(IFNULL(X.exp_other,0),IFNULL(X.exp_other_est,0)) AS 'exp_other',\n        V.v_status AS 'status'\n      FROM\n        abs_visits AS V\n        LEFT JOIN zzz_avatars AS A ON A.av_id=V.v_avid\n        LEFT JOIN abs_events AS E ON E.e_code=SUBSTRING(V.v_code,1,4)\n        LEFT JOIN abs_expenses AS X ON X.exp_vid=V.v_id\n      WHERE\n        (E.e_code='" . $confid . "') " . $statusString . "\n      ORDER BY\n        A.av_lastname,A.av_firstname";
     $res = $this->query($sql, IS_TESTSERVER);
     // includes a call to connect
     $data = array();
     $GLOBALS["eventTitle"] = "";
     if ($this->num_rows($res)) {
         while ($cell = $this->next_record_assoc($res)) {
             $cell = array_map("stripcslashes", $cell);
             if (isset($basic[$cell["email"]])) {
                 foreach ($basic[$cell["email"]] as $k => $v) {
                     $cell[$k] = $v;
                 }
             }
             $data[$cell["lastname"] . $cell["email"]] = $cell;
             $GLOBALS["eventTitle"] = $cell["e_name"];
         }
         // end while
     }
     ksort($data);
     // --------------------------
     return $data;
 }
开发者ID:,项目名称:,代码行数:34,代码来源:

示例7: buildConfigOfPageUpdate

 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"));
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例8: updateOneEventFromAgenda

 public function updateOneEventFromAgenda($confId, $keepAllEvents = FALSE)
 {
     if (empty($confId) || !is_numeric($confId)) {
         return FALSE;
     }
     $default_room = "";
     // ------------------------------------------------------------------
     // -- Get data for $confId event from Agenda API
     // ------------------------------------------------------------------
     //@@@ -- in updateOneEventFromAgenda() -- calls getOneEvent
     $event = functions::callMethod('fromdb_agenda', 'fromdb/agenda', 'getOneEvent', $confId, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE);
     if (empty($event)) {
         return FALSE;
     }
     // Remove startup programs (which have no assigned dates yet)
     if (!$keepAllEvents && (!isset($event["start"]) || strpos($event["start"], "01-01") !== FALSE)) {
         return FALSE;
     }
     //TODO: check if this $confId at all exists in the DB so that it can be updated
     // ------------------------------------------------------------------
     // -- Get additional data for $confId event from scraping Agenda page
     // ------------------------------------------------------------------
     //sleep(5); // to avoid DoS
     $event_from_scraping["agendapageisopen"] = 1;
     ////$thepath = "http://www.nordita.org/".$event_from_file["subpath"]."/"; // must end with "/"
     //$thepath = "http://agenda.albanova.se/conferenceDisplay.py?confId=".$confId;
     //$data = functions::acurl($thepath); // assign to variable first
     //$event_from_scraping["agendapageisopen"] = (strpos($data,"signInForm")===FALSE) ? 1 : 0;
     // ------------------------------------------------------------------
     // -- Get and update data for the same event in nw_events database
     // ------------------------------------------------------------------
     // -------------------------------
     // -- Component 'event'
     // -------------------------------
     $sql = "SELECT event_id FROM " . $this->dbprefix . "event WHERE event_id='" . $confId . "'";
     $res = $this->query($sql, IS_TESTSERVER);
     // includes a call to connect
     $record_exists = $this->num_rows($res) ? 1 : 0;
     /* KEEP FOR REFERENCE
     
     // Select basic info about a given event, including list of organizers:
     
     SELECT
     E.*,
     GROUP_CONCAT(DISTINCT P.organizer SEPARATOR ', ') AS 'organizers'
     FROM
     event AS E
     LEFT JOIN (
     SELECT
     event_id,
     CONCAT(av_firstname,' ',av_lastname) as 'organizer'
     FROM
     person
     WHERE
     (event_id='4393') AND (person_type='organizer')
     ) AS P ON P.event_id=E.event_id
     WHERE
     E.event_id='4393'
     GROUP BY
     E.event_id
     
     */
     foreach (array("title", "room", "attenders") as $field) {
         if (!isset($event[$field])) {
             $event[$field] = "";
         }
     }
     foreach (array("start", "end", "regstart", "regend") as $field) {
         if (!isset($event[$field])) {
             $event[$field] = DATETIME_NULL;
         }
     }
     if (!empty($event["room"])) {
         $default_room = addslashes(strip_tags(substr($event["room"], 0, 49)));
     }
     if ($record_exists) {
         // -- Update database record
         $sql = "UPDATE " . $this->dbprefix . "event " . "SET " . "  title='" . addslashes(strip_tags(substr($event["title"], 0, 199))) . "'," . "  room='" . addslashes(strip_tags(substr($event["room"], 0, 49))) . "'," . "  start='" . addslashes(strip_tags($event["start"])) . "'," . "  end='" . addslashes(strip_tags($event["end"])) . "'," . "  regstart='" . addslashes(strip_tags($event["regstart"])) . "'," . "  regend='" . addslashes(strip_tags($event["regend"])) . "'," . "  attenders='" . addslashes(strip_tags($event["attenders"])) . "', " . "  agendapageisopen='" . addslashes(strip_tags($event_from_scraping["agendapageisopen"])) . "' " . "WHERE " . "  event_id='" . $confId . "'";
     } else {
         // -- Get additional data for $confId event from manually kept data file
         include_once PATH_MENU . "/m_events.php";
         $m_events = menu_events();
         $event_from_file = array();
         foreach ($m_events as $key => $e) {
             //TODO: not very efficient...
             if (strpos($key, "events/") !== FALSE && isset($e["confid"]) && $e["confid"] == $confId) {
                 $event_from_file = $e;
                 $event_from_file["subpath"] = str_replace("events/", "", $key);
             }
         }
         /*
               do {
                 $event_from_file = array_shift($m_events);debug::rr($event_from_file);
               } while (!isset($event_from_file["id"]) || ($event_from_file["id"]!=$confId));
         */
         foreach (array("subpath", "blurb", "venue", "confid_parent", "surveyresponse", "youtube") as $field) {
             if (!isset($event_from_file[$field])) {
                 $event_from_file[$field] = "";
             }
         }
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例9: manageSubscriptionsAddStaff

 private static function manageSubscriptionsAddStaff($table = "subscriber")
 {
     $stdout = "";
     $record["email"] = array();
     $record["comment"] = "";
     $record["source"] = NEWS_STAFF;
     $record["status"] = NEWS_ACTIVE;
     $userdata = functions::callMethod('people', 'lib/people', 'getPeopleArray');
     if (empty($userdata)) {
         return false;
     }
     foreach ($userdata as $u) {
         if (isset($u["nw_email_plain"])) {
             $record["email"][] = $u["nw_email_plain"];
         }
     }
     $_SESSION["inserted_staff"] = count($record["email"]);
     if (!$GLOBALS["subscriptionClass"]->insertSubscriber($table, $record)) {
         return false;
     } else {
         return true;
     }
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:24,代码来源:

示例10: outputCombinedSearch

 private static function outputCombinedSearch($queryData, $searchResults, $peopleResult, $wid = "os_main")
 {
     // --------------------------------------------------------------------------
     // -- SETUP VARIABLES
     // --------------------------------------------------------------------------
     // --------------------
     // -- ...
     // --------------------
     $rootUri = "http://" . $_SERVER["HTTP_HOST"] . preg_replace("/\\/[^\\/]*\$/", "/", $_SERVER["PHP_SELF"]);
     // --------------------
     // -- GPC variables, if not already initiated
     // --------------------
     functions::gpc_declare_input("start", 1, false);
     $GLOBALS["start"] = (int) $GLOBALS["start"];
     functions::gpc_declare_input("end", 1, false);
     $GLOBALS["end"] = (int) $GLOBALS["end"];
     // --------------------
     // -- Massage $queryData array
     // --------------------
     $ignoredTerms = "";
     if (isset($queryData["allterms"]) && isset($queryData["terms"])) {
         $ignoredTerms = array_filter(array_diff($queryData["allterms"], $queryData["terms"]));
         $ignoredTerms = ($ignoredTermsCount = count($ignoredTerms)) ? implode(" ", $ignoredTerms) : "";
     }
     if (!isset($queryData["category"]) && isset($GLOBALS["ctg"])) {
         $queryData["category"] = $GLOBALS["ctg"];
     }
     if (!isset($queryData["original"])) {
         $queryData["original"] = "";
     }
     // --------------------
     // -- Massage display page interval
     // --------------------
     if (count($searchResults)) {
         $GLOBALS["start"] = count($searchResults) <= SEARCH_MAX_RESULTS_PER_PAGE ? 1 : $GLOBALS["start"];
         $GLOBALS["end"] = min($GLOBALS["start"] + SEARCH_MAX_RESULTS_PER_PAGE - 1, count($searchResults));
     }
     // --------------------------------------------------------------------------
     // -- PREPARE COMPONENTS OF OUTPUT
     // --------------------------------------------------------------------------
     if (!class_exists("people", FALSE)) {
         require_once PATH_CLASSES . "/lib/people.php";
     }
     $peopleResultList = functions::callMethod('people', 'lib/people', 'OutputPeople', "search", "box", "people-list", "", $peopleResult);
     $peopleResultBlurb = functions::callMethod('people', 'lib/people', 'outputPeopleSearchBlurb', $queryData["original"], count($peopleResult));
     // --------------------
     $pageResultList = self::outputPageSearchResult($searchResults, $rootUri);
     $pageResultBlurb = self::outputPageSearchBlurb($queryData["original"], $queryData["category"], count($searchResults));
     // --------------------
     $searchform = self::searchfieldCombined($queryData["original"], $queryData["category"]);
     $searchtips = "  <ul class='os_searchtips'>\r\n" . (defined(SEARCH_TERMLENGTH) ? "    <li>Search terms with fewer than " . SEARCH_TERMLENGTH . " characters are ignored</li>\r\n" : "") . "    <li>Terms without prefix are treated as optional (logical OR)</li>\r\n" . "    <li>Prefix terms with a plus-sign (+) to make them requred</li>\r\n" . "    <li>Prefix terms with a minus-sign (-) " . "to exclude terms</li>\r\n" . "    <li>Enclose groups of terms in quotes (&quot;&quot;) to search for phrases (only in web page search)</li>\r\n" . "  </ul>\r\n" . "\r\n";
     $messageform = "";
     if ($queryData["category"] != "") {
         $messageform = "  <form action='" . $_SERVER["PHP_SELF"] . "' method='post' class='os_msg'" . " style='margin-top:1em'" . ">\r\n" . "    <strong>&#187;</strong> Try this search in \r\n" . "    <input type='submit' value='all Nordita web subsites' class='fakelink bold'>?\r\n" . "    <input type='hidden' name='qry' " . "value='" . htmlspecialchars($queryData["original"]) . "'>\r\n" . "    <input type='hidden' name='ctg' value=''>\r\n" . "  </form>\r\n" . "\r\n";
         //"<a href='" . $_SERVER["PHP_SELF"] . "?qry=".htmlspecialchars($queryData["original"])."'>all categories</a>" .
     }
     // --------------------
     // -- CREATE
     //      $output1   - top search form, or empty if there are errors
     //      $message[] - instructions if first run, error messages if there are errors, or empty if success
     //      $output2   - search results if success, bottom form if not first run, always instructions
     // --------------------
     $message = array();
     $output1 = $output2 = "";
     /*
         // --------------------
         // Case: No DB Connection
         // --------------------
         if (!$GLOBALS["DDATA"]["online"]) {
     
           $message[] =
             "Could not establish a connection to the database.\r\n" .
             "<br><em>" . $GLOBALS["DDATA"]["errno"] . ": " . $GLOBALS["DDATA"]["error"] . "</em>";
     
         // --------------------
         // Case: DB Locked
         // --------------------
         } else if ($searchResults === NULL) {
     
            $message[] =
              "The search database is currently being updated; " .
              "please try your search again in a few minutes.";
     
         // --------------------
         // Case: Query Success
         // --------------------
     //    } else if (!empty($pageResultList) || !empty($peopleResultList)) {
         } else
     */
     if ($queryData["original"]) {
         if ($ignoredTermsCount) {
             $message[] = "These terms were ignored: <strong>" . htmlspecialchars($ignoredTerms) . "</strong>";
         }
         $output1 = !empty($pageResultList) || !empty($peopleResultList) ? $searchform : "";
         $output2 = "<div class='col-content-left'>\r\n\r\n" . "  <h2>Web Page Results</h2>\r\n" . "\r\n" . ($pageResultList ? $pageResultBlurb . "  " . $pageResultList . (count($searchResults) > 2 ? $pageResultBlurb : "") : "    " . BLURB_SORRY_WEB_SEARCH . $messageform) . "\r\n" . "\r\n" . "</div>\r\n" . "\r\n" . "<div class='col-content-right divider'>\r\n\r\n" . "  <h2>Nordita Staff Results</h2>\r\n" . "\r\n" . ($peopleResultList ? $peopleResultBlurb . "  " . $peopleResultList : "    " . BLURB_SORRY_PEOPLE_SEARCH) . "\r\n" . "</div>\r\n" . "\r\n" . "<div style='clear:both'><br></div>\r\n" . "\r\n" . $searchform . $searchtips;
         // --------------------
         // Case: No Results
         // --------------------
         /*
             } elseif ($queryData["original"]) {
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例11: outputStartpageContentItem

 public static function outputStartpageContentItem($wid = "startpage-content-item", $class = "", $date = "", $headerInsideDiv = FALSE)
 {
     $stdout = "";
     $items = array();
     $hdr = "Nordita News";
     $seealso = "                <p class='seealso dots'><a href='news/index.php'>" . "See other Nordita News items</a></p>\r\n";
     // -----------------
     //if (date("Y-m-d")<"2016-09-12")
     $items[] = "<p>Jongbae Hong and D.S.L. Abergel, '<em>A universal explanation of tunneling conductance in exotic superconductors</em>',</p>\r\n" . "<p>We provide a comprehensive explanation of the tunneling conductance...</p>\r\n";
     // -----------------
     if (empty($items)) {
         return "";
     }
     $stdout .= implode("\r\n", $items) . $seealso;
     return functions::callMethod("widget", "lib/widget", "WoutputBoxOrWidget", $wid, $class, $hdr, $stdout, $headerInsideDiv);
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例12: OutputSeminarsNextweek

 public static function OutputSeminarsNextweek($w = 0)
 {
     $stdout = "";
     $talks_selection = $events = $colloquium = $visits = $contributions = $seminars = $talks = array();
     functions::gpc_declare_input("w", $w, true);
     $delta = $GLOBALS["w"] == 0 ? 7 : 0;
     $saturday1 = date("Y-m-d", time() - 3600 + ($delta - 1 + date("w", time() - 3600)) * 86400);
     $sunday = date("Y-m-d", time() - 3600 + ($delta - date("w", time() - 3600)) * 86400);
     $saturday2 = date("Y-m-d", time() - 3600 + ($delta + 7 - date("w", time() - 3600)) * 86400);
     $agenda_timespan = $GLOBALS["w"] == 0 ? "nextweek" : "thisweek";
     // ----------------------
     // Obtain data from VM DB: records for visitors outside events
     // ----------------------
     $visits = functions::callMethod('fromdb_vm', 'fromdb/vm', 'getArrivingVisitors', "extweek", $GLOBALS["w"]);
     // 'extweek' = extended week
     // ----------------------
     // Obtain data from Agenda DB: seminars and colloquium
     // ----------------------
     //@@@ -- VERKAR OK -- in OutputSeminarsNextweek() -- calls getTalkRecordsSeminars+getTalkRecordsColloquium
     // ----------------------
     // Obtain data from nw_events DB: programs and other events, and talks inside these events
     // ----------------------
     $events = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getEventsInPeriod', $agenda_timespan);
     $seminars = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getTalkRecordsSeminars', $agenda_timespan);
     $colloquium = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getTalkRecordsColloquium', $agenda_timespan);
     $contributions = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getEventContributionsInPeriod', $agenda_timespan);
     // ----------------------
     // Postparsing of seminars data records --> array $talks_selection[]
     // ----------------------
     //    $seminars = self::mergeTalkRecords($seminars,$colloquium);
     //    $talks = self::mergeTalkRecords($seminars,$contributions);
     $talks = self::mergeTalkRecords($colloquium, self::mergeTalkRecords($seminars, $contributions));
     if (isset($talks) && count($talks)) {
         foreach ($talks as $day => $dayevents) {
             if (count($dayevents)) {
                 foreach ($dayevents as $categoryId => $dayevent) {
                     // $dayevent["id"|"end"|"title"]
                     /*
                               if (isset($dayevent["eventtype"])
                                   && in_array(strtolower($dayevent["eventtype"]),
                                      array("nordita program","program","conference","workshop","meeting","school"))
                                  ) {
                     
                                 // -- Nordita event(s)
                     //doesn't seem to work...
                                 $talks_selection[0][] = array(
                                   "title"      => trim($dayevent["title"]),
                                   "eventtype"  => $dayevent["eventtype"],
                                   "startdate"  => $dayevent["startdate"],
                                   "enddate"    => $dayevent["enddate"],
                                   "subpath"    => $dayevent["subpath"],
                                   "id"         => $dayevent["id"],
                                   "categoryid" => $dayevent["categoryid"]
                                 );
                                 unset($talks[$day][$categoryId]);
                     
                               } else {
                     */
                     // -- Seminars
                     unset($sel);
                     if (isset($dayevent["title"])) {
                         $dayevent["title"] = trim($dayevent["title"]);
                     }
                     $sel["heading"] = "";
                     if (isset($dayevent["eventtitle"])) {
                         $sel["heading"] = "Event Talk" . (!empty($dayevent["eventtitle"]) ? " (" . $dayevent["eventtitle"] . ")" : "");
                     }
                     if (isset($dayevent["categoryid"])) {
                         include PATH_DATA . "/agenda_fids.php";
                         // -> $fids[]
                         if (isset($fids)) {
                             if (in_array($dayevent["categoryid"], array_keys($fids["colloquium"]))) {
                                 // -- AN COLLOQUIUM
                                 $sel["heading"] = "The AlbaNova Colloquium";
                             } else {
                                 // -- SEMINARS
                                 foreach ($fids as $group => $farray) {
                                     foreach ($farray as $categoryid => $label) {
                                         if ($categoryid == $dayevent["categoryid"] && (preg_match("/^Seminar\\S*\\s*(.*)\$/i", $label, $res) || preg_match("/^Group meeting\\S*\\s*(.*)\$/i", $label, $res)) && !empty($res[1])) {
                                             $sel["heading"] = $res[1];
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     $sel["eventtype"] = isset($dayevent["eventtype"]) ? ucfirst($dayevent["eventtype"]) : "";
                     $sel["period"] = ucfirst($dayevent["period"]);
                     $sel["period"] = $dayevent["starttime"] . (!empty($dayevent["endtime"]) ? "&#8212;" . $dayevent["endtime"] : "");
                     $sel["room"] = isset($dayevent["room"]) ? ucfirst($dayevent["room"]) : "";
                     $sel["title"] = "&quot;" . $dayevent["title"] . "&quot;";
                     $sel["title"] = str_replace("<span class='agenda-programtalk'><span>Event Talk</span></span> ", "", $sel["title"]);
                     //if (isset($dayevent["url"]) && (strpos($dayevent["url"],"contribId")!==false)) $programtalk = "[Program Talk] ";
                     $seltmp = array();
                     if (isset($dayevent["speakers"])) {
                         foreach ($dayevent["speakers"] as $speaker) {
                             $tmp = (!empty($speaker["nw_fullname"]) ? $speaker["nw_fullname"] . " " : "") . (!empty($speaker["av_institute"]) ? "(" . $speaker["av_institute"] . ")" : "");
                             $seltmp[] = trim($tmp);
                         }
                     }
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例13: WoutputReports

 public static function WoutputReports($private = false)
 {
     $external = $self = $annual = $director = $policy = $programs = $surveys = "";
     $sfiles = $li = $event = array();
     // -----------------------------------------------------------
     $directories = array("annual_reports", "directors_reports", "evaluations", "policies", "program_reports", "scientific_advisory_committee_reports", "surveys");
     foreach ($directories as $dir) {
         $files = scandir(INCLEVEL . "/" . PATH_DOCSX . "/" . $dir);
         $sfiles[$dir] = array();
         foreach ($files as $file) {
             if (!in_array($file, array(".", "..", "index.php"))) {
                 $sfiles[$dir][] = $file;
             }
         }
         krsort($sfiles[$dir]);
     }
     // -----------------------------------------------------------
     $d = "evaluations";
     foreach ($sfiles[$d] as $file) {
         if (preg_match("#nordita_evaluation_report_(\\d*)#", $file, $res)) {
             $li[$d][] = "   <li><a href='" . PATH_DOCSX . "/" . $d . "/" . $file . "'>" . "<strong>Evaluation Report " . $res[1] . "</strong></a></li>\r\n";
         } elseif (preg_match("#nordita_self_evaluation_(\\d*)#", $file, $res)) {
             $li["self"][] = "   <li><a href='" . PATH_DOCSX . "/" . $d . "/" . $file . "'>" . "<strong>Self-Evaluation " . $res[1] . "</strong></a></li>\r\n";
         }
     }
     // -----------------------------------------------------------
     $d = "annual_reports";
     foreach ($sfiles[$d] as $file) {
         if (preg_match("#nordita_annual_report_for_(\\d*)#", $file, $res)) {
             $li[$d][] = "   <li><a href='" . PATH_DOCSX . "/" . $d . "/" . $file . "'>" . "<strong>Annual Report for " . $res[1] . "</strong></a></li>\r\n";
         }
     }
     // -----------------------------------------------------------
     $d = "directors_reports";
     foreach ($sfiles[$d] as $file) {
         if (preg_match("#nordita_directors_report_(\\d*)_(\\d*)#", $file, $res)) {
             $li[$d][] = "   <li><a href='" . PATH_DOCSX . "/" . $d . "/" . $file . "'>" . "<strong>Director's Report " . date("F", strtotime("2015-" . $res[2] . "-01")) . " " . $res[1] . "</strong></a></li>\r\n";
         }
     }
     // -----------------------------------------------------------
     $policy .= "  <ul class='tightlist'>\r\n" . "   <li><a href='" . PATH_DOCSX . "/policies/nordita_today_and_tomorrow_november_2014.pdf'>" . "<strong>Nordita: Today and Tomorrow</strong></a> (November&nbsp;2014)</li>\r\n" . "   <li><a href='" . PATH_DOCSX . "/policies/nordic_value_of_nordita_may_2013.pdf'>" . "<strong>The Nordic Value of Nordita</strong></a> (May&nbsp;2013)</li>\r\n" . "   <li><a href='" . PATH_DOCSX . "/policies/nordita_the_next_ten_years_march_2008.pdf'>" . "<strong>Nordita: The Next Ten Years</strong></a> (March&nbsp;2008)</li>\r\n" . "  </ul>\r\n";
     // -----------------------------------------------------------
     $d = "program_reports";
     foreach ($sfiles[$d] as $file) {
         if (preg_match("#report_(.*)\\.#", $file, $res) && isset($res[1])) {
             //
             $event[$res[1]]["report"] = $file;
         }
     }
     $d = "surveys";
     foreach ($sfiles[$d] as $file) {
         if (preg_match("#[\\d-]*-([^.]*)#", $file, $res) && isset($res[1])) {
             $event[$res[1]]["survey"] = $file;
         }
     }
     foreach ($event as $label => $record) {
         $data = functions::callMethod('event', 'lib/event', 'getEventByPath', $label);
         if (isset($data["from"]) && isset($data["title"]) && isset($data["period"])) {
             while (isset($li["events"][$data["from"]])) {
                 $data["from"]++;
             }
             $li["events"][$data["from"]] = "   <li><strong>" . $data["title"] . "</strong> <span style='white-space:nowrap'>" . "(" . $data["period"] . ")</span>\r\n" . (isset($record["report"]) ? "        <br><strong>&#187;</strong> " . "<a href='" . PATH_DOCSX . "/program_reports/" . $record["report"] . "'>Organizer's Report</a>\r\n" : "") . (isset($record["survey"]) ? "        <br><strong>&#187;</strong> " . "<a href='" . PATH_DOCSX . "/surveys/" . $record["survey"] . "'>Participant Survey</a>\r\n" : "") . "</li>\r\n";
         }
     }
     krsort($li["events"]);
     $i = $k = 1;
     $half = ceil(count($li["events"]) / 2);
     foreach ($li["events"] as $from => $record) {
         $li["events" . $k][] = array_shift($li["events"]);
         if ($i++ == $half) {
             $k++;
         }
     }
     // -----------------------------------------------------------
     $minutesPath = "intranet/resources/minutes/index.php";
     if (SUBSITE == "bc") {
         $minutesPath = "bc/meetings/minutes/index.php";
     }
     return "<div class='col c1of3'>\r\n" . "\r\n" . "  <h3>External Evaluations</h3>\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["evaluations"], "\r") . "  </ul>\r\n" . "  <h3>Self-Evaluations</h3>\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["self"], "\r") . "  </ul>\r\n" . "  <h3>Annual Reports</h3>\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["annual_reports"], "\r") . "  </ul>\r\n" . "\r\n" . "</div> <div class='col c2of3'>\r\n" . "\r\n" . ($private ? "  <h3>Director's Reports</h3>\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["directors_reports"], "\r") . "  </ul>\r\n" . "\r\n" : "") . "</div> <div class='col c3of3'>\r\n" . "\r\n" . ($private ? "  <h3>Policy Documents</h3>\r\n" . $policy : "") . (SUBSITE == "bc" ? PADDED_HR : "") . "  <p><strong>&#187;</strong> <a href='" . $minutesPath . "'>Minutes from <strong>Board meetings</strong></a>\r\n" . "  <br><strong>&#187;</strong> <a href='" . $minutesPath . "'>Minutes from <strong>Faculty meetings</strong></a></p>\r\n" . "</div><div style='clear:both;height:0'><br></div>\r\n" . "\r\n" . ($private ? PADDED_HR . "  <h3 class='bottommargin'>Events: Reports from Program Organizers, " . "and Event Participant Surveys</h3>\r\n" . "<div class='col c1of2'>\r\n" . "\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["events1"], "\r") . "  </ul>\r\n" . "\r\n" . "</div> <div class='col c2of2'>\r\n" . "\r\n" . "  <ul class='tightlist'>\r\n" . implode($li["events2"], "\r") . "  </ul>\r\n" . "\r\n" . "</div><div style='clear:both'><br></div>\r\n" : "");
 }
开发者ID:,项目名称:,代码行数:80,代码来源:

示例14: getEventDetails

 public static function getEventDetails($stattype, $eventTitleArray)
 {
     if (empty($eventTitleArray) || $stattype == "visitors") {
         return array();
     }
     $eventDetail = array();
     // ------------------------
     // Campaigns
     // ------------------------
     if (in_array($stattype, array("applicants"))) {
         foreach ($eventTitleArray as $idx => $label) {
             if ($idx > 0 && preg_match("/([^\\[]*)\\s*\\[(.*)\\]/", $label, $res)) {
                 $thisEventType = $typeid = $default = "";
                 if (stripos($res[1], "nordita fellowship") !== false) {
                     $typeid = 1;
                     $thisEventType = "nordita fellowship";
                     //            $default = "on";
                 } elseif (stripos($res[1], "assistant pro") !== false) {
                     $typeid = 2;
                     $thisEventType = "assistant professor";
                     //            $default = "on";
                 } elseif (preg_match("/post-?doc/i", $res[1])) {
                     $typeid = 3;
                     $thisEventType = "postdoc";
                 } elseif (stripos($res[1], "visiting phd") !== false) {
                     $typeid = 5;
                     $thisEventType = "visiting phd fellowship";
                 } elseif (stripos($res[1], "phd") !== false) {
                     $typeid = 4;
                     $thisEventType = "phd";
                 } elseif (stripos($res[1], "masterclass") !== false) {
                     $typeid = 6;
                     $thisEventType = "masterclass";
                 }
                 $eventDetail[$typeid][$idx] = array("year" => $res[2], "title" => $label, "eventtype" => $thisEventType);
             }
         }
         // end foreach
         if (!empty($eventDetail)) {
             $eventDetail[0][0] = array("year" => "", "title" => "All Campaigns", "eventtype" => "");
         }
         ksort($eventDetail);
     }
     // end if
     // ------------------------
     // Events
     // ------------------------
     if (in_array($stattype, array("events", "allguests"))) {
         $eventid = array_flip(self::$eventType);
         foreach ($eventTitleArray as $idx => $label) {
             if ($idx > 0) {
                 $thisEventType = functions::callMethod('event', 'lib/event', 'getEventByAgendaid', $idx, "etype");
                 if (!empty($thisEventType)) {
                     $year = preg_match("/([^\\[]*)\\s*\\[(.*)\\]/", $label, $res) ? $res[2] : "";
                     //$default = in_array($thisEventType,array("program"));
                     $eventDetail[$eventid[$thisEventType]][$idx] = array("year" => $res[2], "title" => $label, "eventtype" => $thisEventType);
                 }
             }
         }
         // end foreach
         ksort($eventDetail);
     }
     // end if
     // ------------------------
     return $eventDetail;
 }
开发者ID:,项目名称:,代码行数:66,代码来源:

示例15: BmyMenu

 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;
 }
开发者ID:,项目名称:,代码行数:63,代码来源:


注:本文中的functions::callMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。