Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
conversionhandler.php
1<?php
2namespace Bitrix\Seo;
3
7
8Loc::loadMessages(__FILE__);
9
11{
12 public static function onSetDayContextAttributes(DayContext $context)
13 {
15 {
16 $context->setAttribute('seo_yandex_direct_source', static::getSeoId());
17 }
18 }
19
20 protected static function getSeoId()
21 {
22 $session = AdvSession::getSession();
23
24 return $session['BANNER_ID'] ?? null;
25 }
26
27 public static function onGetAttributeTypes()
28 {
29 return array(
30 'seo_yandex_direct_source' => array(
31 'MODULE' => 'seo',
32 'GROUP' => 'source',
33 'SORT' => 5200, // must be before conversion_search_engine!
34 'NAME' => Loc::getMessage('SEO_CONVERSION_ATTRIBUTE_YANDEX_DIRECT_NAME'),
35 'BG_COLOR' => '#4bbedb',
36 'GET_VALUES' => function (array $ids)
37 {
38 $dbRes = YandexBannerTable::getList(array(
39 'filter' => array("=XML_ID" => $ids),
40 'select' => array("XML_ID", "NAME"),
41 'order' => array('NAME' => 'ASC'),
42 ));
43
44 $bannerList = array();
45 while($banner = $dbRes->fetch())
46 {
47 $bannerList[$banner['XML_ID']] = array("NAME" => $banner["NAME"]);
48 }
49
50 return $bannerList;
51 },
52 'SPLIT_BY' => 'seo_yandex_direct_source',
53 ),
54 );
55 }
56}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static onSetDayContextAttributes(DayContext $context)