1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
include.php
См. документацию.
1<?php
2
4
6 "seo",
7 array(
8 'CSeoUtils' => 'classes/general/seo_utils.php',
9 'CSeoKeywords' => 'classes/general/seo_keywords.php',
10 'CSeoPageChecker' => 'classes/general/seo_page_checker.php'
11 )
12);
13
14require_once __DIR__.'/compatibility.php';
15
16if (!defined('SEO_COUNTERS_DEFAULT'))
17{
18 if (COption::GetOptionString('main', 'vendor', '') == '1c_bitrix')
19 {
20 define(
21 'SEO_COUNTERS_DEFAULT',
22 "<img src=\"http://yandex.ru/cycounter?#DOMAIN#\" width=\"88\" height=\"31\" border=\"0\" />"
23 );
24 }
25 else
26 {
27 define(
28 'SEO_COUNTERS_DEFAULT',
29 ''
30 );
31 }
32}
33
34IncludeModuleLangFile(__FILE__);
35
37{
38 public static function SeoOnPanelCreate()
39 {
40 global $APPLICATION, $USER;
41
42 if (!$USER->CanDoOperation('seo_tools'))
43 return false;
44
45 if (isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "")
46 {
47 $currentDirPath = dirname($_SERVER["REAL_FILE_PATH"]);
48 $currentFilePath = $_SERVER["REAL_FILE_PATH"];
49 }
50 else
51 {
52 $currentDirPath = $APPLICATION->GetCurDir();
53 $currentFilePath = $APPLICATION->GetCurPage(true);
54 }
55
56 $encCurrentDirPath = urlencode($currentDirPath);
57 $encCurrentFilePath = urlencode($currentFilePath);
58 $encRequestUri = urlencode($_SERVER["REQUEST_URI"]);
59
60 $encTitleChangerLink = '';
61 $encWinTitleChangerLink = '';
62 $encTitleChangerName = '';
63 $encWinTitleChangerName = '';
64 if (is_array($APPLICATION->sDocTitleChanger))
65 {
66 if (isset($APPLICATION->sDocTitleChanger['PUBLIC_EDIT_LINK']))
67 $encTitleChangerLink = urlencode(base64_encode($APPLICATION->sDocTitleChanger['PUBLIC_EDIT_LINK']));
68 if (isset($APPLICATION->sDocTitleChanger['COMPONENT_NAME']))
69 $encTitleChangerName = urlencode($APPLICATION->sDocTitleChanger['COMPONENT_NAME']);
70 }
71
72 $prop_code = mb_strtoupper(COption::GetOptionString('seo', 'property_window_title', 'title'));
73
74 if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]) && is_array($APPLICATION->arPagePropertiesChanger[$prop_code]))
75 {
76 if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]['PUBLIC_EDIT_LINK']))
77 $encWinTitleChangerLink = urlencode(base64_encode($APPLICATION->arPagePropertiesChanger[$prop_code]['PUBLIC_EDIT_LINK']));
78 if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]['COMPONENT_NAME']))
79 $encWinTitleChangerName = urlencode($APPLICATION->arPagePropertiesChanger[$prop_code]['COMPONENT_NAME']);
80 }
81
82 $encTitle = urlencode(base64_encode($APPLICATION->sDocTitle));
83 $encWinTitle = urlencode(base64_encode($APPLICATION->arPageProperties[$prop_code] ?? ''));
84
85 $APPLICATION->AddPanelButton(array(
86 "HREF"=> 'javascript:'.$APPLICATION->GetPopupLink(
87 array(
88 "URL"=>"/bitrix/admin/public_seo_tools.php?lang=".LANGUAGE_ID."&bxpublic=Y&from_module=seo&site=".SITE_ID
89 ."&path=".$encCurrentFilePath
90 ."&title_final=".$encTitle."&title_changer_name=".$encTitleChangerName.'&title_changer_link='.$encTitleChangerLink
91 ."&title_win_final=".$encWinTitle."&title_win_changer_name=".$encWinTitleChangerName.'&title_win_changer_link='.$encWinTitleChangerLink
93 ."&back_url=".$encRequestUri,
94 "PARAMS"=> Array("width"=>920, "height" => 400, 'resize' => false)
95 )),
96 "ID"=>"seo",
97 "ICON" => "bx-panel-seo-icon",
98 "ALT"=>GetMessage('SEO_ICON_ALT'),
99 "TEXT"=>GetMessage('SEO_ICON_TEXT'),
100 "MAIN_SORT"=>"300",
101 "SORT"=> 50,
102 "HINT" => array(
103 "TITLE" => GetMessage('SEO_ICON_TEXT'),
104 "TEXT" => GetMessage('SEO_ICON_HINT')
105 ),
106 ));
107 }
108
109 public static function OnIncludeHTMLEditorScript()
110 {
111 if (COption::GetOptionString('main', 'vendor', '') == '1c_bitrix' && defined('ADMIN_SECTION'))
112 {
113?>
114<script>
115;(function(){
116 var originalTextWnd = null;
117 var originalTextBtn = new BX.CWindowButton({
118 title: '<?=GetMessageJS('SEO_UNIQUE_TEXT_YANDEX_SUBMIT')?>',
119 className: 'adm-btn-save',
120 action: function()
121 {
122 var content = document.forms.seo_original_text_form.original_text.value;
123 var domain = document.forms.seo_original_text_form.domain.options[document.forms.seo_original_text_form.domain.selectedIndex].value;
124 if(content.length < <?=\Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MIN_LENGTH?>)
125 {
126 alert('<?=GetMessageJS('SEO_YANDEX_ORIGINAL_TEXT_TOO_SHORT', array('#NUM#' => \Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MIN_LENGTH))?>');
127 }
128 else if(content.length > <?=\Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MAX_LENGTH?>)
129 {
130 alert('<?=GetMessageJS('SEO_YANDEX_ORIGINAL_TEXT_TOO_LONG', array('#NUM#' => \Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MAX_LENGTH))?>');
131 }
132 else
133 {
134 originalTextBtn.disable();
135 BX.ajax({
136 method: 'POST',
137 dataType: 'json',
138 url: '/bitrix/tools/seo_yandex.php',
139 data: {
140 action: 'original_text',
141 domain: domain,
142 dir: '/',
143 original_text: content,
144 sessid: BX.bitrix_sessid()
145 },
146 onsuccess: function(res)
147 {
148 originalTextBtn.enable();
149 if(!!res.error)
150 {
151 alert(BX.util.strip_tags(res.error.message));
152 }
153 else
154 {
155 BX('seo_original_text_form_form').style.display = 'none';
156 BX('seo_original_text_form_ok').style.display = 'block';
157
158 originalTextBtn.btn.disabled = true;
159
160 originalTextWnd.adjustSizeEx();
161 BX.defer(originalTextWnd.adjustPos, originalTextWnd)();
162 }
163 }
164 });
165 }
166 }
167 });
168
169 var originalTextLoader = function(res)
170 {
171 BX.closeWait();
172 originalTextWnd = new BX.CDialog({
173 content: res,
174 resizable: false,
175 width: 750,
176 height: 550,
177 title: '<?=GetMessageJS('SEO_UNIQUE_TEXT_YANDEX')?>',
178 buttons: [
179 originalTextBtn
180 ]
181 });
182 originalTextHandler.apply(this, arguments);
183 };
184
185 var originalTextHandler = function()
186 {
187 if(!originalTextWnd)
188 {
189 BX.showWait();
190 BX.ajax.get('/bitrix/tools/seo_yandex.php?get=original_text_form&sessid=' + BX.bitrix_sessid(), BX.proxy(originalTextLoader, this));
191 }
192 else if(!!document.forms.seo_original_text_form)
193 {
194 this.pMainObj.SaveContent();
195
196 var content = BX.util.strip_tags(
197 this.pMainObj.GetContent()
198 .replace(/<\?(.|[\r\n])*?\?>/g, '')
199 .replace(/#PHP[^#]*#/ig, '')
200 );
201
202 originalTextWnd.Show();
203
204 document.forms.seo_original_text_form.original_text.value = content;
205 BX('seo_original_text_form_form').style.display = 'block';
206 BX('seo_original_text_form_ok').style.display = 'none';
207
208 originalTextWnd.adjustSizeEx();
209 originalTextBtn.enable();
210 originalTextBtn.btn.disabled = false;
211 BX.defer(originalTextWnd.adjustPos, originalTextWnd)();
212 }
213 else
214 {
215 originalTextWnd.Show();
216 originalTextBtn.btn.disabled = true;
217 }
218 };
219
220 var seoEditorButton = ['BXButton',
221 {
222 id : 'SeoUniqText',
223 src : '/bitrix/panel/seo/images/icon_editor_toolbar.png',
224 name : '<?=CUtil::JSEscape(GetMessage('SEO_UNIQUE_TEXT_YANDEX'))?>',
225 codeEditorMode : true,
226 handler : originalTextHandler
227 }];
228
229 if(typeof window.arToolbars != 'undefined' && !window.bSeoToolbarButtonAdded)
230 {
231 if(typeof window.arToolbars['manage'] != 'undefined')
232 {
233 window.arToolbars['manage'][1].push(seoEditorButton);
234 }
235 else
236 {
237 window.arToolbars['standart'][1].push(seoEditorButton);
238 }
239
240 window.bSeoToolbarButtonAdded = true;
241 }
242
243 if(typeof window.arGlobalToolbar != 'undefined' && !window.bSeoGlobalToolbarButtonAdded)
244 {
245 window.arGlobalToolbar.push(seoEditorButton);
246 window.bSeoGlobalToolbarButtonAdded = true;
247 }
248})();
249</script>
250<?
251 }
252 }
253
254 public static function OnBeforeHTMLEditorScriptRuns()
255 {
256 if (COption::GetOptionString('main', 'vendor', '') == '1c_bitrix' && defined('ADMIN_SECTION'))
257 {
258?>
259<script>
260 ;(function(){
261 var originalTextWnd = null;
262 var originalTextBtn = new BX.CWindowButton({
263 title: '<?=GetMessageJS('SEO_UNIQUE_TEXT_YANDEX_SUBMIT')?>',
264 className: 'adm-btn-save',
265 action: function()
266 {
267 var content = document.forms.seo_original_text_form.original_text.value;
268 var domain = document.forms.seo_original_text_form.domain.options[document.forms.seo_original_text_form.domain.selectedIndex].value;
269 if(content.length < <?=\Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MIN_LENGTH?>)
270 {
271 alert('<?=GetMessageJS('SEO_YANDEX_ORIGINAL_TEXT_TOO_SHORT', array('#NUM#' => \Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MIN_LENGTH))?>');
272 }
273 else if(content.length > <?=\Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MAX_LENGTH?>)
274 {
275 alert('<?=GetMessageJS('SEO_YANDEX_ORIGINAL_TEXT_TOO_LONG', array('#NUM#' => \Bitrix\Seo\Engine\Yandex::ORIGINAL_TEXT_MAX_LENGTH))?>');
276 }
277 else
278 {
279 originalTextBtn.disable();
280 BX.ajax({
281 method: 'POST',
282 dataType: 'json',
283 url: '/bitrix/tools/seo_yandex.php',
284 data: {
285 action: 'original_text',
286 domain: domain,
287 dir: '/',
288 original_text: content,
289 sessid: BX.bitrix_sessid()
290 },
291 onsuccess: function(res)
292 {
293 originalTextBtn.enable();
294 if(!!res.error)
295 {
296 alert(BX.util.strip_tags(res.error.message));
297 }
298 else
299 {
300 BX('seo_original_text_form_form').style.display = 'none';
301 BX('seo_original_text_form_ok').style.display = 'block';
302
303 originalTextBtn.btn.disabled = true;
304
305 originalTextWnd.adjustSizeEx();
306 BX.defer(originalTextWnd.adjustPos, originalTextWnd)();
307 }
308 }
309 });
310 }
311 }
312 });
313
314 var originalTextHandler = function(editor)
315 {
316 if(!originalTextWnd)
317 {
318 BX.showWait();
319 BX.ajax.get(
320 '/bitrix/tools/seo_yandex.php?get=original_text_form&sessid=' + BX.bitrix_sessid(),
321 BX.delegate(function(res)
322 {
323 BX.closeWait();
324 originalTextWnd = new BX.CDialog({
325 content: res,
326 resizable: false,
327 width: 750,
328 height: 550,
329 title: '<?=GetMessageJS('SEO_UNIQUE_TEXT_YANDEX')?>',
330 buttons: [
331 originalTextBtn
332 ]
333 });
334 originalTextHandler.apply(this, [editor]);
335 }, this)
336 );
337 }
338 else if(!!document.forms.seo_original_text_form)
339 {
340 var content = BX.util.strip_tags(
341 editor.GetContent()
342 .replace(/<\?(.|[\r\n])*?\?>/g, '')
343 .replace(/#PHP[^#]*#/ig, '')
344 );
345
346 originalTextWnd.Show();
347
348 document.forms.seo_original_text_form.original_text.value = content;
349 BX('seo_original_text_form_form').style.display = 'block';
350 BX('seo_original_text_form_ok').style.display = 'none';
351
352 originalTextWnd.adjustSizeEx();
353 originalTextBtn.enable();
354 originalTextBtn.btn.disabled = false;
355 BX.defer(originalTextWnd.adjustPos, originalTextWnd)();
356 }
357 else
358 {
359 originalTextWnd.Show();
360 originalTextBtn.btn.disabled = true;
361 }
362 };
363
364 function applyForEditor(editor)
365 {
366 editor.AddButton(
367 {
368 id : 'SeoUniqText',
369 src : '/bitrix/panel/seo/images/icon_editor_toolbar_2.png',
370 name : '<?=CUtil::JSEscape(GetMessage('SEO_UNIQUE_TEXT_YANDEX'))?>',
371 codeEditorMode : true,
372 handler : function(){originalTextHandler(editor);},
373 toolbarSort: 305
374 }
375 );
376 }
377
378 if (window.BXHtmlEditor && window.BXHtmlEditor.editors)
379 {
380 for (var id in window.BXHtmlEditor.editors)
381 {
382 if (window.BXHtmlEditor.editors.hasOwnProperty(id))
383 {
384 applyForEditor(window.BXHtmlEditor.Get(id))
385 }
386 }
387 }
388
389 BX.addCustomEvent("OnEditorInitedBefore", applyForEditor);
390 })();
391</script>
392 <?
393 }
394 }
395}
global $APPLICATION
Определения include.php:80
static registerAutoLoadClasses($moduleName, array $classes)
Определения loader.php:273
Определения include.php:37
static OnIncludeHTMLEditorScript()
Определения include.php:109
static OnBeforeHTMLEditorScriptRuns()
Определения include.php:254
static SeoOnPanelCreate()
Определения include.php:38
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $MESS
Определения bill.php:2
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $DB
Определения cron_frame.php:29
global $USER
Определения csv_new_run.php:40
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
bitrix_sessid_get($varname='sessid')
Определения tools.php:4695
<? endif;?> window document title
Определения prolog_main_admin.php:76
global $APPLICATION
Определения include.php:3
const SITE_ID
Определения sonet_set_content_view.php:12