本文整理汇总了PHP中CLanguage类的典型用法代码示例。如果您正苦于以下问题:PHP CLanguage类的具体用法?PHP CLanguage怎么用?PHP CLanguage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLanguage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkParams
/**
* @param array $langId
* @return mixed|void
* @throws BimException
* @internal param array $params
*/
public function checkParams($langId)
{
$lang = new \CLanguage();
if (!isset($langId) || empty($langId)) {
throw new BimException('В параметрах не найден langId');
}
$this->ownerItemDbData = array();
$langDbRes = $lang->GetList($by = "lid", $order = "desc", array('LID' => $langId));
if ($langDbRes === false || !$langDbRes->SelectedRowsCount()) {
throw new BimException('Не найден язык системы с id = ' . $langId);
}
$langData = $langDbRes->Fetch();
$this->ownerItemDbData = $langData;
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:20,代码来源:language.php
示例2: Delete
/**
* Удаление
*
* @param $ID
* @return array
* @throws BimException
*/
public static function Delete($ID)
{
$obLang = new \CLanguage();
if ($ID) {
$dbLang = $obLang->GetList($by = "lid", $order = "desc", array('ID' => $ID));
if ($arLang = $dbLang->Fetch()) {
$res = $obLang->Delete($ID);
if (!$res) {
throw new BimException($obLang->LAST_ERROR);
}
}
} else {
throw new BimException("Language ID is empty");
}
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:22,代码来源:LanguageIntegrate.php
示例3: Add
/**
* Add
* @param $arFields
* @return bool
* @throws \Exception
*/
public static function Add($arFields)
{
if (!isset($arFields['SECTIONS']) || empty($arFields['SECTIONS'])) {
$arFields['SECTIONS'] = 'Y';
}
if (!isset($arFields['IN_RSS']) || empty($arFields['IN_RSS'])) {
$arFields['IN_RSS'] = 'N';
}
if (isset($arFields['SORT'])) {
if (!is_int($arFields['SORT'])) {
if (intval($arFields['SORT'])) {
$arFields['SORT'] = intval($arFields['SORT']);
} else {
$arFields['SORT'] = 500;
}
}
} else {
$arFields['SORT'] = 500;
}
if (!isset($arFields['LANG']) || empty($arFields['LANG'])) {
$langDefaults = array('ru' => array('NAME' => 'Название', 'SECTION_NAME' => 'Разделы', 'ELEMENT_NAME' => 'Элементы'), 'en' => array('NAME' => 'Common', 'SECTION_NAME' => 'Sections', 'ELEMENT_NAME' => 'Elements'));
$l = \CLanguage::GetList($lby = "sort", $lorder = "asc");
while ($arIBTLang = $l->GetNext()) {
if (array_key_exists($arIBTLang["LID"], $langDefaults)) {
$arFields["LANG"][$arIBTLang["LID"]] = $langDefaults[$arIBTLang["LID"]];
}
}
}
$CIblockType = new \CIBlockType();
if ($CIblockType->Add($arFields)) {
return true;
} else {
throw new BimException($CIblockType->LAST_ERROR);
}
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:41,代码来源:IblockTypeIntegrate.php
示例4: __wd_check_uf_use_bp_property
function __wd_check_uf_use_bp_property($iblock_id)
{
$iblock_id = intval($iblock_id);
$db_res = CUserTypeEntity::GetList(array($by=>$order), array("ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION", "FIELD_NAME" => "UF_USE_BP"));
if (!$db_res || !($res = $db_res->GetNext()))
{
$arFields = Array(
"ENTITY_ID" => "IBLOCK_".$iblock_id."_SECTION",
"FIELD_NAME" => "UF_USE_BP",
"USER_TYPE_ID" => "string",
"MULTIPLE" => "N",
"MANDATORY" => "N",
"SETTINGS" => array("DEFAULT_VALUE" => "Y"));
$arFieldName = array();
$rsLanguage = CLanguage::GetList($by, $order, array());
while($arLanguage = $rsLanguage->Fetch()):
// GetMessage("SONET_UF_USE_BP");
$dir = str_replace(array("\\", "//"), "/", dirname(__FILE__));
$dirs = explode("/", $dir);
array_pop($dirs);
$file = trim(implode("/", $dirs)."/lang/".$arLanguage["LID"]."/include/webdav_settings.php");
$tmp_mess = __IncludeLang($file, true);
$arFieldName[$arLanguage["LID"]] = (empty($tmp_mess["SONET_UF_USE_BP"]) ? "Use Business Process" : $tmp_mess["SONET_UF_USE_BP"]);
endwhile;
$arFields["EDIT_FORM_LABEL"] = $arFieldName;
$obUserField = new CUserTypeEntity;
$obUserField->Add($arFields);
$GLOBALS["USER_FIELD_MANAGER"]->arFieldsCache = array();
}
}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:30,代码来源:webdav_settings.php
示例5: installEvents
/**
* Creates events for sending e-mail.
* @return bool
*/
public static function installEvents()
{
$dbEvent = \CEventMessage::GetList($b = "ID", $order = "ASC", array("EVENT_NAME" => "SALE_EBAY_ERROR"));
if (!$dbEvent->Fetch()) {
$langs = \CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
$lid = $lang["LID"];
$obEventType = new \CEventType();
$obEventType->Add(array("EVENT_NAME" => "SALE_EBAY_ERROR", "NAME" => Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR"), "LID" => $lid, "DESCRIPTION" => "\n\t\t\t\t\t#ERROR_TYPE# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_TYPE") . "\n\t\t\t\t\t#ERROR_DETAILS# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_ERROR_DETAIL") . "\n\t\t\t\t\t#EMAIL_FROM# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_FROM") . "\n\t\t\t\t\t#EMAIL_TO# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_TO") . "\n\t\t\t\t\t#BCC# - " . Loc::getMessage("SALE_EBAY_HLP_EVNT_TYPE_BCC")));
$arSites = array();
$sites = \CSite::GetList($b = "", $o = "", array("LANGUAGE_ID" => $lid));
while ($site = $sites->Fetch()) {
$arSites[] = $site["LID"];
}
if (count($arSites) > 0) {
$arr = array();
$arr["ACTIVE"] = "Y";
$arr["EVENT_NAME"] = "SALE_EBAY_ERROR";
$arr["LID"] = $arSites;
$arr["EMAIL_FROM"] = "#DEFAULT_EMAIL_FROM#";
$arr["EMAIL_TO"] = "#EMAIL_TO#";
$arr["BCC"] = "#BCC#";
$arr["SUBJECT"] = "#SITE_NAME# " . Loc::getMessage("SALE_EBAY_EVNT_MSG_SBUJ']") . ".";
$arr["BODY_TYPE"] = "text";
$arr["MESSAGE"] = Loc::getMessage("SALE_EBAY_EVNT_MSG_INFO_SITE") . " #SITE_NAME#.\n\n" . Loc::getMessage("SALE_EBAY_EVNT_MSG") . ":\n\n" . "#ERROR_TYPE#\n\n" . "#ERROR_DETAILS#";
$obTemplate = new \CEventMessage();
$obTemplate->Add($arr);
}
}
}
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:36,代码来源:helper.php
示例6: stemming_init
function stemming_init($sLang = "ru")
{
static $arStemFunc = false;
//Init all languages
if ($arStemFunc === false) {
$arStemFunc = array();
$rsLanguages = CLanguage::GetList($b = "", $o = "");
while ($arLanguage = $rsLanguages->Fetch()) {
stemming_init($arLanguage["LID"]);
}
}
//Check if language was not used
if ($sLang !== false && !isset($arStemFunc[$sLang])) {
$stemming_function_suf = $sLang;
if (!function_exists("stemming_" . $sLang)) {
$strFileName = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/php_interface/" . $sLang . "/search/stemming.php";
if (file_exists($strFileName)) {
@(include $strFileName);
}
if (!function_exists("stemming_" . $sLang)) {
$strFileName = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/search/tools/" . $sLang . "/stemming.php";
if (file_exists($strFileName)) {
@(include $strFileName);
}
if (!function_exists("stemming_" . $sLang)) {
$stemming_function_suf = "default";
}
}
}
$stemming_stop_function = "stemming_stop_" . $sLang;
if (!function_exists($stemming_stop_function)) {
$stemming_stop_function = "stemming_stop_default";
}
$stemming_upper_function = "stemming_upper_" . $sLang;
if (!function_exists($stemming_upper_function)) {
$stemming_upper_function = "stemming_upper_default";
}
$letters = stemming_letter_default();
$stemming_letter_function = "stemming_letter_" . $sLang;
if (function_exists($stemming_letter_function)) {
$letters .= $stemming_letter_function();
}
$letters .= COption::GetOptionString("search", "letters");
if (function_exists($stemming_letter_function)) {
$abc = $stemming_letter_function();
} else {
$abc = "";
}
if (strlen($abc) <= 0) {
$abc = stemming_letter_default();
}
$arStemFunc[$sLang] = array("stem" => "stemming_" . $stemming_function_suf, "stop" => $stemming_stop_function, "upper" => $stemming_upper_function, "letters" => $letters, "pcre_letters" => str_replace(array("\\", "-", "^", "]", "/"), array("\\\\", "\\-", "\\^", "\\]", "\\/"), $letters), "abc" => $abc, "pcre_abc" => str_replace(array("\\", "-", "^", "]", "/"), array("\\\\", "\\-", "\\^", "\\]", "\\/"), $abc));
}
if ($sLang === false) {
return $arStemFunc;
} else {
return $arStemFunc[$sLang];
}
}
开发者ID:spas-viktor,项目名称:books,代码行数:59,代码来源:stemming.php
示例7: getAllLangIDs
protected static function getAllLangIDs()
{
if (self::$allLangIDs !== null) {
return self::$allLangIDs;
}
self::$allLangIDs = array();
$sort = 'sort';
$order = 'asc';
$langEntity = new \CLanguage();
$dbLangs = $langEntity->GetList($sort, $order);
while ($lang = $dbLangs->Fetch()) {
if (isset($lang['LID'])) {
self::$allLangIDs[] = $lang['LID'];
}
}
return self::$allLangIDs;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:businesstype.php
示例8: GetLang
function GetLang($cur_dir = false, $cur_host = false)
{
global $DB, $lang, $MAIN_LANGS_CACHE, $MAIN_LANGS_ADMIN_CACHE;
if ($cur_dir === false) {
$cur_dir = $this->GetCurDir();
}
if ($cur_host === false) {
$cur_host = $_SERVER["HTTP_HOST"];
}
if (strpos($cur_dir, FX_ROOT . "/admin/") === 0 || strpos($cur_dir, FX_ROOT . "/updates/") === 0 || defined("ADMIN_SECTION") && ADMIN_SECTION === true || defined("FX_PUBLIC_TOOLS") && FX_PUBLIC_TOOLS === true) {
//if admin section
//lang by global var
if (strlen($lang) <= 0) {
$lang = COption::GetOptionString("main", "admin_lid", "ru");
}
$R = CLanguage::GetList($o, $b, array("LID" => $lang, "ACTIVE" => "Y"));
if ($res = $R->Fetch()) {
$MAIN_LANGS_ADMIN_CACHE[$res["LID"]] = $res;
return $res;
}
//no lang param - get default
$R = CLanguage::GetList($by = "def", $order = "desc", array("ACTIVE" => "Y"));
if ($res = $R->Fetch()) {
$MAIN_LANGS_ADMIN_CACHE[$res["LID"]] = $res;
return $res;
}
//core default
return array("en", "MM/DD/YYYY", "MM/DD/YYYY HH24:MI:SS");
} else {
// all other sections
$arURL = parse_url("http://" . $cur_host);
if ($arURL["scheme"] == "" && strlen($arURL["host"]) > 0) {
$CURR_DOMAIN = $arURL["host"];
} else {
$CURR_DOMAIN = $cur_host;
}
if (strpos($CURR_DOMAIN, ':') > 0) {
$CURR_DOMAIN = substr($CURR_DOMAIN, 0, strpos($CURR_DOMAIN, ':'));
}
$CURR_DOMAIN = trim($CURR_DOMAIN, "\t\r\n .");
$strSql = "SELECT L.*, L.LID as ID, L.LID as SITE_ID, " . "\tC.FORMAT_DATE, C.FORMAT_DATETIME, C.FORMAT_NAME, C.WEEK_START, C.CHARSET, C.DIRECTION " . "FROM b_lang L " . "\tLEFT JOIN b_lang_domain LD ON L.LID=LD.LID AND '" . $DB->ForSql($CURR_DOMAIN, 255) . "' LIKE CONCAT('%', LD.DOMAIN) " . "\tINNER JOIN b_culture C ON C.ID=L.CULTURE_ID " . "WHERE " . "\t('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%') OR LD.LID IS NOT NULL)" . "\tAND L.ACTIVE='Y' " . "ORDER BY " . "\tIF((L.DOMAIN_LIMITED='Y' AND LD.LID IS NOT NULL) OR L.DOMAIN_LIMITED<>'Y', " . "\t\tIF('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%'), 3, 1), " . "\t\tIF('" . $DB->ForSql($cur_dir) . "' LIKE CONCAT(L.DIR, '%'), 2, 0) " . "\t) DESC, " . "\tLENGTH(L.DIR) DESC, " . "\tL.DOMAIN_LIMITED DESC, " . "\tL.SORT, " . "\tLENGTH(LD.DOMAIN) DESC ";
$R = $DB->Query($strSql, false, "File: " . __FILE__ . " Line:" . __LINE__);
$res = $R->Fetch();
if ($res) {
$MAIN_LANGS_CACHE[$res["LID"]] = $res;
return $res;
}
//get default site
$strSql = "SELECT L.*, L.LID as ID, L.LID as SITE_ID, " . "\tC.FORMAT_DATE, C.FORMAT_DATETIME, C.FORMAT_NAME, C.WEEK_START, C.CHARSET, C.DIRECTION " . "FROM b_lang L, b_culture C " . "WHERE C.ID=L.CULTURE_ID AND L.ACTIVE='Y' " . "ORDER BY L.DEF DESC, L.SORT";
$R = $DB->Query($strSql);
while ($res = $R->Fetch()) {
$MAIN_LANGS_CACHE[$res["LID"]] = $res;
return $res;
}
}
return array("en", "MM/DD/YYYY", "MM/DD/YYYY HH24:MI:SS");
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:57,代码来源:main.php
示例9: CleanCache
protected static function CleanCache()
{
global $CACHE_MANAGER;
$by = 'lid';
$order = 'asc';
$rsLangs = CLanguage::GetList($by, $order);
while ($arLang = $rsLangs->Fetch()) {
$CACHE_MANAGER->Clean("admin_notify_list_" . $arLang['LANGUAGE_ID']);
}
$CACHE_MANAGER->Clean("admin_notify_list");
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:11,代码来源:admin_notify.php
示例10: __cat_LoadMess
function __cat_LoadMess($__current_file)
{
$__current_dir = dirname($__current_file);
$__current_file = basename($__current_file);
$arMess = array();
$dbLang = CLanguage::GetList($by = 'SORT', $order = 'ASC');
while ($arLang = $dbLang->Fetch()) {
$arMess[$arLang['LID']] = __IncludeLang($__current_dir . "/lang/" . $arLang['LID'] . '/' . $__current_file, true);
}
return $arMess;
}
开发者ID:Satariall,项目名称:izurit,代码行数:11,代码来源:lib.php
示例11: isValidLang
function isValidLang($lang)
{
$rsLang = CLanguage::GetList($by = "sort", $order = "desc");
$is_valid_lang = false;
while ($arLang = $rsLang->Fetch()) {
if ($lang == $arLang["LID"]) {
$is_valid_lang = true;
break;
}
}
return $is_valid_lang;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:12,代码来源:options.php
示例12: getLangs
public function getLangs($filter = array())
{
$by = 'def';
$order = 'desc';
$lids = array();
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$dbRes = \CLanguage::GetList($by, $order, $filter);
while ($aItem = $dbRes->Fetch()) {
$lids[] = $aItem;
}
return $lids;
}
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:12,代码来源:LangHelper.php
示例13: CreateForm
function CreateForm($arForm, $arFormFields, $langFile)
{
if (!CModule::IncludeModule("form")) {
return false;
}
// set defaults
$arFieldDefaults = array("ACTIVE" => "Y", "C_SORT" => 0, "ADDITIONAL" => "N", "TITLE_TYPE" => "text", "IN_RESULTS_TABLE" => "Y", "IN_EXCEL_TABLE" => "Y");
foreach ($arFormFields as $key => $arField) {
if ($arFormFields['ADDITIONAL'] == 'Y' && !is_set($arFormFields['C_SORT'])) {
$arFormFields['C_SORT'] = 5000;
}
$arFieldDefaults["C_SORT"] += 100;
$arFormFields[$key] = array_merge($arFieldDefaults, $arField);
$arFormFields[$key]["TITLE"] = GetMessage($arField["SID"] . "_QUESTION");
}
$rsLanguage = CLanguage::GetList($by, $order, array());
while ($arLanguage = $rsLanguage->Fetch()) {
WizardServices::IncludeServiceLang($langFile, $arLanguage["LID"]);
$arForm["arMENU"][$arLanguage["LID"]] = GetMessage(substr($arForm["SID"], 0, -3) . "_MENU_NAME");
}
$dbForm = CForm::GetBySID($arForm["SID"]);
if ($dbForm->Fetch()) {
return;
}
WizardServices::IncludeServiceLang("status.php");
if ($formID = CForm::Set($arForm, false, "N")) {
// setup form fields
foreach ($arFormFields as $key => $arField) {
$arField["FORM_ID"] = $formID;
$fieldID = CFormField::Set($arField, false, "N");
}
if ($arTemplates = CForm::SetMailTemplate($formID)) {
CForm::Set(array('SID' => $arForm['SID'], 'arMAIL_TEMPLATE' => $arTemplates), $formID, 'N');
}
$arStatuses = array(array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_NEW"), "C_SORT" => 100, "ACTIVE" => "Y", "DEFAULT_VALUE" => "Y", "CSS" => "statusgray", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_RECEIVED"), "C_SORT" => 200, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusblue", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_DONE"), "C_SORT" => 300, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusgreen", "arPERMISSION_VIEW" => array(0)), array("FORM_ID" => $formID, "TITLE" => GetMessage("STATUS_REFUSE"), "C_SORT" => 400, "ACTIVE" => "Y", "DEFAULT_VALUE" => "N", "CSS" => "statusred", "arPERMISSION_VIEW" => array(0)));
foreach ($arStatuses as $key => $arStatus) {
if ($STATUS_ID = CFormStatus::Set($arStatus, false, "N")) {
if ($arStatus['DEFAULT_VALUE'] == 'N' && ($arTemplates = CFormStatus::SetMailTemplate($formID, $STATUS_ID))) {
foreach ($arTemplates as $TEMPLATE_ID) {
if (null == $em) {
$em = new CEventMessage();
}
$em->Update($TEMPLATE_ID, array('MESSAGE' => GetMessage('STATUS_MESSAGE')));
}
CFormStatus::Set(array('FORM_ID' => $formID, 'arMAIL_TEMPLATE' => $arTemplates), $STATUS_ID, 'N');
}
}
}
}
return $formID;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:51,代码来源:functions.php
示例14: GetDefaultCurrencyID
public static function GetDefaultCurrencyID()
{
if (self::$DEFAULT_CURRENCY_ID !== '') {
return self::$DEFAULT_CURRENCY_ID;
}
self::$DEFAULT_CURRENCY_ID = 'USD';
$rsLang = CLanguage::GetByID('ru');
if ($arLang = $rsLang->Fetch()) {
self::$DEFAULT_CURRENCY_ID = 'RUB';
} else {
$rsLang = CLanguage::GetByID('de');
if ($arLang = $rsLang->Fetch()) {
self::$DEFAULT_CURRENCY_ID = 'EUR';
}
}
return self::$DEFAULT_CURRENCY_ID;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:17,代码来源:crm_currency.php
示例15: InstallFiles
function InstallFiles()
{
if ($_ENV["COMPUTERNAME"] != 'BX') {
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/admin", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/admin", false);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/images", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/images/controller", true, true);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/themes", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/themes", true, true);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/components", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components", True, True);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/activities", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/activities", True, True);
if (IsModuleInstalled('bizproc')) {
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/bizproc/templates", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/templates", true, true);
$langs = CLanguage::GetList($b = "", $o = "");
while ($lang = $langs->Fetch()) {
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/lang/" . $lang["LID"] . "/install/bizproc/templates", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/lang/" . $lang["LID"] . "/templates", true, true);
}
}
}
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:18,代码来源:index.php
示例16: CheckIBlockTypeID
function CheckIBlockTypeID($strIBlockTypeID, $strNewIBlockTypeID, $strNeedAdd)
{
$arResult = false;
$strNeedAdd = 'Y' == $strNeedAdd ? 'Y' : 'N';
$strNewIBlockTypeID = trim($strNewIBlockTypeID);
$strIBlockTypeID = trim($strIBlockTypeID);
if ('Y' == $strNeedAdd) {
$obIBlockType = new CIBlockType();
if ('' != $strNewIBlockTypeID) {
$rsIBlockTypes = CIBlockType::GetByID($strNewIBlockTypeID);
if ($arIBlockType = $rsIBlockTypes->Fetch()) {
$arResult = array('RESULT' => 'OK', 'VALUE' => $strNewIBlockTypeID);
} else {
$arFields = array('ID' => $strNewIBlockTypeID, 'SECTIONS' => 'N', 'IN_RSS' => 'N', 'SORT' => 500);
$rsLanguages = CLanguage::GetList($by = "sort", $order = "desc", array('ACTIVE' => 'Y'));
while ($arLanguage = $rsLanguages->Fetch()) {
$arFields['LANG'][$arLanguage['LID']]['NAME'] = $strNewIBlockTypeID;
}
$mxOffersType = $obIBlockType->Add($arFields);
if (false == $mxOffersType) {
$arResult = array('RESULT' => 'ERROR', 'MESSAGE' => $obIBlockType->LAST_ERROR);
} else {
$arResult = array('RESULT' => 'OK', 'VALUE' => $strNewIBlockTypeID);
}
}
} else {
$arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_NEW_IBLOCK_TYPE_ABSENT'));
}
} else {
if ('' == $strIBlockTypeID) {
$arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_IBLOCK_TYPE_ABSENT'));
} else {
$rsIBlockTypes = CIBlockType::GetByID($strIBlockTypeID);
if (!($arIBlockType = $rsIBlockTypes->Fetch())) {
$arResult = array('RESULT' => 'ERROR', 'MESSAGE' => GetMessage('IB_E_OF_ERR_IBLOCK_TYPE_BAD'));
} else {
$arResult = array('RESULT' => 'OK', 'VALUE' => $strIBlockTypeID);
}
}
}
return $arResult;
}
开发者ID:Satariall,项目名称:izurit,代码行数:42,代码来源:iblock_edit.php
示例17: __construct
public function __construct($arParams)
{
$this->SITE_ID = $arParams["SITE_ID"];
$this->REWRITE = $arParams["REWRITE"];
$this->ModuleBlogGroup = '[' . $this->SITE_ID . '] ' . GetMessage("IDEA_BLOG_GROUP_NAME");
$this->ModuleBlogUrl .= "_" . $this->SITE_ID;
//NULL CACHE
BXClearCache(True, '/' . $this->SITE_ID . '/idea/');
BXClearCache(True, '/' . SITE_ID . '/idea/');
global $CACHE_MANAGER;
if (CACHED_b_user_field_enum !== false) {
$CACHE_MANAGER->CleanDir("b_user_field_enum");
}
//Statuses List (for demo)
$this->arResult["SETTINGS"]["STATUS"] = CIdeaManagment::getInstance()->Idea()->GetStatusList();
foreach ($this->arResult["SETTINGS"]["STATUS"] as $arStatus) {
$this->arResult["SETTINGS"]["STATUS_ID"][$arStatus["XML_ID"]] = $arStatus["ID"];
}
//Lang List
$l = CLanguage::GetList($by = "sort", $order = "asc");
while ($r = $l->Fetch()) {
$this->arResult["SETTINGS"]["LANG"][] = $r;
}
//Sites List
$oSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y"));
while ($site = $oSites->Fetch()) {
$this->arResult["SETTINGS"]["SITE"][$site["LID"]] = array("LANGUAGE_ID" => $site["LANGUAGE_ID"], "ABS_DOC_ROOT" => $site["ABS_DOC_ROOT"], "DIR" => $site["DIR"], "SITE_ID" => $site["LID"], "SERVER_NAME" => $site["SERVER_NAME"], "NAME" => $site["NAME"]);
}
if (array_key_exists($this->SITE_ID, $this->arResult["SETTINGS"]["SITE"])) {
$this->PublicDir = str_replace(array("#SITE_DIR#"), array($this->arResult["SETTINGS"]["SITE"][$this->SITE_ID]["DIR"]), $this->PublicDir);
}
$site = CFileMan::__CheckSite($this->SITE_ID);
$this->DOCUMENT_ROOT = CSite::GetSiteDocRoot($site);
$this->IO = CBXVirtualIo::GetInstance();
//SetDefault
$this->arResult["INSTALLATION"]["IBLOCK_TYPE_INSTALL"] = true;
$this->arResult["INSTALLATION"]["IBLOCK_INSTALL"] = true;
$this->arResult["INSTALLATION"]["BLOG_GROUP_INSTALL"] = true;
$this->arResult["INSTALLATION"]["BLOG_INSTALL"] = true;
$this->CheckParams();
}
开发者ID:webgksupport,项目名称:alpina,代码行数:41,代码来源:step1.php
示例18: __load_exchange_use_login_messages
function __load_exchange_use_login_messages()
{
$arEditFormLabel1 = array();
$dbLang1 = CLanguage::GetList($b1, $o1, array());
while ($arLang1 = $dbLang1->Fetch()) {
$MESS = array();
$fn1 = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/dav/lang/" . preg_replace("/[^a-z0-9]/i", "", $arLang1["LID"]) . "/options.php";
$fnDef1 = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/dav/lang/en/options.php";
if (file_exists($fn1)) {
include $fn1;
} elseif (file_exists($fnDef1)) {
include $fnDef1;
}
if (isset($MESS["DAV_EXCHANGE_USER_FIELD"])) {
$arEditFormLabel1[$arLang1["LID"]] = $MESS["DAV_EXCHANGE_USER_FIELD"];
} else {
$arEditFormLabel1[$arLang1["LID"]] = "Exchange mail box";
}
}
return $arEditFormLabel1;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:options.php
示例19: CheckIBlockType
function CheckIBlockType($ID, $SECTIONS = "Y")
{
$obType = new CIBlockType();
$rsType = $obType->GetByID($ID);
if ($arType = $rsType->Fetch()) {
return $arType["ID"];
} else {
$arFields = array("ID" => $ID, "SECTIONS" => $SECTIONS, "LANG" => array());
$rsLanguages = CLanguage::GetList($by = "sort", $order = "asc");
while ($arLanguage = $rsLanguages->Fetch()) {
$MY_MESS = IncludeModuleLangFile(__FILE__, $arLanguage["LID"], true);
$arFields["LANG"][$arLanguage["LID"]] = array("NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_NAME"], "SECTION_NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_SECTIONS_NAME"], "ELEMENT_NAME" => $MY_MESS["IBLOCK_INSTALL_" . strtoupper($ID) . "_ELEMENTS_NAME"]);
}
$result = $obType->Add($arFields);
if ($result) {
return $result;
} else {
return false;
}
}
}
开发者ID:Satariall,项目名称:izurit,代码行数:21,代码来源:step2.php
示例20: CheckFields
function CheckFields($arFields)
{
global $APPLICATION;
$aMsg = array();
if (is_set($arFields, "NAME") && trim($arFields["NAME"]) == "") {
$aMsg[] = array("id" => "NAME", "text" => GetMessage("fav_general_err_name"));
}
if (is_set($arFields, "URL") && trim($arFields["URL"]) == "") {
$aMsg[] = array("id" => "URL", "text" => GetMessage("fav_general_err_url"));
}
if (is_set($arFields, "USER_ID")) {
if (intval($arFields["USER_ID"]) > 0) {
$res = CUser::GetByID(intval($arFields["USER_ID"]));
if (!$res->Fetch()) {
$aMsg[] = array("id" => "USER_ID", "text" => GetMessage("fav_general_err_user"));
}
} elseif ($arFields["COMMON"] == "N") {
$aMsg[] = array("id" => "USER_ID", "text" => GetMessage("fav_general_err_user1"));
}
}
if (is_set($arFields, "LANGUAGE_ID")) {
if ($arFields["LANGUAGE_ID"] != "") {
$res = CLanguage::GetByID($arFields["LANGUAGE_ID"]);
if (!$res->Fetch()) {
$aMsg[] = array("id" => "LANGUAGE_ID", "text" => GetMessage("fav_general_err_lang"));
}
} else {
$aMsg[] = array("id" => "LANGUAGE_ID", "text" => GetMessage("fav_general_err_lang1"));
}
}
if (!empty($aMsg)) {
$e = new CAdminException($aMsg);
$APPLICATION->ThrowException($e);
return false;
}
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:37,代码来源:favorites.php
注:本文中的CLanguage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论