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


PHP _fatal函数代码示例

本文整理汇总了PHP中_fatal函数的典型用法代码示例。如果您正苦于以下问题:PHP _fatal函数的具体用法?PHP _fatal怎么用?PHP _fatal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: onAction

 function onAction()
 {
     global $application;
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $SessionPost["ViewState"]["ErrorsArray"] = array();
     $fsr_id = $SessionPost["FsRule_id"] = intval($SessionPost["FsRule_id"]);
     $SessionPost["FsRuleName"] = trim($SessionPost["FsRuleName"]);
     $SessionPost["FsRuleMinSubtotal"] = floatval($SessionPost["FsRuleMinSubtotal"]);
     $SessionPost["FsRuleStrictCart"] = intval($SessionPost["StrictCart"]);
     if ($SessionPost["FsRuleName"] == "") {
         $SessionPost["ViewState"]["ErrorsArray"][] = "ERROR_EMPTY_RULE_NAME";
     }
     $is_unique = modApiFunc("Shipping_Cost_Calculator", "checkIfFsRuleIsUnique", $SessionPost["FsRuleName"], $fsr_id);
     if (!$is_unique) {
         $SessionPost["ViewState"]["ErrorsArray"][] = "ERROR_NOT_UNIQUE_RULE_NAME";
     }
     if ($SessionPost["FormSubmitValue"] == "Save") {
         if (count($SessionPost["ViewState"]["ErrorsArray"]) == 0) {
             unset($SessionPost["ViewState"]["ErrorsArray"]);
             $this->saveSettings($SessionPost);
             $SessionPost["ViewState"]["hasCloseScript"] = "true";
         }
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey('FsRule_id', $fsr_id);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:32,代码来源:update_fs_rule.php

示例2: onAction

 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $nErrors = 0;
     $this->getEmails();
     if ($this->_valid_emails_count == 0) {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_FILL_EMAILS_TO_SUBSCRIBE';
         // @                       -               ?
         $SessionPost['ViewState']['ErrorFields'][] = 'emails_subscribe';
         $nErrors++;
     } else {
         $SessionPost['action_key'] = $this->_action_key;
         $SessionPost['ViewState']['stage'] = 'confirm';
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $request->setKey('topics', modApiFunc('Request', 'getValueByKey', 'topics'));
     if (isset($this->_action_key)) {
         $request->setKey('action_key', $this->_action_key);
         $request->setKey('stage', 'confirm');
     }
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:30,代码来源:subscribe.php

示例3: onAction

 /**
  *
  */
 function onAction()
 {
     global $application;
     $SessionPost = $_POST;
     $SessionPost["ViewState"]["ShowResults"] = "true";
     $request = $application->getInstance('Request');
     $products = array();
     $prod_prices = $request->getValueByKey("price");
     $prod_qtys = $request->getValueByKey("qty");
     $prod_shipping_costs = $request->getValueByKey("shipping_cost");
     $prod_tax_classes = $request->getValueByKey("tax_class");
     for ($i = 1; $i <= sizeof($prod_prices); $i++) {
         //              _   _                  .
         $price_including_taxes = modApiFunc("Localization", "FormatStrToFloat", $prod_prices[$i], "currency");
         $price_excluding_taxes = modApiFunc("Catalog", "computePriceExcludingTaxes", $price_including_taxes, $prod_tax_classes[$i], true);
         //force to work in AZ
         $price_excluding_taxes = number_format($price_excluding_taxes, 2, '.', ',');
         $SessionPost["price"][$i] = $price_excluding_taxes;
         $products[] = array("CartItemSalePrice" => $price_excluding_taxes, "CartItemSalePriceExcludingTaxes" => $price_excluding_taxes, "Quantity_In_Cart" => $prod_qtys[$i], "ShippingPrice" => modApiFunc("Localization", "FormatStrToFloat", $prod_shipping_costs[$i], "currency"), "TaxClass" => $prod_tax_classes[$i]);
     }
     $country_id = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_OWNER_COUNTRY);
     $state = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_OWNER_STATE);
     //            ,                                       ,         ,    ProductInfo,
     //                      .
     //                             -                                       .
     //                          $price_including_taxes
     if (!is_numeric($country_id) || $country_id < 1 || !is_numeric($state) || $state < 1) {
         //                :
         _fatal(array("CODE" => "CORE_057"), __CLASS__, __FUNCTION__);
     }
     modApiFunc('Taxes', 'setTaxDebug', $products, modApiFunc("Localization", "FormatStrToFloat", $request->getValueByKey("ShippingCost"), "currency"), $request->getValueByKey("ShippingMethod"), PRICE_N_A, array("Default" => array("CountryId" => $country_id, "StateId" => $state), "Shipping" => array("CountryId" => $request->getValueByKey("ShippingCountryId"), "StateId" => $request->getValueByKey("ShippingStateId")), "Billing" => array("CountryId" => $request->getValueByKey("BillingCountryId"), "StateId" => $request->getValueByKey("BillingStateId"))));
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:36,代码来源:taxcalculator_action.php

示例4: boot

 function boot()
 {
     $GLOBALS['__localization_disable_formatting__'] = false;
     $GLOBALS['application'] = new Application();
     $GLOBALS['application']->readAppINI();
     //CTrace::inf('Point 3.1 (after readAppINI)');
     $GLOBALS['__session_db_handler_object'] = new SessionDBHandler();
     // check cache folder
     if (!is_dir_writable($GLOBALS['application']->getAppINI('PATH_CACHE_DIR'))) {
         _fatal(array("CODE" => "CORE_040"), $GLOBALS['application']->getAppINI('PATH_CACHE_DIR'));
     }
     $GLOBALS['application']->init();
     //CTrace::inf('Point 3.2 (after application->init)');
     // include custom template file
     if (isset($GLOBALS['__SYSTEM_TPL_DIR__']) && file_exists($GLOBALS['__SYSTEM_TPL_DIR__'] . 'custom.php')) {
         include_once $GLOBALS['__SYSTEM_TPL_DIR__'] . 'custom.php';
     }
     if (isset($GLOBALS['__TPL_DIR__']) && file_exists($GLOBALS['__TPL_DIR__'] . 'custom.php')) {
         include_once $GLOBALS['__TPL_DIR__'] . 'custom.php';
     }
     // include functions template file
     if (isset($GLOBALS['__SYSTEM_TPL_DIR__']) && file_exists($GLOBALS['__SYSTEM_TPL_DIR__'] . 'functions.php')) {
         include_once $GLOBALS['__SYSTEM_TPL_DIR__'] . 'functions.php';
     }
     if (isset($GLOBALS['__TPL_DIR__']) && file_exists($GLOBALS['__TPL_DIR__'] . 'functions.php')) {
         include_once $GLOBALS['__TPL_DIR__'] . 'functions.php';
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:28,代码来源:bootstrap.php

示例5: home

    public function home()
    {
        global $user;
        $v = $this->__(w('alias filename ext'));
        if (!f($v['alias']) || !f($v['filename'])) {
            _fatal();
        }
        $sql = 'SELECT tree_id
			FROM _tree
			WHERE tree_alias = ?';
        if (!($tree = _fieldrow(sql_filter($sql, $v['alias'])))) {
            _fatal();
        }
        $sql = 'SELECT *
			FROM _downloads
			WHERE download_alias = ?
				AND download_tree = ?';
        if (!($download = _fieldrow(sql_filter($sql, $v['filename'], $tree['tree_id'])))) {
            _fatal();
        }
        if ($download['download_login']) {
            _login();
        }
        $sql = 'UPDATE _downloads SET download_count = download_count + 1
			WHERE download_id = ?';
        _sql(sql_filter($sql, $download['download_id']));
        $filepath = LIB . 'fetch/' . _filename($download['download_id'], $download['download_extension']);
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:29,代码来源:_fetch.php

示例6: onAction

 /**
  *
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     //Check
     $rsa_public_key_asc_format = $SessionPost["rsa_public_key_asc_format"];
     $rsa_public_key_cryptrsa_format = modApiFunc("Crypto", "convert_rsa_public_key_from_asc_into_cryptrsa_format", $rsa_public_key_asc_format);
     if ($rsa_public_key_cryptrsa_format === false || empty($rsa_public_key_asc_format)) {
         //The key format is invalid.
         //: report error
         echo "<script language='javascript'>alert('ERROR: Incorrect RSA public key format.');</script>";
         exit;
     } else {
         modApiFunc("Payment_Module_Offline_CC", "updateRSAPublicKey", $rsa_public_key_asc_format);
         //Output a Javascript, hiding a group of controllers "Generate a pair of RSA key"
         //: Make other necessary changes in the interface.
         echo "<script language='javascript'>parent." . $SessionPost['callback_function'] . "();</script>";
         exit;
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:28,代码来源:save_rsa_public_key.php

示例7: onAction

 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $nErrors = 0;
     $topic_id = $request->getValueByKey('topic');
     $topic_name = $request->getValueByKey('topic_name');
     $topic_status = $request->getValueByKey('topic_status');
     $topic_access = $request->getValueByKey('topic_access');
     $topic_auto = $request->getValueByKey('topic_auto');
     if ($topic_id == '') {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_EDIT_INTERNAL_ERROR';
         $SessionPost['ViewState']['hasCloseScript'] = 'false';
     } elseif ($topic_name == '') {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_FILL_TOPIC_NAME';
         $SessionPost['ViewState']['ErrorFields'][] = 'topic_name';
         $SessionPost['ViewState']['hasCloseScript'] = 'false';
     } else {
         modApiStaticFunc('Subscriptions', 'updateTopic', $topic_id, $topic_name, $topic_status, $topic_access, $topic_auto);
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:30,代码来源:update_topic.php

示例8: onAction

 /**
  *
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     switch ($SessionPost["ViewState"]["FormSubmitValue"]) {
         case "save":
             $SessionPost["ViewState"]["ErrorsArray"] = array();
             if (empty($SessionPost["ModuleName"]) == true || trim($SessionPost["ModuleName"]) == '') {
                 $SessionPost["ViewState"]["ErrorsArray"][] = "MODULE_ERROR_NO_NAME";
             }
             $nErrors = sizeof($SessionPost["ViewState"]["ErrorsArray"]);
             if ($nErrors == 0) {
                 unset($SessionPost["ViewState"]["ErrorsArray"]);
                 $this->saveDataToDB($SessionPost);
                 $SessionPost["ViewState"]["hasCloseScript"] = "true";
             }
             break;
         default:
             _fatal(array("CODE" => "CORE_051"), __CLASS__, __FUNCTION__, $request->getValueByKey('FormSubmitValue'));
             break;
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     // get view name by action name.
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
开发者ID:digitaldevelopers,项目名称:plugin-avactis-2.1,代码行数:35,代码来源:update_wtp.php

示例9: pop

 /**
  * $tag
  *                    .
  */
 function pop($tag)
 {
     $last_pushed_el = array_pop($this->_stack);
     $last_pushed_tag = $last_pushed_el['tag'];
     if ($tag != $last_pushed_tag) {
         _fatal(array("CODE" => "CORE_060"), $tag, $last_pushed_tag);
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:12,代码来源:tag_param_stack.php

示例10: home

    public function home()
    {
        global $core;
        $v = $this->__(array('a', 'p' => 0));
        if (f($v['a'])) {
            $sql = 'SELECT area_id
				FROM _reference_area
				WHERE area_alias = ?';
            if (!_field(sql_filter($sql, $v['a']), 'area_id', 0)) {
                _fatal();
            }
            $sql = 'SELECT COUNT(r.ref_id) AS total
				FROM _reference r, _reference_area a
				WHERE a.area_alias = ?
					AND r.ref_area = a.area_id
				ORDER BY r.ref_time DESC';
            $ref_total = _field(sql_filter($sql, $v['a']), 'total', 0);
            $sql = 'SELECT *
				FROM _reference r, _reference_area a
				WHERE a.area_alias = ?
					AND r.ref_area = a.area_id
				ORDER BY r.ref_time DESC
				LIMIT ??, ??';
            $ref = _rowset(sql_filter($sql, $v['a'], $v['p'], $core->v('ref_pages')));
        } else {
            $sql = 'SELECT COUNT(ref_id) AS total
				FROM _reference
				ORDER BY ref_time DESC';
            $ref_total = _field($sql, 'total', 0);
            $sql = 'SELECT *
				FROM _reference r, _reference_area a
				WHERE r.ref_area = a.area_id
				ORDER BY r.ref_time DESC
				LIMIT ??, ??';
            $ref = _rowset(sql_filter($sql, $v['p'], $core->v('ref_pages')));
        }
        if ($v['p'] && $ref_total) {
            redirect(_link());
        } else {
            _style('noref');
        }
        foreach ($ref as $i => $row) {
            if (!$i) {
                _style('ref');
            }
            if ($this->has_plugin($row['ref_content'])) {
                $this->parse_plugin($row);
                continue;
            }
            _style('ref.row', _vs(array('id' => $row['ref_id'], 'link' => _link($row['ref_alias']), 'subject' => $row['ref_subject'], 'content' => _message($row['ref_content']), 'time' => _format_date($row['ref_time'])), 'ref'));
        }
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:53,代码来源:_home.php

示例11: onAction

 /**
  * Action: UpdateCountries.
  *
  */
 function onAction()
 {
     global $application;
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     switch ($SessionPost["ViewState"]["FormSubmitValue"]) {
         case "update":
             $nErrors = 0;
             $SessionPost["ViewState"]["ErrorsArray"] = array();
             $live_countries_present = false;
             //                foreach ($SessionPost as $key => $val)
             //                {
             //                    if ((_ml_substr($key, 0, 3) == "hf_"))
             //                    {
             //                        if (isset($SessionPost["cb_".$val]))
             //                            $live_countries_present = true;
             //                    }
             //                }
             for ($i = 0; $i <= 237; $i++) {
                 if (isset($SessionPost["cb_" . $i])) {
                     $live_countries_present = true;
                 }
             }
             if (!$live_countries_present) {
                 $SessionPost["ViewState"]["ErrorsArray"][] = "error";
                 //getMsg("MNG_CNTR_NO_SELECTED_ERROR");
             }
             loadCoreFile('html_form.php');
             $HtmlForm1 = new HtmlForm();
             $error_message_text = "";
             $nErrors = sizeof($SessionPost["ViewState"]["ErrorsArray"]);
             if ($nErrors == 0) {
                 unset($SessionPost["ViewState"]["ErrorsArray"]);
                 $this->updateDataInDB($SessionPost);
                 $SessionPost["ViewState"]["hasCloseScript"] = "true";
                 modApiFunc('Session', 'set', 'ResultMessage', 'MNG_CNTR_RESULT_MESSAGE');
             } else {
                 modApiFunc('Session', 'set', 'ResultMessage', 'MNG_CNTR_RESULT_ERROR_MESSAGE');
             }
             break;
         default:
             break;
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     // get view name by action name.
     $request = new Request();
     $request->setView("CountriesList");
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:56,代码来源:update_countries_action.php

示例12: onAction

 /**
  * Action process.
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $nErrors = 0;
     if ($SessionPost["SendByEmail"] == "true") {
         $SessionPost["SendByEmail"] = true;
     } else {
         $SessionPost["SendByEmail"] = false;
     }
     if (!$this->isEqNewAndVerifyPasswords($SessionPost['New_Password'], $SessionPost['Verify_New_Password'])) {
         $nErrors++;
         $SessionPost["ViewState"]["ErrorsArray"][] = "PSWUPD_002";
     }
     if (!$this->isAllFieldsFilled(array($SessionPost['New_Password'], $SessionPost['Verify_New_Password']))) {
         $nErrors++;
         $SessionPost["ViewState"]["ErrorsArray"][] = "PSWUPD_008";
     }
     if (!$this->isValidNewPasswordLength($SessionPost['New_Password'])) {
         $nErrors++;
         $SessionPost["ViewState"]["ErrorsArray"][] = "PSWUPD_004";
     }
     if (!$this->isComplicatedNewPassword($SessionPost['New_Password'])) {
         $nErrors++;
         $SessionPost["ViewState"]["ErrorsArray"][] = "PSWUPD_005";
     }
     if (!$this->isDifferentFromEmail($SessionPost['AdminEmail'], $SessionPost['New_Password'])) {
         $nErrors++;
         $SessionPost["ViewState"]["ErrorsArray"][] = "PSWUPD_007";
     }
     $request = new Request();
     if ($nErrors == 0) {
         $SessionPost["ViewState"]["hasCloseScript"] = "true";
         modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
         $need_update = false;
         if ($SessionPost["SendByEmail"]) {
             modApiFunc("Users", "letterAboutNewPassword", $SessionPost['AdminEmail'], $SessionPost['New_Password_Open']);
             $need_update = true;
         }
         modApiFunc("Users", "updateAcountInfo", modApiFunc("Users", "getSelectedUserID"), $SessionPost['AdminEmail'], $SessionPost['New_Password'], $need_update);
         $request->setView('AdminPasswordChange');
     } else {
         $request->setView('AdminPasswordChange');
         modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     }
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:55,代码来源:password_change_action.php

示例13: exec

 function exec($query_name, $params, $cache_id_prefix = '', $b_count_only = false, $to_reset = CCACHE_USE_MEMORY_CACHE)
 {
     global $application;
     CProfiler::DBLayerStart($query_name);
     $cache_query_id = $this->__getCacheKey($query_name, $params, $cache_id_prefix, $b_count_only);
     $cache_query_result = $this->cache->read($cache_query_id);
     CProfiler::DBQueryStatistics($query_name, $params, $cache_query_id, $cache_query_result !== NULL);
     if ($cache_query_result !== NULL) {
         //CTrace::dbg(sprintf('Found: %s', $cache_query_id));
         CProfiler::DBLayerStop($query_name);
         CProfiler::DBCacheQueryRead();
         return $cache_query_result;
     } else {
         //CTrace::dbg(sprintf('Missing: %s', $cache_query_id));
         // Create query object
         if (!class_exists($query_name)) {
             _fatal(__FUNCTION__ . ': Class does not exist: ' . $query_name);
         }
         $query_obj = new $query_name();
         $query_obj->initQuery($params);
         $query_type = $query_obj->getQueryType();
         if ($query_type == DBQUERY_TYPE_SELECT) {
             $table_list_of_query = $this->__getTablesOfQuery($query_obj);
             $application->enterCriticalSection('database');
         }
         CProfiler::DBLayerStop($query_name);
         if ($b_count_only === true) {
             $cache_query_result = $application->db->getDB_Result_num_rows($query_obj);
         } else {
             $cache_query_result = $application->db->getDB_Result($query_obj);
         }
         CProfiler::DBLayerStart($query_name);
         // If it is SELECT query then save all related tables
         if ($query_type == DBQUERY_TYPE_SELECT && $query_obj->isCachable() == true) {
             #         -                          ,                  ,
             #                        ,
             #
             foreach ($table_list_of_query as $table) {
                 $this->cache->add($table, uniqid('table', true));
             }
             $this->cache->write($cache_query_id, $cache_query_result, 0, $table_list_of_query);
             CProfiler::DBCacheQuerySaved();
         }
         if ($query_type == DBQUERY_TYPE_SELECT) {
             $application->leaveCriticalSection();
         }
         CProfiler::DBLayerStop($query_name);
         return $cache_query_result;
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:50,代码来源:query_executer.php

示例14: onAction

 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $nErrors = 0;
     $selected_topics = $request->getValueByKey('topic_id');
     if (!is_array($selected_topics) || empty($selected_topics)) {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_SELECT_TOPICS_TO_SUBSCRIBE';
         $nErrors++;
     }
     $emails = $request->getValueByKey('emails_subscribe');
     $emails = preg_split('/[\\s,;]+/', $emails);
     $valid_emails = array();
     $invalid_emails = array();
     foreach ($emails as $email) {
         if (modApiFunc("Users", "isValidEmail", $email)) {
             $valid_emails[] = $email;
         } else {
             $invalid_emails[] = $email;
         }
     }
     if (empty($valid_emails)) {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_FILL_EMAILS_TO_SUBSCRIBE';
         $SessionPost['ViewState']['ErrorFields'][] = 'emails_subscribe';
         $nErrors++;
     }
     if ($nErrors == 0) {
         modApiStaticFunc('Subscriptions', 'subscribeEmails', array_keys($selected_topics), $valid_emails);
     }
     if (!empty($valid_emails) && !empty($invalid_emails)) {
         $SessionPost['ViewState']['ErrorsArray'][] = 'ALERT_SOME_EMAILS_INVALID';
         $SessionPost['ViewState']['ErrorFields'][] = 'emails_subscribe';
         $SessionPost['emails_subscribe'] = implode("\n", $invalid_emails);
         $nErrors++;
     }
     if ($nErrors > 0) {
         $SessionPost['ViewState']['OpenSubform'] = 'subscribe';
     }
     modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
     $request = new Request();
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:48,代码来源:import.php

示例15: onAction

 /**
  */
 function onAction()
 {
     global $application;
     $request = $application->getInstance('Request');
     $SessionPost = array();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         _fatal(array("CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
     }
     $SessionPost = $_POST;
     $PromoCode_id = $request->getValueByKey('PromoCode_id');
     if (!empty($PromoCode_id) && ctype_digit($PromoCode_id) === TRUE) {
         modApiFunc("PromoCodes", "deleteRowsFromPromoCode", array($PromoCode_id));
     }
     // get view name by action name.
     $this->redirect();
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:18,代码来源:del_promo_code_info_action.php


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