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


PHP functions::gpc_declare_input_experimental方法代码示例

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


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

示例1: OutputQrcode

 public static function OutputQrcode()
 {
     $stdout = "";
     $showform = 1;
     $founderror = $error = $warning = array();
     // gpc_declare_input ($vname, $default, $bool, $allowed, $set_session, $strip_tags)
     functions::gpc_declare_input_experimental("doit", false, true);
     functions::gpc_declare_input_experimental("qr-ext", "", false);
     functions::gpc_declare_input_experimental("qr-text", "", false);
     functions::gpc_declare_input_experimental("qr-zoom", QRCODE_DEFAULT_PIXELSIZE, false);
     functions::gpc_declare_input_experimental("qr-level", QRCODE_DEFAULT_LEVEL, false);
     functions::gpc_declare_input_experimental("qr-width", QRCODE_DEFAULT_IMAGEWIDTH, false);
     // ---------------------------------------
     if (in_array($GLOBALS["qr-ext"], self::$filetypes)) {
         return self::outputQrcodeCreate($GLOBALS["qr-text"], $GLOBALS["qr-zoom"], $GLOBALS["qr-level"], $GLOBALS["qr-width"], $GLOBALS["qr-ext"]);
     }
     // end if ($GLOBALS["display"])
     // ---------------------------------------
     if ($GLOBALS["doit"]) {
         if (empty($GLOBALS["qr-text"])) {
             $founderror["qr-text"] = 1;
             $error[] = "Please type an URL or text to be embedded in the QR code";
         }
         if (!is_numeric($GLOBALS["qr-width"])) {
             $founderror["qr-width"] = 1;
             $error[] = "Please select a size of the QR code image in pixels";
         }
         if ($GLOBALS["qr-width"] < 100 || $GLOBALS["qr-width"] > 2000) {
             $founderror["qr-width"] = 1;
             $error[] = "Please select a QR code image size between 100 px and 2000 px";
         }
         if (!is_numeric($GLOBALS["qr-zoom"]) || !is_int($GLOBALS["qr-zoom"] + 0) || $GLOBALS["qr-zoom"] < 1) {
             $founderror["qr-zoom"] = 1;
             $error[] = "The zoom factor must be a positive integer";
         }
         if (!isset(self::$errorlevels[$GLOBALS["qr-level"]])) {
             $founderror["qr-level"] = 1;
             $error[] = "Please select a valid QR code error correction level";
         }
         // -------------------------------------
         if (empty($founderror)) {
             $stdout .= "<div class='col-content-left'>\r\n" . self::outputQrcodeCreate($GLOBALS["qr-text"], $GLOBALS["qr-zoom"], $GLOBALS["qr-level"]) . "</div>\r\n";
         }
     }
     // end if ($GLOBALS["doit"])
     // ---------------------------------------
     // form
     if ($showform) {
         $stdout .= "<div class='col-content-right divider'>\r\n" . self::outputQrcodeForm($founderror, $error, $warning) . "</div>\r\n";
     }
     // ---------------------------------------
     $stdout .= "<div style='clear:both'>\r\n";
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:54,代码来源:

示例2: OutputEventPartMail

 public static function OutputEventPartMail()
 {
     //    $visit = functions::callMethod('fromdb_vm','fromdb/vm','getArrivingVisitors');
     if (!isset($dbVm) || !is_object($dbVm)) {
         require_once PATH_CLASSES . "/fromdb/vm.php";
         $dbVm = new fromdb_vm();
     }
     $stdout = "";
     $mailaddresses = $mailaddressesEvent = $mailbyexpenses = array();
     if (!defined("EXPENSES_LABEL_DO")) {
         define("EXPENSES_LABEL_DO", "grouping e-mail addresses by participant expenses");
     }
     if (!defined("EXPENSES_LABEL_DONT")) {
         define("EXPENSES_LABEL_DONT", "sorting e-mail addresses alphabetically");
     }
     if (!defined("WEEK_DO")) {
         define("WEEK_DO", "grouping e-mail addresses by week within the event");
     }
     if (!defined("WEEK_DONT")) {
         define("WEEK_DONT", "listing e-mail addresses for the entire event");
     }
     if (!defined("REJECTED_DO")) {
         define("REJECTED_DO", "display accepted, pending and rejected applicants");
     }
     if (!defined("REJECTED_DONT")) {
         define("REJECTED_DONT", "display only accepted applicants");
     }
     // ------------------------------------------------------------------------
     // Output drop-down list
     // ------------------------------------------------------------------------
     $stdout .= event::outputEventDropdown(array("semicolon", "byexpenses"), "participant e-mail addresses");
     // ------------------------------------------------------------------------
     if (!isset($_REQUEST["confid"]) || empty($_REQUEST["confid"])) {
         return $stdout;
     }
     // ------------------------------------------------------------------------
     // GPC
     // ------------------------------------------------------------------------
     // gpc_declare_input ($vname, $default, $bool, $allowed, $set_session, $strip_tags)
     // Must be after call to event::outputEventDropdown() where $GLOBALS["confid"] is set.
     if (!isset($GLOBALS["confid"])) {
         functions::gpc_declare_input("confid", array(), false);
     }
     if (!empty($GLOBALS["confid"])) {
         $confidArray = is_array($GLOBALS["confid"]) ? $GLOBALS["confid"] : array($GLOBALS["confid"]);
     }
     //TODO: have 4 views instead of 4 toggles
     functions::gpc_declare_input_experimental("with_semicolon", "comma", false, array(), true);
     functions::gpc_declare_input_experimental("by_expenses", EXPENSES_LABEL_DONT, false, array(), true);
     functions::gpc_declare_input_experimental("by_week", WEEK_DONT, false, array(), false);
     functions::gpc_declare_input_experimental("by_acceptance", REJECTED_DONT, false, array(), false);
     // ------------------------------------------------------------------------
     // Obtain data
     // ------------------------------------------------------------------------
     // Obtain mailaddresses for each requested event
     foreach ($confidArray as $confid) {
         $eventShortname[$confid] = $GLOBALS["documentClass"]->getPathFromAgendaId($confid);
         $eventTitle[$confid] = event::getEventByAgendaid($confid, "title");
         $dates[$confid] = $dbVm->getDateInterval($confid);
         $year[$confid] = isset($dates[$confid][1]) ? date("Y", strtotime($dates[$confid][1])) : "";
         if ($GLOBALS["by_week"] == WEEK_DO) {
             // $mailaddressesEvent[$confid] = array(weekNumber=>array(idx=>emailAddress))
             $mailaddressesEvent[$confid] = $dbVm->getEventsParticipantMailsByWeek($confid);
         } elseif ($GLOBALS["by_expenses"] == EXPENSES_LABEL_DO) {
             // $mailaddressesEvent[$confid] = array("with accommodation expenses"|"no accommodation expenses"=>array("with travel expenses"|"no travel expenses"=>array(idx=>emailAddress))
             $mailaddressesEvent[$confid] = $dbVm->getEventsParticipantMailsByExpenses($confid);
         } elseif ($GLOBALS["by_acceptance"] == REJECTED_DO) {
             // $mailaddressesEvent[$confid] = array("accepted"|"pending"|"rejected"=>array(idx=>emailAddress))
             $mailaddressesEvent[$confid] = $dbVm->getEventsParticipantMailsByAcceptance($confid, 0, 1);
         } else {
             // $mailaddressesEvent[$confid] = essentially commaseparated string of email addresses
             $mailaddressesEvent[$confid] = $dbVm->getEventsParticipantMails($confid, 1);
             // Remove dummy "@nordita.org" addresses (used sometimes for people coming for two
             // disjoint periods). Note that this regexp also might kill genuine Nordita participants!
             $mailaddressesEvent[$confid] = preg_replace("/([^\\ ]*-[^\\ ]*\\@nordita.org,?)/i", "", $mailaddressesEvent[$confid]);
         }
     }
     $temp = array();
     // Merge all mailaddresses to one string
     foreach ($mailaddressesEvent as $confid => $data) {
         if ($GLOBALS["by_week"] == WEEK_DO) {
             foreach ($data as $week => $data2) {
                 foreach ($data2 as $email => $slask) {
                     if (!isset($temp[$week][$email])) {
                         $temp[$week][$email] = 1;
                     }
                 }
             }
             $mailaddresses = empty($temp) ? array() : $temp;
         } elseif ($GLOBALS["by_expenses"] == EXPENSES_LABEL_DO) {
             foreach ($data as $living => $data2) {
                 foreach ($data2 as $travel => $data3) {
                     foreach ($data3 as $email) {
                         if (!isset($temp[$living][$travel][$email])) {
                             $temp[$living][$travel][] = $email;
                         }
                     }
                 }
             }
             $mailaddresses = empty($temp) ? array() : $temp;
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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