本文整理汇总了PHP中CLangAdmin类的典型用法代码示例。如果您正苦于以下问题:PHP CLangAdmin类的具体用法?PHP CLangAdmin怎么用?PHP CLangAdmin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLangAdmin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: CheckFields
function CheckFields($ACTION, &$arFields)
{
if ((is_set($arFields, "SMILE_TYPE") || $ACTION == "ADD") && $arFields["SMILE_TYPE"] != "I" && $arFields["SMILE_TYPE"] != "S") {
return False;
}
if ((is_set($arFields, "IMAGE") || $ACTION == "ADD") && strlen($arFields["IMAGE"]) <= 0) {
return False;
}
if ((is_set($arFields, "SORT") || $ACTION == "ADD") && IntVal($arFields["SORT"]) <= 0) {
$arFields["SORT"] = 150;
}
if (is_set($arFields, "LANG") || $ACTION == "ADD") {
for ($i = 0; $i < count($arFields["LANG"]); $i++) {
if (!is_set($arFields["LANG"][$i], "LID") || strlen($arFields["LANG"][$i]["LID"]) <= 0) {
return false;
}
if (!is_set($arFields["LANG"][$i], "NAME") || strlen($arFields["LANG"][$i]["NAME"]) <= 0) {
return false;
}
}
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
$bFound = False;
for ($i = 0; $i < count($arFields["LANG"]); $i++) {
if ($arFields["LANG"][$i]["LID"] == $arLang["LID"]) {
$bFound = True;
}
}
if (!$bFound) {
return false;
}
}
}
return True;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:35,代码来源:smile.php
示例2: setLangIds
protected function setLangIds()
{
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($lang = $db_lang->Fetch()) {
$this->lang_ids[] = $lang["LID"];
}
}
开发者ID:dimabresky,项目名称:bitrix-Erip-module,代码行数:7,代码来源:index.php
示例3: CheckFields
function CheckFields($ACTION, &$arFields)
{
global $DB;
if (is_set($arFields, "SORT") && IntVal($arFields["SORT"]) <= 0) {
$arFields["SORT"] = 100;
}
if (is_set($arFields, "LOCATION_ID") && (!is_array($arFields["LOCATION_ID"]) || count($arFields["LOCATION_ID"]) <= 0)) {
return false;
}
if (is_set($arFields, "LANG")) {
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
$bFound = False;
$coountarFieldLang = count($arFields["LANG"]);
for ($i = 0; $i < $coountarFieldLang; $i++) {
if ($arFields["LANG"][$i]["LID"] == $arLang["LID"] && strlen($arFields["LANG"][$i]["NAME"]) > 0) {
$bFound = True;
}
}
if (!$bFound) {
return false;
}
}
}
return True;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:location_group.php
示例4: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
$aMsg = array();
if (is_set($arFields, "LANG") || $ACTION == "ADD") {
if (!is_array($arFields["LANG"])) {
$arFields["LANG"] = array();
}
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc");
while ($arLang = $db_lang->Fetch()) {
$bFound = False;
foreach ($arFields["LANG"] as $key => $res) {
if (is_array($res) && $res["LID"] == $arLang["LID"]) {
$arFields["LANG"][$key]["NAME"] = trim($res["NAME"]);
if (strLen($arFields["LANG"][$key]["NAME"]) > 0) {
$bFound = True;
break;
}
}
}
if (!$bFound) {
$aMsg[] = array("id" => 'POINTS[NAME][LID][' . $arLang["LID"] . ']', "text" => str_replace("#LANG#", $arLang["NAME"] . " [" . $arLang["LID"] . "]", GetMessage("FORUM_PE_ERROR_NONAME")));
}
}
}
if (is_set($arFields, "MIN_POINTS") || $ACTION == "ADD") {
$arFields["MIN_POINTS"] = trim($arFields["MIN_POINTS"]);
if (strLen($arFields["MIN_POINTS"]) <= 0) {
$aMsg[] = array("id" => 'POINTS[MIN_POINTS]', "text" => GetMessage("FORUM_PE_ERROR_MIN_POINTS_EMPTY"));
} elseif (preg_match("/[^0-9]/", $arFields["MIN_POINTS"])) {
$aMsg[] = array("id" => 'POINTS[MIN_POINTS]', "text" => GetMessage("FORUM_PE_ERROR_MIN_POINTS_BAD"));
} else {
$arFields["MIN_POINTS"] = intVal($arFields["MIN_POINTS"]);
$db_res = CForumPoints::GetList(array(), array("MIN_POINTS" => $arFields["MIN_POINTS"]));
if ($db_res && ($res = $db_res->GetNext())) {
if ($ACTION == "ADD" || $ID == 0 || $ID != $res["ID"]) {
$aMsg[] = array("id" => 'POINTS[MIN_POINTS]', "text" => GetMessage("FORUM_PE_ERROR_MIN_POINTS_EXIST"));
}
}
}
}
$arFields["VOTES"] = intval($arFields["VOTES"]);
if (!empty($aMsg)) {
$e = new CAdminException(array_reverse($aMsg));
$GLOBALS["APPLICATION"]->ThrowException($e);
return false;
}
return true;
}
开发者ID:rasuldev,项目名称:torino,代码行数:48,代码来源:points.php
示例5: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = "")
{
global $DB, $APPLICATION;
if ((is_set($arFields, "SORT") || $ACTION == "ADD") && IntVal($arFields["SORT"]) <= 0) {
$arFields["SORT"] = 100;
}
if ((is_set($arFields, "ID") || $ACTION == "ADD") && strlen($arFields["ID"]) <= 0) {
return false;
}
if (is_set($arFields, "ID") && strlen($ID) > 0 && $ID != $arFields["ID"]) {
return false;
}
if (is_set($arFields, "ID") && !preg_match("#[A-Za-z]#i", $arFields["ID"]) || strlen($ID) > 0 && !preg_match("#[A-Za-z]#i", $ID)) {
$APPLICATION->ThrowException(GetMessage("SKGS_ID_NOT_SYMBOL"), "ID");
return false;
}
if ($ACTION == "ADD") {
$arFields["ID"] = $DB->ForSql($arFields["ID"], 1);
$db_res = $DB->Query("SELECT ID FROM b_sale_status WHERE ID = '" . $arFields["ID"] . "'");
if ($db_res->Fetch()) {
$APPLICATION->ThrowException(GetMessage("SKGS_SALE_STATUS_ALREADY_EXISTS"), "ID");
return false;
}
}
if (is_set($arFields, "LANG")) {
$b = 'sort';
$o = 'asc';
$db_lang = CLangAdmin::GetList($b, $o, array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
$bFound = false;
foreach ($arFields["LANG"] as &$arOneLang) {
if ($arOneLang["LID"] == $arLang["LID"] && '' != $arOneLang["NAME"]) {
$bFound = true;
break;
}
}
if (isset($arOneLang)) {
unset($arOneLang);
}
if (!$bFound) {
return false;
}
}
}
return true;
}
开发者ID:rasuldev,项目名称:torino,代码行数:46,代码来源:status.php
示例6: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = "")
{
global $DB;
if ((is_set($arFields, "SORT") || $ACTION=="ADD") && IntVal($arFields["SORT"])<= 0) $arFields["SORT"] = 100;
if ((is_set($arFields, "ID") || $ACTION=="ADD") && strlen($arFields["ID"])<=0) return false;
if (is_set($arFields, "ID") && strlen($ID)>0 && $ID!=$arFields["ID"]) return false;
if((is_set($arFields, "ID") && !preg_match("#[A-Za-z]#i", $arFields["ID"])) || (strlen($ID)>0 && !preg_match("#[A-Za-z]#i", $ID)))
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGS_ID_NOT_SYMBOL"), "ERROR_ID_NOT_SYMBOL");
return false;
}
if ($ACTION=="ADD")
{
$arFields["ID"] = $DB->ForSql($arFields["ID"], 1);
$db_res = $DB->Query("SELECT ID FROM b_sale_status WHERE ID = '".$arFields["ID"]."' ");
if ($db_res->Fetch()) return false;
}
if (is_set($arFields, "LANG"))
{
$db_lang = CLangAdmin::GetList(($b="sort"), ($o="asc"), array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch())
{
$bFound = false;
foreach ($arFields["LANG"] as &$arOneLang)
{
if ($arOneLang["LID"] == $arLang["LID"] && '' != $arOneLang["NAME"])
{
$bFound = true;
break;
}
}
if (isset($arOneLang))
unset($arOneLang);
if (!$bFound) return false;
}
}
return true;
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:44,代码来源:status.php
示例7: CheckFields
function CheckFields($ACTION, &$arFields, $ID = "")
{
global $DB;
if ((is_set($arFields, "SORT") || $ACTION == "ADD") && IntVal($arFields["SORT"]) <= "Y") {
$arFields["SORT"] = 100;
}
if ((is_set($arFields, "ID") || $ACTION == "ADD") && strlen($arFields["ID"]) <= 0) {
return false;
}
if (is_set($arFields, "ID") && strlen($ID) > 0 && $ID != $arFields["ID"]) {
return false;
}
if (is_set($arFields, "ID") && !preg_match("#[A-Za-z]#i", $arFields["ID"]) || strlen($ID) > 0 && !preg_match("#[A-Za-z]#i", $ID)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGS_ID_NOT_SYMBOL"), "ERROR_ID_NOT_SYMBOL");
return false;
}
if ($ACTION == "ADD") {
$arFields["ID"] = $DB->ForSql($arFields["ID"], 1);
$db_res = $DB->Query("SELECT ID FROM b_sale_status WHERE ID = '" . $arFields["ID"] . "' ");
if ($db_res->Fetch()) {
return false;
}
}
if (is_set($arFields, "LANG")) {
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
$bFound = False;
for ($i = 0; $i < count($arFields["LANG"]); $i++) {
if ($arFields["LANG"][$i]["LID"] == $arLang["LID"] && strlen($arFields["LANG"][$i]["NAME"]) > 0) {
$bFound = True;
}
}
if (!$bFound) {
return false;
}
}
}
return True;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:39,代码来源:status.php
示例8: UpdateRegion
/**
* The function modifies the parameters of the region
*
* @param int $ID region code
* @param array $arFields array with parameters region
* @return int $ID code region
*/
public static function UpdateRegion($ID, $arFields)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0 || !CSaleLocation::RegionCheckFields("UPDATE", $arFields)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeRegionUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
$strUpdate = $DB->PrepareUpdate("b_sale_location_region", $arFields);
$strSql = "UPDATE b_sale_location_region SET " . $strUpdate . " WHERE ID = " . $ID . "";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
if ($arCntLang = CSaleLocation::GetRegionLangByID($ID, $arLang["LID"])) {
$strUpdate = $DB->PrepareUpdate("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
//print_r($arFields);die();
$strSql = "UPDATE b_sale_location_region_lang SET " . $strUpdate . " WHERE ID = " . $arCntLang["ID"] . "";
} else {
$arInsert = $DB->PrepareInsert("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
$strSql = "INSERT INTO b_sale_location_region_lang(REGION_ID, " . $arInsert[0] . ") " . "VALUES(" . $ID . ", " . $arInsert[1] . ")";
}
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
foreach (GetModuleEvents("sale", "OnRegionUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
return $ID;
}
开发者ID:rasuldev,项目名称:torino,代码行数:39,代码来源:location.php
示例9: array
}
return;
}
$currencyID = $currency['CURRENCY'];
$isEditMode = true;
}
$isBaseCurrency = $currencyID !== '' && $currencyID === $baseCurrencyID;
$currency['IS_ACCOUNTING_CURRENCY'] = $currencyID !== '' && $currencyID === CCrmCurrency::GetAccountCurrencyID();
$currency['IS_INVOICE_CURRENCY'] = $currencyID !== '' && $currencyID === CCrmCurrency::getInvoiceDefault();
$arResult['CURRENCY_ID'] = $currencyID;
$arResult['CURRENCY'] = $currency;
$arResult['FORM_ID'] = 'CRM_CURRENCY_EDIT';
$arResult['GRID_ID'] = 'CRM_CURRENCY_EDIT';
$arResult['BACK_URL'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CURRENCY_LIST'], array());
$langs = array();
$rsLang = CLangAdmin::GetList($by = 'sort', $order = 'asc');
while ($arLang = $rsLang->Fetch()) {
$lid = $arLang['LID'];
$langs[$lid] = array('NAME' => $arLang['NAME']);
}
$arResult['LANGS'] = $langs;
$currencyLocs = array();
if ($currencyID !== '') {
$rs = CCurrencyLang::GetList($by = '', $order = '', $currencyID);
while ($ary = $rs->GetNext()) {
$loc = array();
$loc['FULL_NAME'] = $ary['FULL_NAME'];
$loc['FORMAT_STRING'] = $ary['FORMAT_STRING'];
$loc['DEC_POINT'] = $ary['DEC_POINT'];
$loc['THOUSANDS_SEP'] = $ary['THOUSANDS_SEP'];
$loc['THOUSANDS_VARIANT'] = $ary['THOUSANDS_VARIANT'];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php
示例10: array
$arSelectFields = $lAdmin->GetVisibleHeaderColumns();
$arSelectFieldsMap = array();
foreach ($arSelectFields as &$strOneFieldName) {
$arSelectFieldsMap[$strOneFieldName] = true;
}
if (isset($strOneFieldName)) {
unset($strOneFieldName);
}
$mxKey = array_search('NAME_LID', $arSelectFields);
if (false !== $mxKey) {
unset($arSelectFields[$mxKey]);
}
$arLangList = array();
$arLangDefList = array();
if (array_key_exists('NAME_LID', $arSelectFieldsMap)) {
$rsPriceLangs = CLangAdmin::GetList($by1 = "sort", $order1 = "asc");
while ($arPriceLang = $rsPriceLangs->Fetch()) {
$arLangList[$arPriceLang['LID']] = true;
$arLangDefList[$arPriceLang['LID']] = str_replace('#LANG#', htmlspecialcharsex($arPriceLang['NAME']), GetMessage('BT_CAT_GROUP_ADM_LANG_MESS'));
}
}
if (array_key_exists("mode", $_REQUEST) && $_REQUEST["mode"] == "excel") {
$arNavParams = false;
} else {
$arNavParams = array("nPageSize" => CAdminResult::GetNavSize($sTableID));
}
$dbResultList = CCatalogGroup::GetList(array($by => $order), array(), false, $arNavParams, $arSelectFields);
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("group_admin_nav")));
$arRows = array();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:cat_group_admin.php
示例11: GetLanguagesID
private static function GetLanguagesID()
{
if (self::$LANGS_ID) {
return self::$LANGS_ID;
}
self::$LANGS_ID = array();
$by = 'sort';
$order = 'asc';
$dbResult = CLangAdmin::GetList($by, $order);
while ($arResult = $dbResult->Fetch()) {
self::$LANGS_ID[] = $arResult['LID'];
}
return self::$LANGS_ID;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:14,代码来源:crm_currency.php
示例12: CMain
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/main" . "/SetCorePath.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/main/Start.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/main/classes/general/virtual_io.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/freetrix/modules/main/classes/general/virtual_file.php";
$Application = \Freetrix\Main\Application::getInstance();
$Application->initializeExtendedKernel(array("get" => $_GET, "post" => $_POST, "files" => $_FILES, "cookie" => $_COOKIE, "server" => $_SERVER, "env" => $_ENV));
$GLOBALS["APPLICATION"] = new CMain();
if (defined("SITE_ID")) {
define("LANG", SITE_ID);
}
if (defined("LANG")) {
if (defined("ADMIN_SECTION") && ADMIN_SECTION === true) {
$currentLangGetter = CLangAdmin::GetByID(LANG);
} else {
$currentLangGetter = CLang::GetByID(LANG);
}
$definedLang = $currentLangGetter->Fetch();
} else {
$definedLang = $GLOBALS["APPLICATION"]->GetLang();
define("LANG", $definedLang["LID"]);
}
$_762722495 = $definedLang["LID"];
define("SITE_ID", $definedLang["LID"]);
define("SITE_DIR", $definedLang["DIR"]);
define("SITE_SERVER_NAME", $definedLang["SERVER_NAME"]);
define("SITE_CHARSET", $definedLang["CHARSET"]);
define("FORMAT_DATE", $definedLang["FORMAT_DATE"]);
define("FORMAT_DATETIME", $definedLang["FORMAT_DATETIME"]);
define("LANG_DIR", $definedLang["DIR"]);
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:include.php
示例13: array
/** @var Bitrix\Sale\Order $saleOrder */
Admin\OrderEdit::initCouponsData($saleOrder->getUserId(), $ID);
CUtil::InitJSCore();
$APPLICATION->SetTitle(Loc::getMessage("SALE_OVIEW_TITLE", array("#ID#" => $saleOrder->getId(), "#NUM#" => strlen($saleOrder->getField('ACCOUNT_NUMBER')) > 0 ? $saleOrder->getField('ACCOUNT_NUMBER') : $saleOrder->getId(), "#DATE#" => $saleOrder->getDateInsert()->toString())));
\Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_edit.js");
ob_start();
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/admin/order_history.php";
$historyContent = ob_get_contents();
ob_end_clean();
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
/* context menu */
$aMenu = array();
$aMenu[] = array("ICON" => "btn_list", "TEXT" => Loc::getMessage("SALE_OVIEW_TO_LIST"), "TITLE" => Loc::getMessage("SALE_OVIEW_TO_LIST_TITLE"), "LINK" => "/bitrix/admin/sale_order.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_"));
$aMenu[] = array("TEXT" => Loc::getMessage("SALE_OVIEW_TO_EDIT"), "TITLE" => Loc::getMessage("SALE_OVIEW_TO_EDIT_TITLE"), "LINK" => "/bitrix/admin/sale_order_edit.php?ID=" . $ID . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_"));
$arSysLangs = array();
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
$arSysLangs[] = $arLang["LID"];
}
$arReports = array();
$dirs = array($_SERVER["DOCUMENT_ROOT"] . "/bitrix/admin/reports/", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/reports/");
foreach ($dirs as $dir) {
if (file_exists($dir)) {
if ($handle = opendir($dir)) {
while (($file = readdir($handle)) !== false) {
$file_contents = '';
if ($file == "." || $file == ".." || $file == ".access.php") {
continue;
}
if (is_file($dir . $file) && ToUpper(substr($file, -4)) == ".PHP") {
$rep_title = $file;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:order_view.php
示例14: initializeBasicKernel
public static function initializeBasicKernel()
{
//language independed classes
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/punycode.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/charset_converter.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/main.php";
//main class
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/option.php";
//options and settings class
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/cache.php";
//various cache classes
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/cache_html.php";
//html cache class support
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/module.php";
error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_PARSE);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/virtual_io.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/virtual_file.php";
//define global application object
$GLOBALS["APPLICATION"] = new \CMain();
if (defined("SITE_ID")) {
define("LANG", SITE_ID);
}
if (defined("LANG")) {
if (defined("ADMIN_SECTION") && ADMIN_SECTION === true) {
$db_lang = CLangAdmin::getByID(LANG);
} else {
$db_lang = CLang::getByID(LANG);
}
$arLang = $db_lang->fetch();
} else {
$arLang = $GLOBALS["APPLICATION"]->getLang();
// define("LANG", $arLang["LID"]);
}
$lang = $arLang["LID"];
// define("SITE_ID", $arLang["LID"]);
// define("SITE_DIR", $arLang["DIR"]);
// define("SITE_SERVER_NAME", $arLang["SERVER_NAME"]);
// define("SITE_CHARSET", $arLang["CHARSET"]);
// define("FORMAT_DATE", $arLang["FORMAT_DATE"]);
// define("FORMAT_DATETIME", $arLang["FORMAT_DATETIME"]);
// define("LANG_DIR", $arLang["DIR"]);
// define("LANG_CHARSET", $arLang["CHARSET"]);
// define("LANG_ADMIN_LID", $arLang["LANGUAGE_ID"]);
// define("LANGUAGE_ID", $arLang["LANGUAGE_ID"]);
/// нужна кодировка для конвертации
$GLOBALS["APPLICATION"]->reinitPath();
//global var, is used somewhere
$GLOBALS["sDocPath"] = $GLOBALS["APPLICATION"]->getCurPage();
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/tools.php");
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/date_format.php");
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/database.php");
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/main.php");
IncludeModuleLangFile(__FILE__);
error_reporting(\COption::getOptionInt("main", "error_reporting", E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_PARSE) & ~E_STRICT);
if (!defined("BX_COMP_MANAGED_CACHE") && \COption::getOptionString("main", "component_managed_cache_on", "Y") != "N") {
}
// define("BX_COMP_MANAGED_CACHE", true);
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/filter_tools.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/ajax_tools.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/urlrewriter.php";
\CModule::addAutoloadClasses("main", array("CBitrixComponent" => "classes/general/component.php", "CComponentEngine" => "classes/general/component_engine.php", "CComponentAjax" => "classes/general/component_ajax.php", "CBitrixComponentTemplate" => "classes/general/component_template.php", "CComponentUtil" => "classes/general/component_util.php", "CControllerClient" => "classes/general/controller_member.php", "PHPParser" => "classes/general/php_parser.php", "CDiskQuota" => "classes/" . $GLOBALS["DBType"] . "/quota.php", "CEventLog" => "classes/general/event_log.php", "CEventMain" => "classes/general/event_log.php", "CAdminFileDialog" => "classes/general/file_dialog.php", "WLL_User" => "classes/general/liveid.php", "WLL_ConsentToken" => "classes/general/liveid.php", "WindowsLiveLogin" => "classes/general/liveid.php", "CAllFile" => "classes/general/file.php", "CFile" => "classes/" . $GLOBALS["DBType"] . "/file.php", "CTempFile" => "classes/general/file_temp.php", "CFavorites" => "classes/" . $GLOBALS["DBType"] . "/favorites.php", "CUserOptions" => "classes/general/user_options.php", "CGridOptions" => "classes/general/grids.php", "CUndo" => "/classes/general/undo.php", "CAutoSave" => "/classes/general/undo.php", "CRatings" => "classes/" . $GLOBALS["DBType"] . "/ratings.php", "CRatingsComponentsMain" => "classes/" . $GLOBALS["DBType"] . "/ratings_components.php", "CRatingRule" => "classes/general/rating_rule.php", "CRatingRulesMain" => "classes/" . $GLOBALS["DBType"] . "/rating_rules.php", "CTopPanel" => "public/top_panel.php", "CEditArea" => "public/edit_area.php", "CComponentPanel" => "public/edit_area.php", "CTextParser" => "classes/general/textparser.php", "CPHPCacheFiles" => "classes/general/cache_files.php", "CTimeZone" => "classes/general/time.php", "CDataXML" => "classes/general/xml.php", "CRsaProvider" => "classes/general/rsasecurity.php", "CRsaSecurity" => "classes/general/rsasecurity.php", "CRsaBcmathProvider" => "classes/general/rsabcmath.php", "CRsaOpensslProvider" => "classes/general/rsaopenssl.php", "CASNReader" => "classes/general/asn.php", "CBXShortUri" => "classes/" . $GLOBALS["DBType"] . "/short_uri.php", "CFinder" => "classes/general/finder.php", "CAccess" => "classes/general/access.php", "CAuthProvider" => "classes/general/authproviders.php", "IProviderInterface" => "classes/general/authproviders.php", "CGroupAuthProvider" => "classes/general/authproviders.php", "CUserAuthProvider" => "classes/general/authproviders.php", "Bitrix\\Main\\Entity\\Base" => "lib/entity/base.php", "Bitrix\\Main\\Entity\\DataManager" => "lib/entity/base.php", "Bitrix\\Main\\Entity\\Field" => "lib/entity/field.php", "Bitrix\\Main\\Entity\\ScalarField" => "lib/entity/scalarfield.php", "Bitrix\\Main\\Entity\\IntegerField" => "lib/entity/integerfield.php", "Bitrix\\Main\\Entity\\FloatField" => "lib/entity/floatfield.php", "Bitrix\\Main\\Entity\\StringField" => "lib/entity/stringfield.php", "Bitrix\\Main\\Entity\\TextField" => "lib/entity/textfield.php", "Bitrix\\Main\\Entity\\BooleanField" => "lib/entity/booleanfield.php", "Bitrix\\Main\\Entity\\DateField" => "lib/entity/datefield.php", "Bitrix\\Main\\Entity\\DatetimeField" => "lib/entity/datetimefield.php", "Bitrix\\Main\\Entity\\EnumField" => "lib/entity/enumfield.php", "Bitrix\\Main\\Entity\\ExpressionField" => "lib/entity/expressionfield.php", "Bitrix\\Main\\Entity\\UField" => "lib/entity/ufield.php", "WorkgroupEntity" => "lib/workgroup.php", "Bitrix\\Main\\Entity\\ReferenceField" => "lib/entity/referencefield.php", "Bitrix\\Main\\Entity\\Query" => "lib/entity/query.php", "Bitrix\\Main\\Entity\\QueryChain" => "lib/entity/querychain.php", "Bitrix\\Main\\Entity\\QueryChainElement" => "lib/entity/querychainelement.php", "SiteEntity" => "lib/site.php", "Site" => "lib/site.php", "UserEntity" => "lib/user.php", "UtsUserEntity" => "lib/utsuser.php", "UtmUserEntity" => "lib/utmuser.php", "UserGroupEntity" => "lib/usergroup.php", "GroupEntity" => "lib/group.php", "CTableSchema" => "classes/general/table_schema.php", "CUserCounter" => "classes/" . $GLOBALS["DBType"] . "/user_counter.php", "CHotKeys" => "classes/general/hot_keys.php", "CHotKeysCode" => "classes/general/hot_keys.php", "CBXSanitizer" => "classes/general/sanitizer.php", "CBXArchive" => "classes/general/archive.php", "CAdminNotify" => "classes/general/admin_notify.php", "CBXFavAdmMenu" => "classes/general/favorites.php", "CAdminInformer" => "classes/general/admin_informer.php"));
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/agent.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/user.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/event.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/menu.php";
AddEventHandler("main", "OnAfterEpilog", array("CCacheManager", "_Finalize"));
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/" . $GLOBALS["DBType"] . "/usertype.php";
//component 2.0 template engines
// нужно до подключения init.php
$GLOBALS["arCustomTemplateEngines"] = array();
}
开发者ID:rasuldev,项目名称:torino,代码行数:71,代码来源:compatiblestrategy.php
示例15: getStatusLang
/**
* Returns array with status name on all site languages
* @param string $name Status name
* @param int $statusId (optional) Status ID needed if we updating status.
* @return array Array of status names.
*/
private function getStatusLang($name, $statusId = false)
{
if (!CModule::IncludeModule('sale')) {
return false;
}
$arStatusLang = array();
$by = "sort";
$order = "asc";
$dbLang = CLangAdmin::GetList($by, $order, array("ACTIVE" => "Y"));
self::ensureLanguageDefined();
while ($arLang = $dbLang->Fetch()) {
$statusName = '';
if ($statusId && $arLang["LID"] != self::$languageID) {
$arLangStatus = CSaleStatus::GetLangByID($statusId, $arLang["LID"]);
if ($arLangStatus && isset($arLangStatus['NAME'])) {
$statusName = $arLangStatus['NAME'];
}
}
if (strlen($statusName) <= 0) {
$statusName = $name;
}
$arStatusLang[] = array('LID' => $arLang["LID"], 'NAME' => $statusName);
}
return $arStatusLang;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:crm_status_invoice.php
示例16: UpdateCity
/**
* <p>Метод изменяет параметры города с кодом ID на значения из массива arFields. Метод динамичный.</p>
*
*
* @param int $ID Код города.
*
* @param array $arFields Массив с параметрами города должен содержать ключи: <ul> <li> <b>NAME</b> -
* название города (не зависящее от языка);</li> <li> <b>SHORT_NAME</b> -
* сокращенное название города - абревиатура (не зависящее от
* языка);</li> <li> <b><код языка></b> - ключем является код языка, а
* значением ассоциативный массив вида <pre class="syntax"> array("LID" => "код
* языка", "NAME" => "название города на этом языке", "SHORT_NAME" =>
* "сокращенное название города (аббревиатура) на этом языке")</pre> Эта
* пара ключ-значение должна присутствовать для каждого языка
* системы.</li> </ul>
*
* @return int <p>Возвращается код измененного города или <i>false</i> у случае
* ошибки.</p> <br><br>
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/sale/classes/csalelocation/csalelocation__updatecity.3fe4165d.php
* @author Bitrix
*/
public static function UpdateCity($ID, $arFields)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0 || !CSaleLocation::CityCheckFields("UPDATE", $arFields)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeCityUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
if (self::isLocationProMigrated()) {
try {
$locId = self::getLocationIdByCityId($ID);
if (!$locId) {
return false;
}
$res = Location\LocationTable::update($locId, self::refineFieldsForSaveCRC($item['ID'], $arFields), array('REBALANCE' => false));
if ($res->isSuccess()) {
return $ID;
}
return false;
} catch (Exception $e) {
return false;
}
} else {
$strUpdate = $DB->PrepareUpdate("b_sale_location_city", $arFields);
$strSql = "UPDATE b_sale_location_city SET " . $strUpdate . " WHERE ID = " . $ID . "";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
if ($arCntLang = CSaleLocation::GetCityLangByID($ID, $arLang["LID"])) {
$strUpdate = $DB->PrepareUpdate("b_sale_location_city_lang", $arFields[$arLang["LID"]]);
$strSql = "UPDATE b_sale_location_city_lang SET " . $strUpdate . " WHERE ID = " . $arCntLang["ID"] . "";
} else {
$arInsert = $DB->PrepareInsert("b_sale_location_city_lang", $arFields[$arLang["LID"]]);
$strSql = "INSERT INTO b_sale_location_city_lang(CITY_ID, " . $arInsert[0] . ") " . "VALUES(" . $ID . ", " . $arInsert[1] . ")";
}
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
}
foreach (GetModuleEvents("sale", "OnCityUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
return $ID;
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:70,代码来源:location.php
示例17: IncludeModuleLangFile
CModule::IncludeModule('currency');
IncludeModuleLangFile(__FILE__);
$errorMessage = array();
$ID = '';
if (isset($_REQUEST['ID'])) {
$ID = (string) $_REQUEST['ID'];
}
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("currency_curr"), "ICON" => "", "TITLE" => GetMessage("currency_curr_settings")), array("DIV" => "edit2", "TAB" => GetMessage("BT_CURRENCY_EDIT_TAB_NAME_LANGUAGE"), "ICON" => "", "TITLE" => GetMessage("BT_CURRENCY_EDIT_TAB_TITLE_LANGUAGE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$arTemplates = CCurrencyLang::GetFormatTemplates();
$separatorList = CCurrencyLang::GetSeparatorTypes(true);
$langList = array();
$langID = array();
$by = "sort";
$order = "asc";
$langIterator = CLangAdmin::GetList($by, $order);
while ($oneLang = $langIterator->Fetch()) {
$langID[] = $oneLang['LID'];
$langList[$oneLang['LID']] = $oneLang['NAME'];
}
unset($oneLang, $langIterator, $order, $by);
$arFields = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $CURRENCY_RIGHT == "W" && !empty($_POST['Update']) && check_bitrix_sessid()) {
if (!isset($_POST['BASE']) || $_POST['BASE'] != 'Y') {
$arFields = array('AMOUNT' => isset($_POST['AMOUNT']) ? $_POST['AMOUNT'] : '', 'AMOUNT_CNT' => isset($_POST['AMOUNT_CNT']) ? $_POST['AMOUNT_CNT'] : '', 'SORT' => isset($_POST['SORT']) ? $_POST['SORT'] : '', 'NUMCODE' => isset($_POST['NUMCODE']) ? $_POST['NUMCODE'] : '');
} else {
$arFields = array('AMOUNT' => 1, 'AMOUNT_CNT' => 1, 'SORT' => isset($_POST['SORT']) ? $_POST['SORT'] : '', 'NUMCODE' => isset($_POST['NUMCODE']) ? $_POST['NUMCODE'] : '');
}
if
|
请发表评论