Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
advtabengine.php
1
<?php
2
namespace
Bitrix\Seo
;
3
4
use
Bitrix\Main\Application
;
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Main\Context
;
7
use
Bitrix\Main\Loader
;
8
use
Bitrix\Main\Localization\Loc
;
9
use
Bitrix\Main\IO
;
10
use
Bitrix\Seo\Engine
;
11
12
Loc::loadMessages
(__FILE__);
13
22
class
AdvTabEngine
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(
94
Application::getDocumentRoot
(),
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
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getDocumentRoot
static getDocumentRoot()
Definition
application.php:717
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Context\getCurrent
static getCurrent()
Definition
context.php:241
Bitrix\Main\IO\File
Definition
file.php:7
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getDefaultLang
static getDefaultLang($lang)
Definition
loc.php:460
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Seo\AdvTabEngine
Definition
advtabengine.php:23
Bitrix\Seo\AdvTabEngine\getTabs
static getTabs($iblockElementInfo)
Definition
advtabengine.php:42
Bitrix\Seo\AdvTabEngine\showTab
static showTab($div, $iblockElementInfo)
Definition
advtabengine.php:83
Bitrix\Seo\AdvTabEngine\eventHandler
static eventHandler()
Definition
advtabengine.php:24
Bitrix\Seo\AdvTabEngine\checkFields
static checkFields()
Definition
advtabengine.php:128
Bitrix\Seo\AdvTabEngine\saveData
static saveData()
Definition
advtabengine.php:133
Bitrix\Main\Context
Definition
culture.php:9
Bitrix\Main\IO
Definition
directory.php:2
Bitrix\Seo\Engine
Definition
bitrix.php:9
Bitrix\Seo
modules
seo
lib
advtabengine.php
Создано системой
1.10.0