本文整理汇总了PHP中GetMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP GetMessage函数的具体用法?PHP GetMessage怎么用?PHP GetMessage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
public static function CheckFields($ACTION, &$arFields)
{
global $DB;
if ((is_set($arFields, "ORDER_ID") || $ACTION=="ADD") && IntVal($arFields["ORDER_ID"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_ORDER_ID"), "ERROR_NO_ORDER_ID");
return false;
}
if ((is_set($arFields, "TAX_NAME") || $ACTION=="ADD") && strlen($arFields["TAX_NAME"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_TAX_NAME"), "ERROR_NO_TAX_NAME");
return false;
}
if ((is_set($arFields, "IS_PERCENT") || $ACTION=="ADD") && $arFields["IS_PERCENT"]!="Y" && $arFields["IS_PERCENT"]!="N")
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_TAX_VALUE"), "ERROR_NO_IS_PERCENT");
return false;
}
if ((is_set($arFields, "IS_IN_PRICE") || $ACTION=="ADD") && $arFields["IS_IN_PRICE"]!="Y" && $arFields["IS_IN_PRICE"]!="N")
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_IN_PRICE"), "ERROR_NO_IS_IN_PRICE");
return false;
}
if (is_set($arFields, "VALUE") || $ACTION=="ADD")
{
$arFields["VALUE"] = str_replace(",", ".", $arFields["VALUE"]);
$arFields["VALUE"] = DoubleVal($arFields["VALUE"]);
if ($arFields["VALUE"] <= 0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_SUM"), "ERROR_NO_VALUE");
return false;
}
}
if (is_set($arFields, "VALUE_MONEY") || $ACTION=="ADD")
{
$arFields["VALUE_MONEY"] = str_replace(",", ".", $arFields["VALUE_MONEY"]);
$arFields["VALUE_MONEY"] = DoubleVal($arFields["VALUE_MONEY"]);
}
if ((is_set($arFields, "VALUE_MONEY") || $ACTION=="ADD") && $arFields["VALUE_MONEY"]<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOT_EMPTY_SUM_MONEY"), "ERROR_NO_VALUE_MONEY");
return false;
}
if (is_set($arFields, "ORDER_ID"))
{
if (!($arOrder = CSaleOrder::GetByID($arFields["ORDER_ID"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["ORDER_ID"], GetMessage("SKGOT_NO_ORDER")), "ERROR_NO_ORDER");
return false;
}
}
if ((is_set($arFields, "CODE") || $ACTION=="ADD") && strlen($arFields["CODE"])<=0)
$arFields["CODE"] = false;
return true;
}
示例2: BXCreateSection
function BXCreateSection(&$fileContent, &$sectionFileContent, &$absoluteFilePath, &$sectionPath)
{
//Check quota
$quota = new CDiskQuota();
if (!$quota->CheckDiskQuota(array("FILE_SIZE" => strlen($fileContent) + strlen($sectionFileContent)))) {
$GLOBALS["APPLICATION"]->ThrowException($quota->LAST_ERROR, "BAD_QUOTA");
return false;
}
$io = CBXVirtualIo::GetInstance();
//Create dir
if (!$io->CreateDirectory($absoluteFilePath)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("PAGE_NEW_FOLDER_CREATE_ERROR") . "<br /> (" . htmlspecialcharsbx($absoluteFilePath) . ")", "DIR_NOT_CREATE");
return false;
}
//Create .section.php
$f = $io->GetFile($absoluteFilePath . "/.section.php");
if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/.section.php", $sectionFileContent)) {
return false;
}
//Create index.php
if (!$GLOBALS["APPLICATION"]->SaveFileContent($absoluteFilePath . "/index.php", $fileContent)) {
return false;
} else {
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
$res_log['path'] = $sectionPath . "/index.php";
CEventLog::Log("content", "PAGE_ADD", "main", "", serialize($res_log));
}
}
return true;
}
示例3: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("Empty user field", "EMPTY_USER_ID");
return false;
}
if ((is_set($arFields, "CURRENCY") || $ACTION == "ADD") && strlen($arFields["CURRENCY"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("Empty currency field", "EMPTY_CURRENCY");
return false;
}
if ((is_set($arFields, "TRANSACT_DATE") || $ACTION == "ADD") && strlen($arFields["TRANSACT_DATE"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("Empty transaction date field", "EMPTY_TRANSACT_DATE");
return false;
}
if (is_set($arFields, "AMOUNT") || $ACTION == "ADD") {
$arFields["AMOUNT"] = str_replace(",", ".", $arFields["AMOUNT"]);
$arFields["AMOUNT"] = DoubleVal($arFields["AMOUNT"]);
}
if ((is_set($arFields, "DEBIT") || $ACTION == "ADD") && $arFields["DEBIT"] != "Y") {
$arFields["DEBIT"] = "N";
}
if (is_set($arFields, "USER_ID")) {
$dbUser = CUser::GetByID($arFields["USER_ID"]);
if (!$dbUser->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["USER_ID"], GetMessage("SKGUT_NO_USER")), "ERROR_NO_USER_ID");
return false;
}
}
return True;
}
示例4: __CrmMobileCompanyEditRenderMultiFields
function __CrmMobileCompanyEditRenderMultiFields($typeName, &$fields, &$typeInfos, $prefix = '')
{
$typeName = strtoupper($typeName);
$data = isset($fields[$typeName]) ? $fields[$typeName] : array();
if ($prefix !== '') {
$prefix .= '_' . strtolower($typeName);
} else {
$prefix = strtolower($typeName);
}
$typeInfo = isset($typeInfos[$typeName]) ? $typeInfos[$typeName] : array();
if (empty($data)) {
if (!isset($fields[$typeName])) {
$fields[$typeName] = array();
}
$fields[$typeName]['n1'] = array('VALUE' => '', 'VALUE_TYPE' => '');
$data = $fields[$typeName];
}
foreach ($data as $key => &$datum) {
$value = isset($datum['VALUE']) ? $datum['VALUE'] : '';
echo '<input class="crm_input_text fll" id="', $prefix, '_', $key, '_value', '" style="width: 70%;" type="text" value="', htmlspecialcharsbx($value), '" />';
$valueTypeID = isset($datum['VALUE_TYPE']) ? $datum['VALUE_TYPE'] : '';
echo '<select class="crm_input_select flr" id="', $prefix, '_', $key, '_value_type', '">';
foreach ($typeInfo as $curValueTypeID => &$curValueType) {
echo '<option value="', htmlspecialcharsbx($curValueTypeID), '"', $valueTypeID === $curValueTypeID ? 'selected="selected"' : '', ' >', isset($curValueType['ABBR']) ? $curValueType['ABBR'] : $curValueTypeID, '</option>';
}
unset($curValueType);
reset($typeInfo);
echo '</select>';
}
unset($datum);
echo '<div class="clb" style="margin-bottom: 10px;"></div>', '<a id="', $prefix, '_add_btn', '" class="crm_people_cont_aqua_two">', '+ ', htmlspecialcharsbx(GetMessage("M_CRM_COMPANY_EDIT_BTN_ADD_{$typeName}")), '</a>';
}
示例5: CheckFilter
function CheckFilter($arFilterFields)
{
global $lAdmin;
$FilterArr = $arFilterFields;
reset($FilterArr);
foreach ($FilterArr as $f) {
global ${$f};
}
$str = "";
if (strlen(trim($find_timestamp_1)) > 0 || strlen(trim($find_timestamp_2)) > 0) {
$date_1_ok = false;
$date1_stm = MkDateTime(FmtDate($find_timestamp_1, "D.M.Y"), "d.m.Y");
$date2_stm = MkDateTime(FmtDate($find_timestamp_2, "D.M.Y") . " 23:59", "d.m.Y H:i");
if (!$date1_stm && strlen(trim($find_timestamp_1)) > 0) {
$str .= GetMessage("MAIN_WRONG_TIMESTAMP_FROM") . "<br>";
} else {
$date_1_ok = true;
}
if (!$date2_stm && strlen(trim($find_timestamp_2)) > 0) {
$str .= GetMessage("MAIN_WRONG_TIMESTAMP_TILL") . "<br>";
} elseif ($date_1_ok && $date2_stm <= $date1_stm && strlen($date2_stm) > 0) {
$str .= GetMessage("MAIN_FROM_TILL_TIMESTAMP") . "<br>";
}
}
$lAdmin->AddFilterError($str);
if (strlen($str) > 0) {
return false;
}
return true;
}
示例6: DoUninstall
function DoUninstall()
{
global $DOCUMENT_ROOT, $APPLICATION;
$this->UnInstallFiles();
UnRegisterModule("shackijj.responsiveslider");
$APPLICATION->IncludeAdminFile(GetMessage("RS_UNINSTALL_RESULT"), $DOCUMENT_ROOT . "/bitrix/modules/shackijj.responsiveslider/unstep.php");
}
示例7: CheckFields
public static function CheckFields(&$arFields, $ID = false)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$arMsg = array();
if ($ID > 0) {
unset($arFields["ID"]);
}
if (($ID === false || array_key_exists("NAME", $arFields)) && strlen($arFields["NAME"]) <= 0) {
$arMsg[] = array("id" => "NAME", "text" => GetMessage("CTRLR_LOG_ERR_NAME"));
}
if (($ID === false || array_key_exists("CONTROLLER_MEMBER_ID", $arFields)) && intval($arFields["CONTROLLER_MEMBER_ID"]) <= 0) {
if (array_key_exists("NAME", $arFields) && $arFields["NAME"] == "SITE_UPDATE_KERNEL") {
$arFields["CONTROLLER_MEMBER_ID"] = 0;
} else {
$arMsg[] = array("id" => "CONTROLLER_MEMBER_ID", "text" => GetMessage("CTRLR_LOG_ERR_UID"));
}
}
if (!empty($arMsg)) {
$e = new CAdminException($arMsg);
$APPLICATION->ThrowException($e);
return false;
}
return true;
}
示例8: CheckFields
function CheckFields(&$arFields, $ID = false)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$arMsg = array();
if (!is_set($arFields, "TASK_ID")) {
$arMsg[] = array("text" => GetMessage("TASKS_BAD_TASK_ID"), "id" => "ERROR_TASKS_BAD_TASK_ID");
} else {
/** @noinspection PhpDeprecationInspection */
$r = CTasks::GetByID($arFields["TASK_ID"], false);
if (!$r->Fetch()) {
$arMsg[] = array("text" => GetMessage("TASKS_BAD_TASK_ID_EX"), "id" => "ERROR_TASKS_BAD_TASK_ID_EX");
}
}
if (!is_set($arFields, "USER_ID")) {
$arMsg[] = array("text" => GetMessage("TASKS_BAD_USER_ID"), "id" => "ERROR_TASKS_BAD_USER_ID");
} else {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$r = CUser::GetByID($arFields["USER_ID"]);
if (!$r->Fetch()) {
$arMsg[] = array("text" => GetMessage("TASKS_BAD_USER_ID_EX"), "id" => "ERROR_TASKS_BAD_USER_ID_EX");
}
}
if (!empty($arMsg)) {
$e = new CAdminException($arMsg);
$APPLICATION->ThrowException($e);
return false;
}
//Defaults
if (!is_set($arFields, "TYPE") || !in_array($arFields["TYPE"], array("A", "U"))) {
$arFields["TYPE"] = "A";
}
return true;
}
示例9: __construct
public function __construct()
{
IncludeModuleLangFile(__FILE__);
$this->MODULE_ID = get_class($this);
$this->MODULE_NAME = GetMessage(strtoupper($this->MODULE_ID) . '_MODULE_NAME');
$this->MODULE_DESCRIPTION = GetMessage(strtoupper($this->MODULE_ID) . '_MODULE_DESCRIPTION');
}
示例10: CheckFilter
function CheckFilter()
{
global $strError, $arFilterFields, $statDB;
foreach ($arFilterFields as $f) {
global ${$f};
}
$str = "";
$arMsg = array();
$arr = array();
$arr[] = array("date1" => $find_date1, "date2" => $find_date2, "mess1" => GetMessage("STAT_WRONG_DATE_FROM"), "mess2" => GetMessage("STAT_WRONG_DATE_TILL"), "mess3" => GetMessage("STAT_FROM_TILL_DATE"));
$arr[] = array("date1" => $find_date_end1, "date2" => $find_date_end2, "mess1" => GetMessage("STAT_WRONG_DATE_END_FROM"), "mess2" => GetMessage("STAT_WRONG_DATE_END_TILL"), "mess3" => GetMessage("STAT_FROM_TILL_DATE_END"));
foreach ($arr as $ar) {
if (strlen($ar["date1"]) > 0 && !CheckDateTime($ar["date1"])) {
$arMsg[] = array("id" => "find_date1", "text" => $ar["mess1"]);
} elseif (strlen($ar["date2"]) > 0 && !CheckDateTime($ar["date2"])) {
$arMsg[] = array("id" => "find_date2", "text" => $ar["mess2"]);
} elseif (strlen($ar["date1"]) > 0 && strlen($ar["date2"]) > 0 && $statDB->CompareDates($ar["date1"], $ar["date2"]) == 1) {
$arMsg[] = array("id" => "find_date2", "text" => $ar["mess3"]);
}
}
// hits
if (intval($find_hits1) > 0 and intval($find_hits2) > 0 and $find_hits1 > $find_hits2) {
$arMsg[] = array("id" => "find_hits2", "text" => GetMessage("STAT_HITS1_HITS2"));
}
// events
if (intval($find_events1) > 0 and intval($find_events2) > 0 and $find_events1 > $find_events2) {
$arMsg[] = array("id" => "find_events2", "text" => GetMessage("STAT_EVENTS1_EVENTS2"));
}
if (!empty($arMsg)) {
$e = new CAdminException($arMsg);
$GLOBALS["APPLICATION"]->ThrowException($e);
return false;
}
return true;
}
示例11: CheckFields
function CheckFields(&$arFields, $ID = false)
{
global $DB, $APPLICATION;
if ($ID === false && !is_set($arFields, "STUDENT_ID")) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_USER_ID"), "EMPTY_STUDENT_ID");
return false;
} elseif (is_set($arFields, "STUDENT_ID")) {
$dbResult = CUser::GetByID($arFields["STUDENT_ID"]);
if (!$dbResult->Fetch()) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_USER_ID_EX"), "ERROR_NO_STUDENT_ID");
return false;
}
}
if ($ID === false && !is_set($arFields, "TEST_ID")) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_TEST_ID"), "EMPTY_TEST_ID");
return false;
} elseif (is_set($arFields, "TEST_ID")) {
$r = CTest::GetByID($arFields["TEST_ID"]);
if (!$r->Fetch()) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_TEST_ID_EX"), "ERROR_NO_TEST_ID");
return false;
}
}
if (is_set($arFields, "STUDENT_ID") && is_set($arFields, "TEST_ID")) {
$res = CGradeBook::GetList(array(), array("STUDENT_ID" => $arFields["STUDENT_ID"], "TEST_ID" => $arFields["TEST_ID"]));
if ($res->Fetch()) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_GRADEBOOK_DUPLICATE"), "ERROR_GRADEBOOK_DUPLICATE");
return false;
}
}
if (is_set($arFields, "COMPLETED") && $arFields["COMPLETED"] != "Y") {
$arFields["COMPLETED"] = "N";
}
return true;
}
示例12: Delete
/**
* <p>Метод удаляет тему рабочих групп. Если есть группы с этой темой, то тема удалена не будет.</p>
*
*
* @param int $id Код темы.</bod
*
* @return bool <p>True в случае успешного удаления и false - в противном случае.</p> <br><br>
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/socialnetwork/classes/csocnetgroupsubject/delete.php
* @author Bitrix
*/
public static function Delete($ID)
{
global $DB, $CACHE_MANAGER;
if (!CSocNetGroup::__ValidateID($ID)) {
return false;
}
$ID = IntVal($ID);
$bSuccess = True;
$bCanDelete = true;
$dbResult = CSocNetGroup::GetList(array(), array("SUBJECT_ID" => $ID));
if ($arResult = $dbResult->Fetch()) {
$bCanDelete = false;
}
if (!$bCanDelete) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GS_NOT_EMPTY_SUBJECT"), "NOT_EMPTY_SUBJECT");
return false;
}
$bSuccess = $DB->Query("DELETE FROM b_sonet_group_subject_site WHERE SUBJECT_ID = " . $ID . "", true);
if ($bSuccess) {
$bSuccess = $DB->Query("DELETE FROM b_sonet_group_subject WHERE ID = " . $ID . "", true);
}
if (CACHED_b_sonet_group_subjects != false) {
$CACHE_MANAGER->CleanDir("b_sonet_group_subjects");
}
return $bSuccess;
}
示例13: CheckFields
public static function CheckFields(&$arFields, $ID = false)
{
global $DB, $APPLICATION;
$arMsg = array();
if ((is_set($arFields, "USER_ID") || $ID === false) && intval($arFields["USER_ID"]) <= 0) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_USER_ID"), "EMPTY_USER_ID");
return false;
} elseif (is_set($arFields, "USER_ID")) {
$dbResult = CUser::GetByID($arFields["USER_ID"]);
if (!$dbResult->Fetch()) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_USER_ID_EX"), "ERROR_NO_USER_ID");
return false;
}
$dbResult = CStudent::GetList(array(), array("USER_ID" => $arFields["USER_ID"]));
if ($dbResult->Fetch()) {
$APPLICATION->ThrowException(GetMessage("LEARNING_BAD_USER_ID_EXISTS"), "ERROR_USER_ID_EXISTS");
return false;
}
}
if ($ID === false && !is_set($arFields, "TRANSCRIPT")) {
$arFields["TRANSCRIPT"] = CStudent::GenerateTranscipt();
} elseif (is_set($arFields, "TRANSCRIPT") && !preg_match("~^[0-9]{6,}\$~", $arFields["TRANSCRIPT"])) {
$arFields["TRANSCRIPT"] = CStudent::GenerateTranscipt();
}
if (is_set($arFields, "PUBLIC_PROFILE") && $arFields["PUBLIC_PROFILE"] != "N") {
$arFields["ACTIVE"] = "Y";
}
return true;
}
示例14: execute
public static function execute()
{
global $USER;
$result = array();
$error = false;
if (!CModule::IncludeModule('voximplant')) {
$error = 'Module voximplant is not installed.';
} else {
if (!is_object($USER) || !$USER->IsAuthorized()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if (!CVoxImplantMain::CheckAccess()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if (!check_bitrix_sessid()) {
$error = GetMessage('ACCESS_DENIED');
} else {
if ($_REQUEST["act"] == "edit") {
$result = self::executeEditPhones($error);
} else {
if ($_REQUEST["act"] == "getInfo") {
$result = self::executeGetInfo($error);
} else {
if ($_REQUEST["act"] == "option") {
$result = self::executeSaveOption($error);
}
}
}
}
}
}
}
self::returnJson(array_merge(array('result' => $error === false ? 'ok' : 'error', 'error' => CharsetConverter::ConvertCharset($error, SITE_CHARSET, 'UTF-8')), $result));
}
示例15: receiveData
/**
* Make a request to the Bitrix server and returns the result
* @param array $action
* @return array|bool
*/
public function receiveData($action)
{
$payload = $this->getPayload($action, false);
if(!$payload)
return false;
$response = self::sendRequest($payload);
if($response)
{
if(isset($response["new_spd"]))
{
CUpdateClient::setSpd($response["new_spd"]);
}
}
else
{
$response = array();
}
if(!isset($response["status"]))
{
$response["status"] = self::REMOTE_STATUS_FATAL_ERROR;
$response["error_text"] = GetMessage("SECURITY_SITE_CHECKER_CONNECTION_ERROR");
}
return $response;
}