'classes/general/seo_utils.php', 'CSeoKeywords' => 'classes/general/seo_keywords.php', 'CSeoPageChecker' => 'classes/general/seo_page_checker.php' ) ); require_once __DIR__.'/compatibility.php'; if (!defined('SEO_COUNTERS_DEFAULT')) { if (COption::GetOptionString('main', 'vendor', '') == '1c_bitrix') { define( 'SEO_COUNTERS_DEFAULT', "" ); } else { define( 'SEO_COUNTERS_DEFAULT', '' ); } } IncludeModuleLangFile(__FILE__); class CSeoEventHandlers { public static function SeoOnPanelCreate() { global $APPLICATION, $USER; if (!$USER->CanDoOperation('seo_tools')) return false; if (isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "") { $currentDirPath = dirname($_SERVER["REAL_FILE_PATH"]); $currentFilePath = $_SERVER["REAL_FILE_PATH"]; } else { $currentDirPath = $APPLICATION->GetCurDir(); $currentFilePath = $APPLICATION->GetCurPage(true); } $encCurrentDirPath = urlencode($currentDirPath); $encCurrentFilePath = urlencode($currentFilePath); $encRequestUri = urlencode($_SERVER["REQUEST_URI"]); $encTitleChangerLink = ''; $encWinTitleChangerLink = ''; $encTitleChangerName = ''; $encWinTitleChangerName = ''; if (is_array($APPLICATION->sDocTitleChanger)) { if (isset($APPLICATION->sDocTitleChanger['PUBLIC_EDIT_LINK'])) $encTitleChangerLink = urlencode(base64_encode($APPLICATION->sDocTitleChanger['PUBLIC_EDIT_LINK'])); if (isset($APPLICATION->sDocTitleChanger['COMPONENT_NAME'])) $encTitleChangerName = urlencode($APPLICATION->sDocTitleChanger['COMPONENT_NAME']); } $prop_code = mb_strtoupper(COption::GetOptionString('seo', 'property_window_title', 'title')); if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]) && is_array($APPLICATION->arPagePropertiesChanger[$prop_code])) { if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]['PUBLIC_EDIT_LINK'])) $encWinTitleChangerLink = urlencode(base64_encode($APPLICATION->arPagePropertiesChanger[$prop_code]['PUBLIC_EDIT_LINK'])); if (isset($APPLICATION->arPagePropertiesChanger[$prop_code]['COMPONENT_NAME'])) $encWinTitleChangerName = urlencode($APPLICATION->arPagePropertiesChanger[$prop_code]['COMPONENT_NAME']); } $encTitle = urlencode(base64_encode($APPLICATION->sDocTitle)); $encWinTitle = urlencode(base64_encode($APPLICATION->arPageProperties[$prop_code] ?? '')); $APPLICATION->AddPanelButton(array( "HREF"=> 'javascript:'.$APPLICATION->GetPopupLink( array( "URL"=>"/bitrix/admin/public_seo_tools.php?lang=".LANGUAGE_ID."&bxpublic=Y&from_module=seo&site=".SITE_ID ."&path=".$encCurrentFilePath ."&title_final=".$encTitle."&title_changer_name=".$encTitleChangerName.'&title_changer_link='.$encTitleChangerLink ."&title_win_final=".$encWinTitle."&title_win_changer_name=".$encWinTitleChangerName.'&title_win_changer_link='.$encWinTitleChangerLink ."&".bitrix_sessid_get() ."&back_url=".$encRequestUri, "PARAMS"=> Array("width"=>920, "height" => 400, 'resize' => false) )), "ID"=>"seo", "ICON" => "bx-panel-seo-icon", "ALT"=>GetMessage('SEO_ICON_ALT'), "TEXT"=>GetMessage('SEO_ICON_TEXT'), "MAIN_SORT"=>"300", "SORT"=> 50, "HINT" => array( "TITLE" => GetMessage('SEO_ICON_TEXT'), "TEXT" => GetMessage('SEO_ICON_HINT') ), )); } public static function OnIncludeHTMLEditorScript() { if (COption::GetOptionString('main', 'vendor', '') == '1c_bitrix' && defined('ADMIN_SECTION')) { ?>