3namespace Bitrix\Catalog\v2\Integration\UI\EntitySelector;
6use Bitrix\UI\EntitySelector\BaseProvider;
7use Bitrix\UI\EntitySelector\Dialog;
8use Bitrix\UI\EntitySelector\Item;
9use Bitrix\UI\EntitySelector\SearchQuery;
10use Bitrix\Iblock\PropertyTable;
11use Bitrix\Highloadblock as HL;
15 private const BRAND_LIMIT = 20;
16 private const BRAND_ENTITY_ID =
'brand';
17 private const BRAND_CODE =
'BRAND_FOR_FACEBOOK';
21 parent::__construct();
23 $this->options[
'iblockId'] = (int)(
$options[
'iblockId'] ?? 0);
28 return $GLOBALS[
'USER']->isAuthorized();
35 $filter = !empty($ids) ? [
'=UF_XML_ID' => $ids] : [];
62 $recentItemsCount =
count($dialog->
getRecentItems()->getEntityItems(self::BRAND_ENTITY_ID));
64 if ($recentItemsCount < self::BRAND_LIMIT)
100 if (!Loader::includeModule(
'highloadblock') || !Loader::includeModule(
'iblock'))
107 $catalogId = $this->options[
'iblockId'];
113 $propertySettings = PropertyTable::getList([
114 'select' => [
'ID',
'USER_TYPE_SETTINGS'],
116 '=IBLOCK_ID' => $catalogId,
118 '=CODE' => self::BRAND_CODE,
125 if (!$propertySettings)
130 $propertySettings[
'USER_TYPE_SETTINGS'] = (
132 ? unserialize($propertySettings[
'USER_TYPE_SETTINGS'], [
'allowed_classes' =>
false])
136 if (empty($userTypeSettings[
'TABLE_NAME']))
141 $table = HL\HighloadBlockTable::getList([
142 'select' => [
'TABLE_NAME',
'NAME',
'ID'],
143 'filter' => [
'=TABLE_NAME' => $userTypeSettings[
'TABLE_NAME']],
148 $brandEntity = HL\HighloadBlockTable::compileEntity(
$table);
149 $brandEntityClass = $brandEntity->getDataClass();
152 'select' => [
'UF_XML_ID',
'UF_FILE',
'UF_NAME'],
157 $parameters[
'filter'] =
$filter;
161 $brandsRaw = $brandEntityClass::getList($parameters);
162 while ($brand = $brandsRaw->fetch())
164 if (!empty($brand[
'UF_FILE']))
166 $brand[
'LOGO'] = \CFile::resizeImageGet(
186 'id' => $brand[
'UF_XML_ID'],
187 'entityId' => self::BRAND_ENTITY_ID,
188 'title' => $brand[
'UF_NAME'],
189 'avatar' => $brand[
'LOGO'],
static createFacebookBrandProperty()
__construct(array $options=[])
getBrands(array $filter=[])
fillDialog(Dialog $dialog)
getSelectedItems(array $ids)
doSearch(SearchQuery $searchQuery, Dialog $dialog)
loadPreselectedItems($preselectedMode=true)
addRecentItem(Item $item)
setCacheable(bool $flag=true)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
const BX_RESIZE_IMAGE_EXACT
CheckSerializedData($str, $max_depth=200)
$GLOBALS['____1690880296']
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"