public function __construct($component = null) { parent::__construct($component); \Bitrix\Main\Loader::includeModule("forum"); $this->componentId = $this->isAjaxRequest() ? randString(7) : $this->randString(); $this->errorCollection = new ErrorCollection(); }
/** * По Битрикс-имени шаблона возвращает путь к его файлу * * @param string $name * @return string * @throws \Twig_Error_Loader */ private function getComponentTemplatePath($name) { $name = $this->normalizeName($name); list($namespace, $component, $template, $file) = explode(':', $name); $componentName = "{$namespace}:{$component}"; $component = new \CBitrixComponent(); $component->InitComponent($componentName, $template); $component->__templatePage = $file; $obTemplate = new \CBitrixComponentTemplate(); $obTemplate->Init($component); $templatePath = $_SERVER['DOCUMENT_ROOT'] . $obTemplate->GetFile(); if (!file_exists($templatePath)) { throw new \Twig_Error_Loader("Не удалось найти шаблон '{$name}'"); } return $templatePath; }
function __construct($component = null) { parent::__construct($component); CModule::IncludeModule('iblock'); CModule::IncludeModule('aqw.shop'); CBitrixComponent::includeComponentClass('aqw:store.product'); }
public function executeComponent() { $this->IBLOCK_ID = $this->arParams["IBLOCK_ID"]; $this->SECTION_ID = $this->arParams["SECTION_ID"]; $this->FILTER_NAME = $this->arParams["FILTER_NAME"]; $this->SAFE_FILTER_NAME = htmlspecialcharsbx($this->FILTER_NAME); if (self::$catalogIncluded === null) self::$catalogIncluded = Loader::includeModule('catalog'); if (self::$catalogIncluded) { $arCatalog = CCatalogSKU::GetInfoByProductIBlock($this->IBLOCK_ID); if (!empty($arCatalog)) { $this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"]; $this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"]; } } /*DEMO CODE for "pure" class.php component $this->arResult["FFF"] = "ggg"; $this->includeComponentTemplate(); return $this->ELEMENT_ID; */ return parent::executeComponent(); }
function __bx_share_get_handlers($template = false) { if (trim($template) == ".default") { $template = ""; } $arBookmarkHandlerDropdown = array(); $arBookmarkHandlerDropdownDefault = array(); $shareComponent = new CBitrixComponent(); $shareComponent->InitComponent("bitrix:main.share", $template); $shareComponent->InitComponentTemplate($template); if (strlen($shareComponent->__template->__folder) > 0) { $path2Handlers = $_SERVER["DOCUMENT_ROOT"] . "/" . $shareComponent->__template->__folder . "/handlers/"; CheckDirPath($path2Handlers); $arHandlers = array(); if ($handle = opendir($path2Handlers)) { while (($file = readdir($handle)) !== false) { if ($file == "." || $file == "..") { continue; } if (is_file($path2Handlers . $file) && strtoupper(substr($file, strlen($file) - 4)) == ".PHP") { $name = $title = $icon_url_template = ""; $sort = 0; include $path2Handlers . $file; if (strlen($name) > 0) { $arHandlers[$name] = array("TITLE" => $title, "ICON" => $icon_url_template, "SORT" => intval($sort)); } } } } foreach ($arHandlers as $name => $arSystem) { if (strlen($arSystem["TITLE"]) > 0) { $arBookmarkHandlerDropdown[$name] = $arSystem["TITLE"]; } } $arBookmarkHandlerDropdownTmp = $arBookmarkHandlerDropdown; if (LANGUAGE != 'ru') { if (array_key_exists("vk", $arBookmarkHandlerDropdownTmp)) { unset($arBookmarkHandlerDropdownTmp["vk"]); } if (array_key_exists("mailru", $arBookmarkHandlerDropdownTmp)) { unset($arBookmarkHandlerDropdownTmp["mailru"]); } } $arBookmarkHandlerDropdownDefault = array_keys($arBookmarkHandlerDropdownTmp); } return array("HANDLERS" => $arBookmarkHandlerDropdown, "HANDLERS_DEFAULT" => $arBookmarkHandlerDropdownDefault); }
/** * Function saves component epilog environment * * @param array[string]mixed $arEpilogInfo * @return void * */ public final function setTemplateEpilog($arEpilogInfo) { $this->__component_epilog = $arEpilogInfo; //Check if parent component exists and plug epilog it to it's "collection" if ($this->__parent) { $this->__parent->addChildEpilog($this->__component_epilog); } }
/** * @param string $type * @param CBitrixComponent $obMenuComponent * @return string */ function __GetMenuString($type = "left", $obMenuComponent) { /** @var CMenuCustom*/ global $BX_MENU_CUSTOM; $sReturn = ""; if ($GLOBALS["APPLICATION"]->buffer_manual) { $arMenuCustom = $BX_MENU_CUSTOM->GetItems($type); if (is_array($arMenuCustom)) { $obMenuComponent->arResult = array_merge($obMenuComponent->arResult, $arMenuCustom); } ob_start(); $obMenuComponent->IncludeComponentTemplate(); $sReturn = ob_get_contents(); ob_end_clean(); } return $sReturn; }
public function __construct($component = null) { parent::__construct($component); $this->helper = new CCrmProductSectionCrumbsHelper(); $this->componentId = $this->randString(); $this->errors = array(); $this->catalogId = 0; $this->sectionId = 0; }
public function __construct($component = null) { parent::__construct($component); $this->scope = self::STATUS_SCOPE_WEB; if (is_callable(array('\\Bitrix\\MobileApp\\Mobile', 'getApiVersion')) && \Bitrix\MobileApp\Mobile::getApiVersion() >= 1 && defined("BX_MOBILE") && BX_MOBILE === true) { $this->scope = self::STATUS_SCOPE_MOBILE; } if ($this->isWeb()) { $this->setTemplateName(".default"); } else { $this->setTemplateName("mobile_app"); } }
public function executeComponent() { parent::setFramemode(false); $this->userId = $this->arParams["USER_ID"]; $this->fUserId = $this->arParams["FUSER_ID"]; $this->weightKoef = $this->arParams["WEIGHT_KOEF"]; $this->weightUnit = $this->arParams["WEIGHT_UNIT"]; $this->columns = $this->arParams["COLUMNS_LIST"]; $this->offersProps = $this->arParams["OFFERS_PROPS"]; $this->quantityFloat = $this->arParams["QUANTITY_FLOAT"]; $this->countDiscount4AllQuantity = $this->arParams["COUNT_DISCOUNT_4_ALL_QUANTITY"]; $this->priceVatShowValue = $this->arParams["PRICE_VAT_SHOW_VALUE"]; $this->hideCoupon = $this->arParams["HIDE_COUPON"]; $this->usePrepayment = $this->arParams["USE_PREPAYMENT"]; $this->pathToOrder = $this->arParams["PATH_TO_ORDER"]; return parent::executeComponent(); }
public function onPrepareComponentParams($params) { $params = parent::onPrepareComponentParams($params); if (!isset($this->arParams["WIDTH"])) { $this->arParams["WIDTH"] = 400; } if (!isset($this->arParams["HEIGHT"])) { $this->arParams["HEIGHT"] = 400; } if (!isset($this->arParams["SELECTED_STORE"])) { $this->arParams["SELECTED_STORE"] = 0; if (isset($params["STORES_LIST"]) && is_array($params["STORES_LIST"])) { reset($params["STORES_LIST"]); $this->arParams["SELECTED_STORE"] = key($params["STORES_LIST"]); } } return $params; }
public function __construct($component = null) { parent::__construct($component); \Bitrix\Main\Loader::includeModule("forum"); $this->componentId = $this->isAjaxRequest() ? randString(7) : $this->randString(); $this->errorCollection = new ErrorCollection(); $this->prepareMobileData = IsModuleInstalled("mobile"); $this->scope = self::STATUS_SCOPE_WEB; if (is_callable(array('\\Bitrix\\MobileApp\\Mobile', 'getApiVersion')) && \Bitrix\MobileApp\Mobile::getApiVersion() >= 1 && defined("BX_MOBILE") && BX_MOBILE === true) { $this->scope = self::STATUS_SCOPE_MOBILE; } self::$index++; if ($this->isWeb()) { $this->setTemplateName(".default"); } else { $this->setTemplateName("mobile_app"); } }
public function executeComponent() { $this->IBLOCK_ID = $this->arParams["IBLOCK_ID"]; $this->SECTION_ID = $this->arParams["SECTION_ID"]; $this->FILTER_NAME = $this->arParams["FILTER_NAME"]; if (CModule::IncludeModule("catalog")) { $arCatalog = CCatalog::GetSkuInfoByProductID($this->IBLOCK_ID); if (is_array($arCatalog)) { $this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"]; $this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"]; } } /*DEMO CODE for "pure" class.php component $this->arResult["FFF"] = "ggg"; $this->includeComponentTemplate(); return $this->ELEMENT_ID; */ return parent::executeComponent(); }
/** * @param $arParams * @return array */ public function onPrepareComponentParams($arParams) { $arParams['FILTER_NAME'] = $this->initFilterName($arParams['FILTER_NAME']); $this->loadTooltipFromSocialNetwork($arParams); $arParams["NAME_TEMPLATE"] = empty($arParams["NAME_TEMPLATE"]) || !trim($arParams["NAME_TEMPLATE"]) ? CSite::GetNameFormat() : $arParams["NAME_TEMPLATE"]; //set default to Y $arParams['SHOW_LOGIN'] = empty($arParams['SHOW_LOGIN']) || $arParams['SHOW_LOGIN'] != "N" ? "Y" : "N"; //if not set value, set to default $arParams["PM_URL"] = empty($arParams["PM_URL"]) ? "/company/personal/messages/chat/#USER_ID#/" : $arParams["PM_URL"]; $arParams["PATH_TO_CONPANY_DEPARTMENT"] = empty($arParams["PATH_TO_CONPANY_DEPARTMENT"]) ? "/company/structure.php?set_filter_structure=Y&structure_UF_DEPARTMENT=#ID#" : $arParams["PATH_TO_CONPANY_DEPARTMENT"]; $arParams["PATH_TO_VIDEO_CALL"] = IsModuleInstalled("video") && empty($arParams["PATH_TO_VIDEO_CALL"]) ? "/company/personal/video/#USER_ID#/" : $arParams["PATH_TO_VIDEO_CALL"]; TrimArr($arParams['ALPHABET_LANG']); $arParams['ALPHABET_LANG'] = empty($arParams['ALPHABET_LANG']) ? array(LANGUAGE_ID) : $arParams['ALPHABET_LANG']; $arParams['CURRENT_VIEW'] = $this->getCurrentView($arParams); $arParams['LIST_URL'] = $this->getApplication()->GetCurPage(); if (!$arParams['DETAIL_URL']) { $arParams['DETAIL_URL'] = $arParams['LIST_URL'] . '?ID=#USER_ID#'; } return parent::onPrepareComponentParams($arParams); }
public function onPrepareComponentParams($arParams) { $arParams['action'] = strtolower($arParams['action']); $arParams['inviteFromUserId'] = (int) $arParams['inviteFromUserId']; $arParams['attachToUserId'] = (int) $arParams['attachToUserId']; $arParams['attachToUserIds'] = empty($arParams['attachToUserIds']) ? array() : $arParams['attachToUserIds']; $arParams['unshareUserIds'] = empty($arParams['unshareUserIds']) ? array() : $arParams['unshareUserIds']; $arParams['inviteDescription'] = empty($arParams['inviteDescription']) ? '' : $arParams['inviteDescription']; $arParams['canEdit'] = !empty($arParams['canEdit']); $arParams['pathToUser'] = !empty($arParams['pathToUser']) ? $arParams['pathToUser'] : '******'; $arParams['pathToGroup'] = !empty($arParams['pathToGroup']) ? $arParams['pathToGroup'] : '/workgroups/group/#group_id#/'; $arParams['userListType'] = !empty($arParams['userListType']) ? strtolower($arParams['userListType']) : 'cannot_edit'; $arParams['currentUserCanUnshare'] = !empty($arParams['currentUserCanUnshare']); if (!is_array($arParams['attachToUserIds'])) { $arParams['attachToUserIds'] = array(); } if (!is_array($arParams['unshareUserIds'])) { $arParams['unshareUserIds'] = array(); } return parent::onPrepareComponentParams($arParams); }
public function executeComponent() { $this->IBLOCK_ID = $this->arParams["IBLOCK_ID"]; $this->SECTION_ID = $this->arParams["SECTION_ID"]; $this->FILTER_NAME = $this->arParams["FILTER_NAME"]; $this->SAFE_FILTER_NAME = htmlspecialcharsbx($this->FILTER_NAME); if (self::$catalogIncluded === null) self::$catalogIncluded = Loader::includeModule('catalog'); if (self::$catalogIncluded) { $arCatalog = CCatalogSKU::GetInfoByProductIBlock($this->IBLOCK_ID); if (!empty($arCatalog)) { $this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"]; $this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"]; } } $this->facet = new \Bitrix\Iblock\PropertyIndex\Facet($this->IBLOCK_ID); return parent::executeComponent(); }
public function onPrepareComponentParams($arParams) { $arParams['FILTER_NAME'] = $this->initFilterName($arParams['FILTER_NAME']); $this->initExternalValues($arParams['FILTER_NAME']); $arParams['USERS_PER_PAGE'] = intval($arParams['USERS_PER_PAGE']); $arParams['NAV_TITLE'] = !empty($arParams['NAV_TITLE']) ? $arParams['NAV_TITLE'] : GetMessage('INTR_ISL_PARAM_NAV_TITLE_DEFAULT'); $arParams['DATE_FORMAT'] = !empty($arParams['DATE_FORMAT']) ? $arParams['DATE_FORMAT'] : CComponentUtil::GetDateFormatDefault(false); $arParams['DATE_FORMAT_NO_YEAR'] = !empty($arParams['DATE_FORMAT_NO_YEAR']) ? $arParams['DATE_FORMAT_NO_YEAR'] : CComponentUtil::GetDateFormatDefault(true); InitBVar($arParams['FILTER_1C_USERS']); InitBVar($arParams['FILTER_SECTION_CURONLY']); InitBVar($arParams['SHOW_NAV_TOP']); InitBVar($arParams['SHOW_NAV_BOTTOM']); InitBVar($arParams['SHOW_UNFILTERED_LIST']); InitBVar($arParams['SHOW_DEP_HEAD_ADDITIONAL']); !isset($arParams["CACHE_TIME"]) && ($arParams["CACHE_TIME"] = 3600); if ($arParams['CACHE_TYPE'] == 'A') { $arParams['CACHE_TYPE'] = COption::GetOptionString("main", "component_cache_on", "Y"); } $arParams['DETAIL_URL'] = COption::GetOptionString('intranet', 'search_user_url', '/user/#ID#/'); if (!array_key_exists("PM_URL", $arParams)) { $arParams["PM_URL"] = "/company/personal/messages/chat/#USER_ID#/"; } if (!array_key_exists("PATH_TO_USER_EDIT", $arParams)) { $arParams["PATH_TO_USER_EDIT"] = '/company/personal/user/#user_id#/edit/'; } if (!array_key_exists("PATH_TO_CONPANY_DEPARTMENT", $arParams)) { $arParams["PATH_TO_CONPANY_DEPARTMENT"] = "/company/structure.php?set_filter_structure=Y&structure_UF_DEPARTMENT=#ID#"; } if (IsModuleInstalled("video") && !array_key_exists("PATH_TO_VIDEO_CALL", $arParams)) { $arParams["PATH_TO_VIDEO_CALL"] = "/company/personal/video/#USER_ID#/"; } if (!$this->getUser()->CanDoOperation("edit_all_users") && isset($arParams["SHOW_USER"]) && $arParams["SHOW_USER"] != "fired") { $arParams["SHOW_USER"] = "******"; } return parent::onPrepareComponentParams($arParams); }
/** * Function returns next pseudo random value. * * @param int $length * @return string * * @see \Bitrix\Main\Type\RandomSequence::randString */ public function randString($length = 6) { return $this->__component->randString($length); }
/** * Function includes class of the component by component name bitrix:component.base * * @param string $componentName * @return string * */ final public static function includeComponentClass($componentName) { $component = new CBitrixComponent; $component->initComponent($componentName); }
function OnAfterIndexAdd($ID, $arFields) { if (isset($arFields["PARAMS"]) && isset($arFields["PARAMS"]["socnet_group"])) { CBitrixComponent::clearComponentCache("bitrix:search.tags.cloud"); } }
public function __construct($component = null) { parent::__construct($component); Localization\Loc::loadMessages(__FILE__); }
{ CIBlockPriceTools::setRatioMinPrice($arResult, true); } if (!empty($arResult['DISPLAY_PROPERTIES'])) { foreach ($arResult['DISPLAY_PROPERTIES'] as $propKey => $arDispProp) { if ('F' == $arDispProp['PROPERTY_TYPE']) unset($arResult['DISPLAY_PROPERTIES'][$propKey]); } } $arResult['SKU_PROPS'] = $arSKUPropList; $arResult['DEFAULT_PICTURE'] = $arEmptyPreview; $arResult['wish']['isWished'] = CIBlockElement::GetList(false, array( 'IBLOCK_ID' => 23, 'ACTIVE' => 'Y', 'PROPERTY_OBJECT' => $arResult['ID'] ), false, false, array('ID'))->SelectedRowsCount(); CBitrixComponent::includeComponentClass("component.model:likes"); $objElement = new CIBlockElement; $likes = new Likes(1); $arResult['likes']['already_liked'] = $likes->isLikedByCurrent($arResult['ID']); $arResult['likes']['value'] = $likes->count($arResult['ID']); ?>
<?php use Bitrix\Main; use Bitrix\Catalog\CatalogViewedProductTable; use Bitrix\Main\Text\String; use Bitrix\Main\Localization\Loc; use Bitrix\Main\SystemException; if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } CBitrixComponent::includeComponentClass("bitrix:sale.bestsellers"); class CatalogBigdataProductsComponent extends CSaleBestsellersComponent { protected $rcmParams; protected $ajaxItemsIds; /** * Prepare Component Params */ public function onPrepareComponentParams($params) { global $APPLICATION; // remember src params for further ajax query if (!isset($params['RCM_CUR_BASE_PAGE'])) { $params['RCM_CUR_BASE_PAGE'] = $APPLICATION->GetCurPage(); } $this->arResult['_ORIGINAL_PARAMS'] = $params; // bestselling $params['FILTER'] = array('PAYED'); $params['PERIOD'] = 30; return parent::onPrepareComponentParams($params); }
<?php namespace Notagency\Components; \CBitrixComponent::includeComponentClass('notagency:materials.list'); class MaterialsDetail extends MaterialsList { protected $checkParams = ['IBLOCK_CODE' => ['type' => 'string']]; public function onPrepareComponentParams($arParams) { $arParams = parent::onPrepareComponentParams($arParams); $arParams['SELECT_SECTIONS'] = 'N'; $arParams['ELEMENTS_COUNT'] = 1; $arParams['PAGING'] = 'N'; if (array_key_exists($arParams['REQUEST_ELEMENT_CODE'], $_REQUEST) && !empty($_REQUEST[$arParams['REQUEST_ELEMENT_CODE']])) { $arParams['ELEMENT_CODE'] = htmlspecialchars(trim($_REQUEST[$arParams['REQUEST_ELEMENT_CODE']])); } if (array_key_exists($arParams['REQUEST_ELEMENT_ID'], $_REQUEST) && intval($_REQUEST[$arParams['REQUEST_ELEMENT_ID']])) { $arParams['ELEMENT_ID'] = intval($_REQUEST[$arParams['REQUEST_ELEMENT_ID']]); } return $arParams; } protected function executeMain() { $filterInitialized = false; if ($this->arParams['ELEMENT_ID']) { $this->elementsFilter['ID'] = $this->arParams['ELEMENT_ID']; $filterInitialized = true; } if ($this->arParams['ELEMENT_CODE']) { $this->elementsFilter['CODE'] = $this->arParams['ELEMENT_CODE'];
<?php use Bitrix\Main\Localization\Loc; use Bitrix\Main\SystemException; use Bitrix\Main\Loader; if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } CBitrixComponent::includeComponentClass("bitrix:catalog.viewed.products"); class CSaleBestsellersComponent extends CCatalogViewedProductsComponent { /** * @param $params * @override * @return array */ public function onPrepareComponentParams($params) { $params = parent::onPrepareComponentParams($params); if (!isset($params["CACHE_TIME"])) { $params["CACHE_TIME"] = 86400; } $params["DETAIL_URL"] = trim($params["DETAIL_URL"]); if (isset($params["BY"]) && is_array($params["BY"])) { if (count($params["BY"])) { $params["BY"] = array_values($params["BY"]); $params["BY"] = $params["BY"][0]; } else { $params["BY"] = "AMOUNT"; } }
public function executeComponent() { $this->IBLOCK_ID = $this->arParams["IBLOCK_ID"]; $this->SECTION_ID = $this->arParams["SECTION_ID"]; $this->FILTER_NAME = $this->arParams["FILTER_NAME"]; $this->SAFE_FILTER_NAME = htmlspecialcharsbx($this->FILTER_NAME); if ($this->arParams["CONVERT_CURRENCY"] && $this->arParams["CURRENCY_ID"] != "" && Loader::includeModule('currency')) { $currencyList = \Bitrix\Currency\CurrencyTable::getList(array('select' => array('CURRENCY'), 'filter' => array('=CURRENCY' => $this->arParams['CURRENCY_ID']))); if ($currency = $currencyList->fetch()) { $this->convertCurrencyId = $currency['CURRENCY']; } } if (self::$iblockIncluded === null) { self::$iblockIncluded = Loader::includeModule('iblock'); } if (!self::$iblockIncluded) { return ''; } if (self::$catalogIncluded === null) { self::$catalogIncluded = Loader::includeModule('catalog'); } if (self::$catalogIncluded) { $arCatalog = CCatalogSKU::GetInfoByProductIBlock($this->IBLOCK_ID); if (!empty($arCatalog)) { $this->SKU_IBLOCK_ID = $arCatalog["IBLOCK_ID"]; $this->SKU_PROPERTY_ID = $arCatalog["SKU_PROPERTY_ID"]; } } $this->facet = new \Bitrix\Iblock\PropertyIndex\Facet($this->IBLOCK_ID); return parent::executeComponent(); }
/** * @param CBitrixComponent $parent * @return bool */ function _checkParent($parent) { if ('Y' == $parent->arParams['AJAX_MODE']) { return true; } elseif ($parentComponent = $parent->GetParent()) { return $this->_checkParent($parentComponent); } return false; }
function SaveMenu($path, $aMenuLinksTmp, $sMenuTemplateTmp) { global $APPLICATION; CMain::InitPathVars($site, $path); $DOC_ROOT = CSite::GetSiteDocRoot($site); $strMenuLinks = ""; if (strlen($sMenuTemplateTmp) > 0) { $strMenuLinks .= "\$sMenuTemplate = \"" . CFileMan::EscapePHPString($sMenuTemplateTmp) . "\";\n"; } $strMenuLinks .= "\$aMenuLinks = Array("; $i = 0; foreach ($aMenuLinksTmp as $arMenuItem) { $i++; $strMenuLinksTmp = ""; if ($i > 1) { $strMenuLinksTmp .= ","; } $strMenuLinksTmp .= "\n" . "\tArray(\n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[0]) . "\", \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[1]) . "\", \n" . "\t\tArray("; if (is_array($arMenuItem[2])) { for ($j = 0, $l = count($arMenuItem[2]); $j < $l; $j++) { if ($j > 0) { $strMenuLinksTmp .= ", "; } $strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arMenuItem[2][$j]) . "\""; } } $strMenuLinksTmp .= "), \n"; $strMenuLinksTmp .= "\t\tArray("; if (is_array($arMenuItem[3])) { $arParams = array_keys($arMenuItem[3]); for ($j = 0, $l = count($arParams); $j < $l; $j++) { if ($j > 0) { $strMenuLinksTmp .= ", "; } $strMenuLinksTmp .= "\"" . CFileMan::EscapePHPString($arParams[$j]) . "\"=>" . "\"" . CFileMan::EscapePHPString($arMenuItem[3][$arParams[$j]]) . "\""; } } $strMenuLinksTmp .= "), \n" . "\t\t\"" . CFileMan::EscapePHPString($arMenuItem[4]) . "\" \n" . "\t)"; $strMenuLinks .= $strMenuLinksTmp; } $strMenuLinks .= "\n);"; $APPLICATION->SaveFileContent($DOC_ROOT . $path, "<" . "?\n" . $strMenuLinks . "\n?" . ">"); $GLOBALS["CACHE_MANAGER"]->CleanDir("menu"); CBitrixComponent::clearComponentCache("bitrix:menu"); }
/** * Bitrix Framework * @package bitrix * @subpackage sale * @copyright 2001-2014 Bitrix */ use Bitrix\Main; use Bitrix\Main\DB; use Bitrix\Main\Config; use Bitrix\Main\Localization\Loc; use Bitrix\Sale\Location; use Bitrix\Main\Data; CBitrixComponent::includeComponentClass("bitrix:sale.location.selector.search"); Loc::loadMessages(__FILE__); class CBitrixLocationSelectorSystemComponent extends CBitrixLocationSelectorSearchComponent { const ID_BLOCK_LEN = 90; const HUGE_TAIL_LEN = 30; const PAGE_SIZE = 10; const LOCATION_ENTITY_NAME = '\Bitrix\Sale\Location\LocationTable'; protected $entityClass = false; protected $useGroups = true; protected $useCodes = false; protected $dbResult = array();
function IncludeComponent($componentName, $componentTemplate, $arParams = array(), $parentComponent = null, $arFunctionParams = array()) { /** @global CMain $APPLICATION */ global $APPLICATION, $USER; if (is_array($this->arComponentMatch)) { $skipComponent = true; foreach ($this->arComponentMatch as $cValue) { if (strpos($componentName, $cValue) !== false) { $skipComponent = false; break; } } if ($skipComponent) { return false; } } $componentRelativePath = CComponentEngine::MakeComponentPath($componentName); if (StrLen($componentRelativePath) <= 0) { return False; } if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) { $debug = new CDebugInfo(); $debug->Start(); } elseif ($APPLICATION->ShowIncludeStat) { $debug = new CDebugInfo(); $debug->Start(); } else { $debug = null; } if (is_object($parentComponent)) { if (!$parentComponent instanceof cbitrixcomponent) { $parentComponent = null; } } $bDrawIcons = (!isset($arFunctionParams["HIDE_ICONS"]) || $arFunctionParams["HIDE_ICONS"] != "Y") && $APPLICATION->GetShowIncludeAreas(); if ($bDrawIcons) { echo $this->IncludeStringBefore(); } $result = null; $bComponentEnabled = !isset($arFunctionParams["ACTIVE_COMPONENT"]) || $arFunctionParams["ACTIVE_COMPONENT"] != "N"; $component = new CBitrixComponent(); if ($component->InitComponent($componentName)) { $obAjax = null; if ($bComponentEnabled) { if ($arParams['AJAX_MODE'] == 'Y') { $obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent); } $result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent); } if ($bDrawIcons) { $panel = new CComponentPanel($component, $componentName, $componentTemplate, $parentComponent, $bComponentEnabled); $arIcons = $panel->GetIcons(); echo $s = $this->IncludeStringAfter($arIcons["icons"], $arIcons["parameters"]); } if ($bComponentEnabled && $obAjax) { $obAjax->Process(); } } if ($_SESSION["SESS_SHOW_INCLUDE_TIME_EXEC"] == "Y" && ($USER->CanDoOperation('edit_php') || $_SESSION["SHOW_SQL_STAT"] == "Y")) { echo $debug->Output($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]); } elseif (is_object($debug)) { $debug->Stop($componentName, "/bitrix/components" . $componentRelativePath . "/component.php", $arParams["CACHE_TYPE"] . $arParams["MENU_CACHE_TYPE"]); } return $result; }