Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
advtabengine.php
1<?php
2namespace Bitrix\Seo;
3
11
12Loc::loadMessages(__FILE__);
13
23{
24 public static function eventHandler()
25 {
26 if(
27 Option::get('main', 'vendor', '') == '1c_bitrix'
28 && Loc::getDefaultLang(LANGUAGE_ID) == 'ru'
29 && IsModuleInstalled('socialservices')
30 )
31 {
32 return array(
33 "TABSET" => "seo_adv",
34 "Check" => array(__CLASS__, 'checkFields'),
35 "Action" => array(__CLASS__, 'saveData'),
36 "GetTabs" => array(__CLASS__, 'getTabs'),
37 "ShowTab" => array(__CLASS__, 'showTab'),
38 );
39 }
40 }
41
42 public static function getTabs($iblockElementInfo)
43 {
44 $showTab = false;
45
46 $request = Context::getCurrent()->getRequest();
47
48 if($iblockElementInfo["ID"] > 0 && (!isset($request['action']) || $request['action'] != 'copy'))
49 {
50 $showTab = true;
51 if(Loader::includeModule('catalog'))
52 {
53/*
54 $dbRes = CatalogIblockTable::getList(array(
55 'filter' => array(
56 '=IBLOCK_ID' => $iblockElementInfo["IBLOCK"]["ID"],
57 '!PRODUCT_IBLOCK_ID' => 0
58 ),
59 'select' => array('IBLOCK_ID'),
60 ));
61 if($dbRes->fetch())
62 {
63 $showTab = false;
64 }
65*/
66 if(\CCatalogSku::getInfoByOfferIBlock($iblockElementInfo["IBLOCK"]["ID"]) !== false)
67 {
68 $showTab = false;
69 }
70 }
71 }
72
73 return $showTab ? array(
74 array(
75 "DIV" => "seo_adv",
76 "SORT" => 4,
77 "TAB" => Loc::getMessage("SEO_ADV_TAB"),
78 "TITLE" => Loc::getMessage("SEO_ADV_TAB_TITLE"),
79 ),
80 ) : null;
81 }
82
83 public static function showTab($div,$iblockElementInfo)
84 {
85 $engineList = array();
86
87 if(Option::get('main', 'vendor', '') == '1c_bitrix')
88 {
89 $engineList[] = array(
90 "DIV" => "yandex_direct",
91 "TAB" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT"),
92 "TITLE" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT_TITLE"),
93 "HANDLER" => IO\Path::combine(
95 BX_ROOT,
96 "/modules/seo/admin/tab/seo_search_yandex_direct.php"
97 ),
98 );
99 }
100
101 if(count($engineList) > 0)
102 {
103 $engineTabControl = new \CAdminViewTabControl("engineTabControl", $engineList);
104?>
105<tr>
106 <td colspan="2">
107<?php
108 $engineTabControl->begin();
109 foreach($engineList as $engineTab)
110 {
111 $engineTabControl->beginNextTab();
112
113 $file = new IO\File($engineTab["HANDLER"]);
114 if($file->isExists())
115 {
116 require($file->getPath());
117 }
118 }
119
120 $engineTabControl->end();
121?>
122 </td>
123</tr>
124<?php
125 }
126 }
127
128 public static function checkFields()
129 {
130 return true;
131 }
132
133 public static function saveData()
134 {
135 return true;
136 }
137}
static getCurrent()
Definition context.php:241
static loadMessages($file)
Definition loc.php:64
static getDefaultLang($lang)
Definition loc.php:460
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getTabs($iblockElementInfo)
static showTab($div, $iblockElementInfo)