本文整理汇总了PHP中Bitrix\Main\Localization\Loc::loadMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Loc::loadMessages方法的具体用法?PHP Loc::loadMessages怎么用?PHP Loc::loadMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\Localization\Loc
的用法示例。
在下文中一共展示了Loc::loadMessages方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocalizedMessage
public function getLocalizedMessage()
{
Main\Localization\Loc::loadMessages(__FILE__);
$code = $this->getCode();
$entityTypeID = $this->getTargetEntityTypeID();
$entityTypeName = \CCrmOwnerType::ResolveName($entityTypeID);
if ($code === EntityConversionException::NOT_FOUND) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_NOT_FOUND");
} elseif ($code === EntityConversionException::EMPTY_FIELDS) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_EMPTY_FIELDS");
} elseif ($code === EntityConversionException::HAS_WORKFLOWS) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_HAS_WORKFLOWS");
} elseif ($code === EntityConversionException::AUTOCREATION_DISABLED) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_AUTOCREATION_DISABLED");
} elseif ($code === EntityConversionException::INVALID_FIELDS) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_INVALID_FIELDS") . preg_replace('/<br\\s*\\/?>/i', "\r\n", $this->extMessage);
} elseif ($code === EntityConversionException::CREATE_DENIED) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_CREATE_DENIED");
} elseif ($code === EntityConversionException::CREATE_FAILED) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_CREATE_FAILED") . preg_replace('/<br\\s*\\/?>/i', "\r\n", $this->extMessage);
} elseif ($code === EntityConversionException::READ_DENIED) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_READ_DENIED");
} elseif ($code === EntityConversionException::UPDATE_DENIED) {
return GetMessage("CRM_CONV_EX_{$entityTypeName}_UPDATE_DENIED");
} elseif ($code === EntityConversionException::NOT_SUPPORTED) {
return GetMessage('CRM_CONV_EX_ENTITY_NOT_SUPPORTED', array('#ENTITY_TYPE_NAME#' => \CCrmOwnerType::GetDescription($entityTypeID)));
}
return $this->getMessage();
}
示例2: includeModuleFile
protected static function includeModuleFile()
{
if (self::$messagesLoaded) {
return;
}
Main\Localization\Loc::loadMessages(__FILE__);
self::$messagesLoaded = true;
}
示例3: getAllDescriptions
/**
* @return array Array of strings
*/
public static function getAllDescriptions()
{
if (!self::$allDescriptions[LANGUAGE_ID]) {
Main\Localization\Loc::loadMessages(__FILE__);
self::$allDescriptions[LANGUAGE_ID] = array(self::DEAL_CONTACT_COMPANY => GetMessage('CRM_LEAD_CONV_DEAL_CONTACT_COMPANY'), self::DEAL_CONTACT => GetMessage('CRM_LEAD_CONV_DEAL_CONTACT'), self::DEAL_COMPANY => GetMessage('CRM_LEAD_CONV_DEAL_COMPANY'), self::DEAL => GetMessage('CRM_LEAD_CONV_DEAL'), self::CONTACT_COMPANY => GetMessage('CRM_LEAD_CONV_CONTACT_COMPANY'), self::CONTACT => GetMessage('CRM_LEAD_CONV_CONTACT'), self::COMPANY => GetMessage('CRM_LEAD_CONV_COMPANY'));
}
return self::$allDescriptions[LANGUAGE_ID];
}
示例4: getAllDescriptions
/**
* @return array Array of strings
*/
public static function getAllDescriptions()
{
if (!self::$allDescriptions[LANGUAGE_ID]) {
Main\Localization\Loc::loadMessages(__FILE__);
self::$allDescriptions[LANGUAGE_ID] = array(self::DEAL => GetMessage('CRM_QUOTE_CONV_DEAL'), self::INVOICE => GetMessage('CRM_QUOTE_CONV_INVOICE'));
}
return self::$allDescriptions[LANGUAGE_ID];
}
示例5: getEditFormLegend
public function getEditFormLegend()
{
Main\Localization\Loc::loadMessages(__FILE__);
$exceptionCode = $this->exception !== null ? (int) $this->exception->getCode() : 0;
if ($exceptionCode === EntityConversionException::AUTOCREATION_DISABLED || $exceptionCode === EntityConversionException::HAS_WORKFLOWS) {
return GetMessage("CRM_ENTITY_CONV_WIZ_CUSTOM_FORM_LEGEND", array('#TEXT#' => $this->exception->getLocalizedMessage()));
}
return GetMessage("CRM_ENTITY_CONV_WIZ_FORM_LEGEND");
}
示例6: customprojectmodule
/**
* Инициализация модуля
*/
public function customprojectmodule()
{
Loc::loadMessages(__FILE__);
$moduleVersion = array();
include realpath(__DIR__) . '/version.php';
$this->MODULE_VERSION = $moduleVersion['VERSION'];
$this->MODULE_VERSION_DATE = $moduleVersion['VERSION_DATE'];
$this->MODULE_NAME = Loc::getMessage('MODULE_NAME');
$this->MODULE_DESCRIPTION = Loc::getMessage('MODULE_DESCRIPTION');
}
示例7: __construct
/**
* Converter constructor.
*
* @param int $iblockId ID of info block.
*
* @throws ArgumentTypeException
* @throws LoaderException
*/
public function __construct($iblockId)
{
$this->iblockId = intval($iblockId);
if ($this->iblockId <= 0) {
throw new ArgumentTypeException('iblockId', 'int');
}
if (!Loader::includeModule('iblock')) {
throw new LoaderException('Module "iblock" in not install');
}
Loc::loadMessages(__FILE__);
}
示例8: getFolderName
public static function getFolderName($typeID)
{
Loc::loadMessages(__FILE__);
if ($typeID === self::EmailAttachment) {
return Loc::getMessage('CRM_STORAGE_EMAIL');
} elseif ($typeID === self::CallRecord) {
return Loc::getMessage('CRM_STORAGE_CALL_RECORD');
} elseif ($typeID === self::Rest) {
return Loc::getMessage('CRM_STORAGE_APPLICATION');
}
return '';
}
示例9: validateStringId
/**
* Validation string ID of the user group. If string ID not valid (empty string or string ID alredy used)
* will be throw Bitrix exception.
*
* @param string $stringId
* @param int $groupId Group ID by string ID
*
* @return bool
*/
protected static function validateStringId($stringId, $groupId = null)
{
global $APPLICATION;
if (is_null($stringId)) {
// if code of group is not updated
return true;
}
try {
$stringId = trim($stringId);
if (strlen($stringId) <= 0) {
throw new \Exception('EMPTY_STRING_ID');
}
$rsSimilarGroup = GroupTable::query()->setFilter(['STRING_ID' => $stringId, '!ID' => $groupId])->setSelect(['ID'])->exec();
if ($rsSimilarGroup->getSelectedRowsCount() > 0) {
throw new \Exception('STRING_ID_ALREDY_USED');
}
return true;
} catch (\Exception $e) {
Loc::loadMessages(__FILE__);
$APPLICATION->ThrowException(Loc::getMessage('BEX_TOOLS_GROUP_' . $e->getMessage()));
return false;
}
}
示例10: validateCode
/**
* Validation code of the info block. If code not valid (empty string or code alredy used) will be throw
* Bitrix exception.
*
* @param string $type
* @param string $code
* @param null $iblockId
*
* @return bool
*/
protected static function validateCode($type, $code, $iblockId = null)
{
global $APPLICATION;
if (is_null($code)) {
// if code of info block is not updated
return true;
}
try {
$type = trim($type);
$code = trim($code);
if (strlen($code) <= 0) {
throw new \Exception('EMPTY_CODE');
}
$rsSimilarIblock = IblockTable::query()->setFilter(['IBLOCK_TYPE_ID' => $type, 'CODE' => $code, '!ID' => $iblockId])->setSelect(['ID'])->exec();
if ($rsSimilarIblock->getSelectedRowsCount() > 0) {
throw new \Exception('CODE_ALREDY_USED');
}
return true;
} catch (\Exception $e) {
Loc::loadMessages(__FILE__);
$APPLICATION->ThrowException(Loc::getMessage('BEX_TOOLS_IBLOCK_' . $e->getMessage()));
return false;
}
}
示例11: getTableName
<?php
namespace Hawkart\Megatv;
use Bitrix\Main\Entity;
use Bitrix\Main\Localization;
Localization\Loc::loadMessages(__FILE__);
class SourceTable extends Entity\DataManager
{
/**
* Returns DB table name for entity
*
* @return string
*/
public static function getTableName()
{
return 'hw_source';
}
/**
* Returns entity map definition
*
* @return array
*/
public static function getMap()
{
return array('ID' => array('data_type' => 'integer', 'primary' => true, 'autocomplete' => true), 'UF_LINK' => array('data_type' => 'string', 'required' => true));
}
/**
* Clear table
*/
public static function deleteAll()
示例12: __construct
public function __construct($component = null)
{
parent::__construct($component);
Localization\Loc::loadMessages(__FILE__);
}
示例13:
* @global CUserTypeManager $USER_FIELD_MANAGER
* @global CCacheManager $CACHE_MANAGER
*/
define('ADMIN_MODULE_NAME', 'seo');
use Bitrix\Main;
use Bitrix\Main\Text\Converter;
use Bitrix\Main\Localization\Loc;
use Bitrix\Seo\AdvSession;
use Bitrix\Seo\Engine;
use Bitrix\Seo\Adv;
Loc::loadMessages(dirname(__FILE__).'/../../main/tools.php');
Loc::loadMessages(dirname(__FILE__).'/seo_search.php');
Loc::loadMessages(dirname(__FILE__).'/seo_adv.php');
if (!$USER->CanDoOperation('seo_tools'))
{
$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
if(!Main\Loader::includeModule('seo'))
{
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");
ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php");
}
if(!Main\Loader::includeModule('socialservices'))
{
示例14: loadModules
protected function loadModules()
{
Main\Loader::includeModule("catalog");
Main\Loader::includeModule("search");
Main\Loader::includeModule("fileman");
Loc::loadMessages(__FILE__);
}
示例15: die
<?php
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php";
if (!$USER->CanDoOperation('seo_tools') || !check_bitrix_sessid()) {
die(GetMessage("ACCESS_DENIED"));
}
use Bitrix\Seo\Engine;
use Bitrix\Main\Text\Converter;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\IO\Path;
\Bitrix\Main\Loader::includeModule('seo');
\Bitrix\Main\Loader::includeModule('socialservices');
CUtil::JSPostUnescape();
Loc::loadMessages(dirname(__FILE__) . '/../include.php');
$engine = new Engine\Yandex();
if (isset($_REQUEST['action'])) {
$res = array();
$arDomain = null;
if (isset($_REQUEST['domain']) && strlen($_REQUEST['domain']) > 0) {
$bFound = false;
$arDomains = \CSeoUtils::getDomainsList();
foreach ($arDomains as $arDomain) {
if ($arDomain['DOMAIN'] == $_REQUEST['domain'] && rtrim($arDomain['SITE_DIR'], '/') == rtrim($_REQUEST['dir'], '/')) {
$bFound = true;
break;
}
}
if (!$bFound) {
$res = array('error' => 'Unknown site!');
}