commit
83e6da4b79
@ -0,0 +1,74 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"Условия доставки", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Условия возврата", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Способы оплаты", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Как оформить заказ", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Центр поддержки", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Гарантия", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Сертификаты", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Награды", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Отзывы", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Партнеры", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,32 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"Договора", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Реквизиты", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Политика конфиденциальности", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Пользовательское соглашение", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,113 @@ |
|||||||
|
# GP | SEO |
||||||
|
!robots.txt |
||||||
|
yandex_*.html |
||||||
|
yandex_turbo.xml |
||||||
|
turbo_yandex.xml |
||||||
|
google*.html |
||||||
|
sitemap*.xml |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# GP | Bitrix |
||||||
|
upload/ |
||||||
|
urlrewrite.php |
||||||
|
.htaccess |
||||||
|
.htaccess.restore |
||||||
|
.access.php |
||||||
|
bitrix/* |
||||||
|
bitrix/php_interface/dbconn.php |
||||||
|
/bitrix/.settings.php |
||||||
|
!bitriex/modules/main/include/prolog.php # вирус пишет сюда |
||||||
|
!bitrix/license_key.php |
||||||
|
!bitrix/urlrewrite.php |
||||||
|
!bitrix/bitrix.php |
||||||
|
!bitrix/templates/ |
||||||
|
!bitrix/components/ |
||||||
|
!bitrix/pagen.php |
||||||
|
!bitrix/index.php |
||||||
|
!bitrix/header.php |
||||||
|
!bitrix/footer.php |
||||||
|
!bitrix/php_interface/ |
||||||
|
!bitrix/local/ |
||||||
|
!bitrix/themes/ |
||||||
|
!bitrix/php_interface/init.php |
||||||
|
bitrix/templates/landing24/ |
||||||
|
bitrix/templates/learning/ |
||||||
|
bitrix/components/bitrix/ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# GP | Files ext |
||||||
|
*.sql |
||||||
|
*.sql.gz |
||||||
|
*.tgz |
||||||
|
*.tar.gz |
||||||
|
*.tar.* |
||||||
|
*.gz.* |
||||||
|
*.tar |
||||||
|
*.rar |
||||||
|
*.zip |
||||||
|
*.mp3 |
||||||
|
*.mp4 |
||||||
|
*.webm |
||||||
|
*.mov |
||||||
|
*.MOV |
||||||
|
*.wav |
||||||
|
*.flv |
||||||
|
*.db |
||||||
|
*.psd |
||||||
|
*.pdf |
||||||
|
*.doc |
||||||
|
*.docx |
||||||
|
*.txt |
||||||
|
*.text |
||||||
|
*.log |
||||||
|
*.config |
||||||
|
*.xml |
||||||
|
*.tbk |
||||||
|
*.csv |
||||||
|
*.json |
||||||
|
*.xls |
||||||
|
*.xlsx |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# GP | Dirs & files |
||||||
|
bower_components/ |
||||||
|
node_modules/ |
||||||
|
nbproject/ |
||||||
|
cache/ |
||||||
|
.cache/ |
||||||
|
phpMyAdmin-* |
||||||
|
timthumb_cache/ |
||||||
|
webstat/ |
||||||
|
.idea/ |
||||||
|
.csscomb.json |
||||||
|
.htaccess |
||||||
|
sitemap*.xml |
||||||
|
sftp-config.json |
||||||
|
robots.txt* |
||||||
|
robots-*.txt |
||||||
|
bower.json |
||||||
|
.bowerrc |
||||||
|
backup_rsync/ |
||||||
|
.bash_history |
||||||
|
.idea/ |
||||||
|
.fleet/ |
||||||
|
.DS_Store |
||||||
|
.config/ |
||||||
|
.bash* |
||||||
|
.vim* |
||||||
|
test/ |
||||||
|
test*.php |
||||||
|
gp-test*/ |
||||||
|
gp-test*.php |
||||||
|
_* |
||||||
|
.*_lock |
||||||
|
|
||||||
|
|
||||||
|
# Node-js скрипт для индексации 100 url в сутки |
||||||
|
.google-indexing/ |
@ -0,0 +1,18 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"Блог про септики", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Портфолио проектов", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,7 @@ |
|||||||
|
<?php |
||||||
|
$sSectionName = "Главная страница"; |
||||||
|
$arDirProperties = [ |
||||||
|
'description' => 'Мы предлагаем широкий ассортимент качественной одежды по адекватным ценам.', |
||||||
|
'keywords' => 'женская одежда, мужская одежда, спортивная одежда, тапочки', |
||||||
|
'robots' => 'index, follow', |
||||||
|
]; |
@ -0,0 +1,74 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"Монтаж септиков", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Монтаж ЛОС", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Монтаж автономных канализаций", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Сервисное обслуживание септиков", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Сервисное обслуживание ЛОС", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Обслуживание автономных канализаций", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Чистка септиков", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Откачка септиков", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Консервация септиков", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Консервация ЛОС", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,74 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"О компании", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Контакты", |
||||||
|
"/contacts/", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Цены", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Акции", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Доставка", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Портфолио", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Полезная информация", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Услуги", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Покупателям", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Блог", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,74 @@ |
|||||||
|
<? |
||||||
|
$aMenuLinks = Array( |
||||||
|
Array( |
||||||
|
"ГОСТы по септикам", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Глоссарий терминов", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Принцип работы жиро-улолвителей", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Кессон принцип работы", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Принцип работы септиков Эра", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Септик ЭРА-КНС", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Септик ЭРА-ПЦ", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Септик ЭРА-ГВ", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Материалы", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
), |
||||||
|
Array( |
||||||
|
"Технология", |
||||||
|
"#", |
||||||
|
Array(), |
||||||
|
Array(), |
||||||
|
"" |
||||||
|
) |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,77 @@ |
|||||||
|
<?php |
||||||
|
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php'); |
||||||
|
|
||||||
|
CHTTP::SetStatus("404 Not Found"); |
||||||
|
@define("ERROR_404","Y"); |
||||||
|
const HIDE_SIDEBAR = true; |
||||||
|
|
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); |
||||||
|
|
||||||
|
/** @global CMain $APPLICATION */ |
||||||
|
|
||||||
|
$APPLICATION->SetTitle("Страница не найдена");?> |
||||||
|
|
||||||
|
<div class="bx-404-container"> |
||||||
|
<div class="bx-404-block"><img src="<?=SITE_DIR?>images/404.png" alt=""></div>
|
||||||
|
<div class="bx-404-text-block">Неправильно набран адрес, <br>или такой страницы на сайте больше не существует.</div> |
||||||
|
<div class="">Вернитесь на <a href="<?=SITE_DIR?>">главную</a> или воспользуйтесь картой сайта.</div>
|
||||||
|
</div> |
||||||
|
<div class="map-columns row"> |
||||||
|
<div class="col-sm-10 col-sm-offset-1"> |
||||||
|
<div class="bx-maps-title">Карта сайта:</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="col-sm-offset-2 col-sm-4"> |
||||||
|
<div class="bx-map-title"><i class="fa fa-leanpub"></i> Каталог</div> |
||||||
|
<?php |
||||||
|
$APPLICATION->IncludeComponent( |
||||||
|
"bitrix:catalog.section.list", |
||||||
|
"tree", |
||||||
|
array( |
||||||
|
"COMPONENT_TEMPLATE" => "tree", |
||||||
|
"IBLOCK_TYPE" => "catalog", |
||||||
|
"IBLOCK_ID" => "2", |
||||||
|
"SECTION_ID" => $_REQUEST["SECTION_ID"], |
||||||
|
"SECTION_CODE" => "", |
||||||
|
"COUNT_ELEMENTS" => "Y", |
||||||
|
"TOP_DEPTH" => "2", |
||||||
|
"SECTION_FIELDS" => array( |
||||||
|
0 => "", |
||||||
|
1 => "", |
||||||
|
), |
||||||
|
"SECTION_USER_FIELDS" => array( |
||||||
|
0 => "", |
||||||
|
1 => "", |
||||||
|
), |
||||||
|
"SECTION_URL" => "", |
||||||
|
"CACHE_TYPE" => "A", |
||||||
|
"CACHE_TIME" => "36000000", |
||||||
|
"CACHE_GROUPS" => "Y", |
||||||
|
"ADD_SECTIONS_CHAIN" => "Y" |
||||||
|
), |
||||||
|
false |
||||||
|
); |
||||||
|
?> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="col-sm-offset-1 col-sm-4"> |
||||||
|
<div class="bx-map-title"><i class="fa fa-info-circle"></i> О магазине</div> |
||||||
|
<?php |
||||||
|
$APPLICATION->IncludeComponent( |
||||||
|
"bitrix:main.map", |
||||||
|
".default", |
||||||
|
array( |
||||||
|
"CACHE_TYPE" => "A", |
||||||
|
"CACHE_TIME" => "36000000", |
||||||
|
"SET_TITLE" => "N", |
||||||
|
"LEVEL" => "3", |
||||||
|
"COL_NUM" => "2", |
||||||
|
"SHOW_DESCRIPTION" => "Y", |
||||||
|
"COMPONENT_TEMPLATE" => ".default" |
||||||
|
), |
||||||
|
false |
||||||
|
);?> |
||||||
|
</div> |
||||||
|
<?php |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php"); |
@ -0,0 +1,42 @@ |
|||||||
|
#!/usr/bin/php |
||||||
|
<?php |
||||||
|
|
||||||
|
if (php_sapi_name() == "cli") |
||||||
|
{ |
||||||
|
$pwdFilePath = bx_cli_absolute_path(getcwd() . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME']); |
||||||
|
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(dirname($pwdFilePath))); |
||||||
|
|
||||||
|
require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/cli/bitrix.php'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Works as realpath(), but ignores symlinks |
||||||
|
* |
||||||
|
* @param $path |
||||||
|
* |
||||||
|
* @return string |
||||||
|
*/ |
||||||
|
function bx_cli_absolute_path($path) |
||||||
|
{ |
||||||
|
$path = str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path); |
||||||
|
$parts = explode(DIRECTORY_SEPARATOR, $path); |
||||||
|
$validParts = []; |
||||||
|
|
||||||
|
foreach ($parts as $part) |
||||||
|
{ |
||||||
|
if ($part == '.') |
||||||
|
{ |
||||||
|
continue; |
||||||
|
} |
||||||
|
elseif ($part == '..') |
||||||
|
{ |
||||||
|
array_pop($validParts); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$validParts[] = $part; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return join(DIRECTORY_SEPARATOR, $validParts); |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
$arComponentDescription = array( |
||||||
|
"NAME" => GetMessage("SM_NAME"), |
||||||
|
"DESCRIPTION" => GetMessage("SM_DESCRIPTION"), |
||||||
|
"ICON" => "/images/icon.png", |
||||||
|
"PATH" => array( |
||||||
|
"ID" => GetMessage("MAIN_GROUP_NAME_SOTBIT"), |
||||||
|
"CHILD" => array( |
||||||
|
"ID" => "sotbit.seo.meta", |
||||||
|
"NAME" => GetMessage("MAIN_MENU_NAME_SOTBIT") |
||||||
|
) |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,197 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
|
||||||
|
// Main params |
||||||
|
$arIBlockType = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList(array( |
||||||
|
"sort" => "asc", |
||||||
|
), array( |
||||||
|
"TYPE" => $arCurrentValues["IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
)); |
||||||
|
while ($arr = $rsIBlock->Fetch()) |
||||||
|
$arIBlock[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"]; |
||||||
|
|
||||||
|
$arPropList = []; |
||||||
|
if(intval($arCurrentValues['IBLOCK_ID']) > 0) { |
||||||
|
$rsProps = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arCurrentValues['IBLOCK_ID'] |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
while ($arProp = $rsProps->Fetch()) { |
||||||
|
$arPropList[$arProp['ID']] = '[' . $arProp['ID'] . '] ' . $arProp['NAME']; |
||||||
|
} |
||||||
|
|
||||||
|
if(CModule::IncludeModule('catalog')) { |
||||||
|
$offerBlock = CCatalog::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arCurrentValues['IBLOCK_ID'] |
||||||
|
), |
||||||
|
false, |
||||||
|
false, |
||||||
|
array('OFFERS_IBLOCK_ID') |
||||||
|
)->fetch(); |
||||||
|
|
||||||
|
if($offerBlock) { |
||||||
|
$rsSku = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $offerBlock['OFFERS_IBLOCK_ID'] |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
while ($prop = $rsSku->fetch()) { |
||||||
|
$arPropList[$prop['ID']] = '[' . $prop['ID'] . '] ' . $prop['NAME']; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// Brands params |
||||||
|
$arIBlockTypeBrands = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList( |
||||||
|
array( |
||||||
|
"sort" => "asc", |
||||||
|
), |
||||||
|
array( |
||||||
|
"TYPE" => $arCurrentValues["BRAND_IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
) |
||||||
|
); |
||||||
|
while ($arr = $rsIBlock->Fetch()) { |
||||||
|
$arIBlockBrands[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"]; |
||||||
|
} |
||||||
|
|
||||||
|
if(intval($arCurrentValues['BRAND_IBLOCK_ID']) > 0) { |
||||||
|
$rsBrands = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arCurrentValues['BRAND_IBLOCK_ID'] |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
while ($arBrand = $rsBrands->Fetch()) { |
||||||
|
$arBrandsList[$arBrand['ID']] = $arBrand['NAME']; |
||||||
|
} |
||||||
|
|
||||||
|
if(CModule::IncludeModule('catalog')) { |
||||||
|
$offerBlock = CCatalog::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arCurrentValues['BRAND_IBLOCK_ID'] |
||||||
|
), |
||||||
|
false, |
||||||
|
false, |
||||||
|
array('OFFERS_IBLOCK_ID') |
||||||
|
)->fetch(); |
||||||
|
|
||||||
|
if($offerBlock) { |
||||||
|
$rsBrands = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $offerBlock['OFFERS_IBLOCK_ID'] |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
while ($arBrand = $rsBrands->Fetch()) { |
||||||
|
$arBrandsList[$arBrand['ID']] = $arBrand['NAME']; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$arComponentParameters = array( |
||||||
|
"GROUPS" => array( |
||||||
|
'BRAND_PARAMETERS' => array( |
||||||
|
'NAME' => GetMessage('SM_BRAND_PARAMS_NAME'), |
||||||
|
'SORT' => 150 |
||||||
|
) |
||||||
|
), |
||||||
|
"PARAMETERS" => array( |
||||||
|
'TAB_NAME' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage('SM_TAB_PROPERTY_NAME'), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => GetMessage('SM_TAB_PROPERTY_NAME_DEFAULT'), |
||||||
|
), |
||||||
|
"IBLOCK_TYPE" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_TYPE"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arIBlockType, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"IBLOCK_ID" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_IBLOCK"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arIBlock, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"EXCLUDE_PROPERTY_LIST" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_EXCLUDE_PROPERTY_LIST"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"MULTIPLE" => "Y", |
||||||
|
"SIZE" => 10, |
||||||
|
"VALUES" => $arPropList, |
||||||
|
), |
||||||
|
"SHOW_BRAND_TAB" => array( |
||||||
|
"PARENT" => "BRAND_PARAMETERS", |
||||||
|
"NAME" => GetMessage("SM_SHOW_BRAND_TAB"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "N", |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"CACHE_TIME" => array( |
||||||
|
"DEFAULT" => 36000000, |
||||||
|
), |
||||||
|
"CACHE_GROUPS" => array( |
||||||
|
"PARENT" => "CACHE_SETTINGS", |
||||||
|
"NAME" => GetMessage("SM_CACHE_GROUPS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "Y", |
||||||
|
), |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
if($arCurrentValues['SHOW_BRAND_TAB'] == 'Y') { |
||||||
|
$arBrandProps = array( |
||||||
|
'BRAND_TAB_NAME' => array( |
||||||
|
"PARENT" => "BRAND_PARAMETERS", |
||||||
|
"NAME" => GetMessage('SM_BRAND_TAB_NAME'), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => GetMessage('SM_BRAND_TAB_NAME_DEFAULT'), |
||||||
|
), |
||||||
|
"BRAND_IBLOCK_TYPE" => array( |
||||||
|
"PARENT" => "BRAND_PARAMETERS", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_TYPE"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arIBlockTypeBrands, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"BRAND_IBLOCK_ID" => array( |
||||||
|
"PARENT" => "BRAND_PARAMETERS", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_IBLOCK"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arIBlockBrands, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"BRANDS_LIST" => array( |
||||||
|
"PARENT" => "BRAND_PARAMETERS", |
||||||
|
"NAME" => GetMessage("SM_EXCLUDE_PROPERTY_LIST"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arBrandsList, |
||||||
|
), |
||||||
|
); |
||||||
|
|
||||||
|
$arComponentParameters['PARAMETERS'] = array_merge($arComponentParameters['PARAMETERS'], $arBrandProps); |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,228 @@ |
|||||||
|
<? |
||||||
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
|
||||||
|
use Bitrix\Main\Loader; |
||||||
|
use Sotbit\Seometa\Orm\SeometaUrlTable; |
||||||
|
use Sotbit\Seometa\Orm\ChpuTagsTable; |
||||||
|
use Bitrix\Main\Text\Encoding; |
||||||
|
use Bitrix\Main\Context; |
||||||
|
|
||||||
|
if(!Loader::includeModule('sotbit.seometa') || !Loader::includeModule('iblock')) |
||||||
|
{ |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
global $sotbitFilterResult; |
||||||
|
global $SeoMetaWorkingConditions; |
||||||
|
|
||||||
|
if(!$arParams['CACHE_TIME']) |
||||||
|
{ |
||||||
|
$arParams['CACHE_TIME'] = '36000000'; |
||||||
|
} |
||||||
|
|
||||||
|
$currentPage = $APPLICATION->getCurPage(); |
||||||
|
|
||||||
|
if($arParams['EXCLUDE_PROPERTY_LIST']) { |
||||||
|
$arParams['EXCLUDE_PROPERTY_LIST'] = array_merge($arParams['EXCLUDE_PROPERTY_LIST'], |
||||||
|
[$arParams['BRANDS_LIST']]); |
||||||
|
} else { |
||||||
|
$arParams['EXCLUDE_PROPERTY_LIST'] = []; |
||||||
|
} |
||||||
|
|
||||||
|
$cacheTime = $arParams['CACHE_TIME']; |
||||||
|
$cache_id = serialize(array($arParams, $currentPage, ($arParams['CACHE_GROUPS'] === 'N' ? false : $USER->GetGroups()))); |
||||||
|
$cacheDir = '/sotbit.seometa.bottom-menu/'; |
||||||
|
$cache = \Bitrix\Main\Application::getInstance()->getManagedCache(); |
||||||
|
$arrProperties = array(); |
||||||
|
|
||||||
|
if($cache->read($cacheTime, $cache_id, $cacheDir)) |
||||||
|
{ |
||||||
|
$items = $cache->get($cache_id); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
if($arParams['KOMBOX_FILTER'] == 'Y' && CModule::IncludeModule('kombox.filter')) |
||||||
|
{ |
||||||
|
$str = CKomboxFilter::GetCurPageParam(); |
||||||
|
$str = explode("?", $str); |
||||||
|
$str = $str[0]; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$str = $APPLICATION->GetCurPage(); |
||||||
|
} |
||||||
|
|
||||||
|
$str = CSeoMeta::encodeRealUrl($str); |
||||||
|
$metaData = SeometaUrlTable::getByRealUrl($str, SITE_ID); |
||||||
|
|
||||||
|
if (!$metaData) { |
||||||
|
$requestGet = Context::getCurrent()->getRequest()->getQueryList()->toArray(); |
||||||
|
$pageParams = array_keys($requestGet); |
||||||
|
$str = $APPLICATION->GetCurPageParam( |
||||||
|
'', |
||||||
|
$pageParams |
||||||
|
); |
||||||
|
$str = CSeoMeta::encodeRealUrl($str); |
||||||
|
$metaData = SeometaUrlTable::getByRealUrl($str, SITE_ID); |
||||||
|
} |
||||||
|
|
||||||
|
if(!$metaData) { |
||||||
|
$metaData = SeometaUrlTable::getByNewUrl($str, SITE_ID); |
||||||
|
} |
||||||
|
|
||||||
|
if($metaData['ID']) { |
||||||
|
$arrProperties = ChpuTagsTable::getByChpuID($metaData['ID']); |
||||||
|
|
||||||
|
if($arrProperties['TAG_OVERRIDE_TYPE'] == 'Y') { |
||||||
|
$arrIDs = array_diff($arrProperties['TAG_DATA'], $arParams['EXCLUDE_PROPERTY_LIST']); |
||||||
|
|
||||||
|
$conditionId = $metaData['CONDITION_ID']; |
||||||
|
$sectionId = $metaData['section_id']; |
||||||
|
|
||||||
|
$smartFilter = new \Sotbit\Seometa\Filter\SmartFilter($conditionId); |
||||||
|
$rule = new Sotbit\Seometa\Condition\Rule(); |
||||||
|
$condition = $rule->parse($smartFilter->getCondition()); |
||||||
|
|
||||||
|
$generator = Sotbit\Seometa\Generator\GeneratorFactory::create($smartFilter->getCondition()->FILTER_TYPE); |
||||||
|
|
||||||
|
$catalogUrl = new Sotbit\Seometa\Url\CatalogUrl($smartFilter->getCondition()); |
||||||
|
// $catalogUrl->cleanTemplate(true); |
||||||
|
$catalogUrl->setSectionPlaceholdersIfNeed($sectionId); |
||||||
|
|
||||||
|
$propertySet = new Sotbit\Seometa\Property\PropertySet(); |
||||||
|
$propertySetEntity = new Sotbit\Seometa\Property\PropertySetEntity($condition->getData()[0]->getData()[0]->getData()); |
||||||
|
$propertySet->add($propertySetEntity); |
||||||
|
|
||||||
|
$catalogUrl->replaceFromSet($propertySet, $generator); |
||||||
|
$catalogUrl->getMask(); |
||||||
|
|
||||||
|
foreach ($arrIDs as $key => $arrID) { |
||||||
|
if($sotbitFilterResult['ITEMS'][$arrID]['VALUES']) { |
||||||
|
foreach ($sotbitFilterResult['ITEMS'][$arrID]['VALUES'] as $value) { |
||||||
|
if(!$link = SeometaUrlTable::getByRealUrl($value['section_filter_link'], SITE_ID)) { |
||||||
|
$link = SeometaUrlTable::getByNewUrl($value['section_filter_link'], SITE_ID); |
||||||
|
} |
||||||
|
|
||||||
|
if($link) { |
||||||
|
$item['NAME'] = $value['VALUE']; |
||||||
|
$item['URL'] = $link['REAL_URL']; |
||||||
|
$items['BOTTOM_MENU_PROPERTIES']['SECTION'][$key]['LINKS'][] = $item; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($items['BOTTOM_MENU_PROPERTIES']['SECTION'][$key]['LINKS']) { |
||||||
|
$items['BOTTOM_MENU_PROPERTIES']['SECTION'][$key]['NAME'] = $sotbitFilterResult['ITEMS'][$arrID]['NAME']; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} else if($arrProperties['TAG_OVERRIDE_TYPE'] == 'M' && $arrProperties['TAG_DATA']['SECTION']) { |
||||||
|
$items['BOTTOM_MENU_PROPERTIES'] = $arrProperties['TAG_DATA']; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($arrProperties['TAG_OVERRIDE_TYPE'] != 'Y' && $arrProperties['TAG_OVERRIDE_TYPE'] != 'M') { |
||||||
|
$arLinksInSection = SeometaUrlTable::getList([ |
||||||
|
'filter' => [ |
||||||
|
'ACTIVE' => 'Y', |
||||||
|
'section_id' => $sotbitFilterResult['SECTION_ID'] |
||||||
|
], |
||||||
|
'select' => [ |
||||||
|
'NEW_URL', |
||||||
|
'SITE_ID', |
||||||
|
'iblock_id', |
||||||
|
'PROPERTIES' |
||||||
|
] |
||||||
|
]); |
||||||
|
|
||||||
|
|
||||||
|
$section = ''; |
||||||
|
while ($linkSection = $arLinksInSection->fetch()) { |
||||||
|
$siteID = unserialize($linkSection['SITE_ID']); |
||||||
|
if ($siteID && in_array(SITE_ID, |
||||||
|
$siteID)) { |
||||||
|
$properties = unserialize($linkSection['PROPERTIES']); |
||||||
|
|
||||||
|
foreach ($properties as $key => $arrVal) { |
||||||
|
foreach ($arrVal as $val) { |
||||||
|
$arrChpuProps[$key][$val] = $linkSection['NEW_URL']; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($arrChpuProps) { |
||||||
|
foreach ($arrChpuProps as $propCODE => $prop) { |
||||||
|
$iblockProperty = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arParams['IBLOCK_ID'], |
||||||
|
'CODE' => $propCODE |
||||||
|
) |
||||||
|
)->fetch(); |
||||||
|
|
||||||
|
if (!$iblockProperty['ID'] && Loader::includeModule('catalog')) { |
||||||
|
$skuIblockId = CCatalog::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $arParams['IBLOCK_ID'], |
||||||
|
'CODE' => $propCODE |
||||||
|
), |
||||||
|
false, |
||||||
|
false, |
||||||
|
array('OFFERS_IBLOCK_ID') |
||||||
|
)->fetch(); |
||||||
|
|
||||||
|
if ($skuIblockId) { |
||||||
|
$iblockProperty = CIBlockProperty::GetList( |
||||||
|
array(), |
||||||
|
array( |
||||||
|
'IBLOCK_ID' => $skuIblockId['OFFERS_IBLOCK_ID'], |
||||||
|
'CODE' => $propCODE |
||||||
|
) |
||||||
|
)->fetch(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ( |
||||||
|
$iblockProperty['ID'] && |
||||||
|
$sotbitFilterResult['ITEMS'][$iblockProperty['ID']] && |
||||||
|
!in_array($iblockProperty['ID'], |
||||||
|
$arParams['EXCLUDE_PROPERTY_LIST']) |
||||||
|
) { |
||||||
|
foreach ($prop as $propKey => $pr) { |
||||||
|
foreach ($sotbitFilterResult['ITEMS'][$iblockProperty['ID']]['VALUES'] as $VALUE) { |
||||||
|
if ($VALUE['UPPER'] == mb_strtoupper($propKey)) { |
||||||
|
$link['NAME'] = $propKey; |
||||||
|
$link['URL'] = $pr; |
||||||
|
|
||||||
|
$items['BOTTOM_MENU_PROPERTIES']['SECTION'][$propCODE]['LINKS'][] = $link; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (count($items['BOTTOM_MENU_PROPERTIES']['SECTION'][$propCODE]['LINKS']) > 0) { |
||||||
|
$items['BOTTOM_MENU_PROPERTIES']['SECTION'][$propCODE]['NAME'] = $sotbitFilterResult['ITEMS'][$iblockProperty['ID']]['NAME']; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($arParams['BRANDS_LIST'] && $sotbitFilterResult['ITEMS'][$arParams['BRANDS_LIST']]) { |
||||||
|
$items['BRANDS_LIST'] = []; |
||||||
|
foreach ($sotbitFilterResult['ITEMS'][$arParams['BRANDS_LIST']]['VALUES'] as $brandListItem) { |
||||||
|
if($brandListItem['section_filter_link']) { |
||||||
|
$brandItem['NAME'] = $brandListItem['VALUE']; |
||||||
|
$brandItem['URL'] = $brandListItem['section_filter_link']; |
||||||
|
$items['BRANDS_LIST'][] = $brandItem; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$cache->set($cache_id, $items); |
||||||
|
} |
||||||
|
|
||||||
|
$arResult = $items; |
||||||
|
|
||||||
|
$this->IncludeComponentTemplate(); |
||||||
|
?> |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_NAME"] = "Нижнее меню"; |
||||||
|
$MESS["MAIN_MENU_NAME_SOTBIT"] = "SEO умного фильтра"; |
||||||
|
$MESS["MAIN_GROUP_NAME_SOTBIT"] = "Сотбит"; |
||||||
|
$MESS["SM_DESCRIPTION"] = "Выводит нижнее меню с двумя табами (свойства, бренды)"; |
||||||
|
?> |
@ -0,0 +1,27 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_IBLOCK_TYPE"] = "Тип инфоблока"; |
||||||
|
$MESS["SM_IBLOCK_IBLOCK"] = "Инфоблок"; |
||||||
|
$MESS["SM_SECTION_ID"] = "Раздел"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS"] = "Показывать элементы подразделов раздела"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ALL"] = "всех подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ACTIVE"] = "активных подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_NO"] = "не показывать"; |
||||||
|
$MESS["SM_CACHE_GROUPS"] = "Учитывать права доступа"; |
||||||
|
$MESS["CACHE_TYPE"] = "Тип кеширования"; |
||||||
|
$MESS["CACHE_TIME"] = "Время кеширования (сек.)"; |
||||||
|
$MESS["SM_SORT"] = "Тип сортировки тегов"; |
||||||
|
$MESS["SM_SORT_NAME"] = "По названию"; |
||||||
|
$MESS["SM_SORT_CONDITION"] = "По индексу сортировки условий"; |
||||||
|
$MESS["SM_SORT_RANDOM"] = "Случайно"; |
||||||
|
$MESS["SM_SORT_ORDER"] = "Порядок сортировки"; |
||||||
|
$MESS["SM_SORT_ORDER_ASC"] = "По возрастанию"; |
||||||
|
$MESS["SM_SORT_ORDER_DESC"] = "По убыванию"; |
||||||
|
$MESS["SM_CNT_TAGS"] = "Количество выводимых тегов"; |
||||||
|
$MESS["SM_BRAND_PARAMS_NAME"] = "Параметры берндов"; |
||||||
|
$MESS["SM_TAB_PROPERTY_NAME"] = "Название вкладки свойств"; |
||||||
|
$MESS["SM_TAB_PROPERTY_NAME_DEFAULT"] = "Свойства"; |
||||||
|
$MESS["SM_BRAND_TAB_NAME"] = "Название вкладки брендов"; |
||||||
|
$MESS["SM_BRAND_TAB_NAME_DEFAULT"] = "Бренды"; |
||||||
|
$MESS["SM_SHOW_BRAND_TAB"] = "Отображать бренды"; |
||||||
|
$MESS["SM_EXCLUDE_PROPERTY_LIST"] = "Запретить вывод выбранных свойств"; |
||||||
|
?> |
@ -0,0 +1,25 @@ |
|||||||
|
window.addEventListener('DOMContentLoaded', () => { |
||||||
|
const tabButtons = document.querySelectorAll('.seometa-menu__button'); |
||||||
|
const contentAreas = document.querySelectorAll('.seometa-menu__content'); |
||||||
|
|
||||||
|
for (let i = 0; i < tabButtons.length; i++) { |
||||||
|
tabButtons[i].addEventListener('click', () => { |
||||||
|
|
||||||
|
tabButtons.forEach( |
||||||
|
button => { |
||||||
|
button.classList.remove('seometa-menu__button_active'); |
||||||
|
} |
||||||
|
); |
||||||
|
|
||||||
|
tabButtons[i].classList.add('seometa-menu__button_active'); |
||||||
|
|
||||||
|
contentAreas.forEach( |
||||||
|
area => { |
||||||
|
area.style.display = 'none'; |
||||||
|
} |
||||||
|
); |
||||||
|
|
||||||
|
contentAreas[i].style.display = 'flex'; |
||||||
|
}) |
||||||
|
} |
||||||
|
}); |
@ -0,0 +1,39 @@ |
|||||||
|
.seometa-menu__buttons-wrapper { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; |
||||||
|
-ms-flex-wrap: wrap; |
||||||
|
flex-wrap: wrap; |
||||||
|
margin: 0 -5px 10px; } |
||||||
|
|
||||||
|
.seometa-menu__button { |
||||||
|
font-weight: bold; |
||||||
|
margin: 0 5px; |
||||||
|
cursor: pointer; |
||||||
|
-webkit-transition: all 0.2s ease; |
||||||
|
transition: all 0.2s ease; } |
||||||
|
.seometa-menu__button:hover { |
||||||
|
color: var(--main-color); } |
||||||
|
.seometa-menu__button_active { |
||||||
|
color: var(--main-color); } |
||||||
|
|
||||||
|
.seometa-menu__content { |
||||||
|
display: none; |
||||||
|
padding: 10px; |
||||||
|
flex-wrap: wrap; |
||||||
|
border: 1px solid #ededed; } |
||||||
|
|
||||||
|
.seometa-menu__section { |
||||||
|
display: inline-block; |
||||||
|
width: 25%; |
||||||
|
min-width: 200px; |
||||||
|
padding: 10px; } |
||||||
|
|
||||||
|
.seometa-menu__link { |
||||||
|
display: block; |
||||||
|
margin-left: 10px; } |
||||||
|
|
||||||
|
.seometa-menu__name { |
||||||
|
display: block; |
||||||
|
margin-bottom: 5px; } |
@ -0,0 +1 @@ |
|||||||
|
.seometa-menu__buttons-wrapper{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -5px 10px}.seometa-menu__button{font-weight:700;margin:0 5px;cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease}.seometa-menu__button:hover,.seometa-menu__button_active{color:var(--main-color)}.seometa-menu__content{display:none;flex-wrap:wrap;padding:10px;border:1px solid #ededed}.seometa-menu__section{display:inline-block;width:25%;min-width:200px;padding:10px}.seometa-menu__link{display:block;margin-left:10px}.seometa-menu__name{display:block;margin-bottom:5px} |
@ -0,0 +1,44 @@ |
|||||||
|
.seometa-menu__buttons-wrapper { |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
margin: 0 -5px 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-menu__button { |
||||||
|
font-weight: bold; |
||||||
|
margin: 0 5px; |
||||||
|
cursor: pointer; |
||||||
|
transition: all 0.2s ease; |
||||||
|
|
||||||
|
&:hover { |
||||||
|
color: var(--main-color); |
||||||
|
} |
||||||
|
|
||||||
|
&_active { |
||||||
|
color: var(--main-color); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-menu__content { |
||||||
|
display: none; |
||||||
|
flex-wrap: wrap; |
||||||
|
padding: 10px; |
||||||
|
border: 1px solid #ededed; |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-menu__section { |
||||||
|
display: inline-block; |
||||||
|
width: 25%; |
||||||
|
min-width: 200px; |
||||||
|
padding: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-menu__link { |
||||||
|
display: block; |
||||||
|
margin-left: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-menu__name { |
||||||
|
display: block; |
||||||
|
margin-bottom: 5px; |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
|
||||||
|
if ( |
||||||
|
(is_array($arResult['BOTTOM_MENU_PROPERTIES']) && count($arResult['BOTTOM_MENU_PROPERTIES']) > 0) || |
||||||
|
($arParams['SHOW_BRAND_TAB'] == 'Y' && is_array($arResult['BRANDS_LIST']) && count($arResult['BRANDS_LIST']) > 0) |
||||||
|
) { ?> |
||||||
|
<div class="seometa-menu"> |
||||||
|
<div class="seometa-menu__buttons-wrapper"> |
||||||
|
<?if(is_array($arResult['BOTTOM_MENU_PROPERTIES']) && count($arResult['BOTTOM_MENU_PROPERTIES']) > 0):?> |
||||||
|
<div class="seometa-menu__button seometa-menu__button_active"><?=$arParams['TAB_NAME']?></div>
|
||||||
|
<?endif;?> |
||||||
|
<?if($arParams['SHOW_BRAND_TAB'] == 'Y' && $arResult['BRANDS_LIST']):?> |
||||||
|
<div class="seometa-menu__button"><?=$arParams['BRAND_TAB_NAME']?></div>
|
||||||
|
<?endif;?> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?if(is_array($arResult['BOTTOM_MENU_PROPERTIES']) && count($arResult['BOTTOM_MENU_PROPERTIES']) > 0) {?> |
||||||
|
<div class="seometa-menu__content" style="display: flex"> |
||||||
|
<? foreach ($arResult['BOTTOM_MENU_PROPERTIES']['SECTION'] as $BOTTOM_MENU_PROPERTIES) { ?> |
||||||
|
<div class="seometa-menu__section"> |
||||||
|
<span class="seometa-menu__name"> |
||||||
|
<? echo $BOTTOM_MENU_PROPERTIES['NAME']; ?> |
||||||
|
</span> |
||||||
|
<? foreach ($BOTTOM_MENU_PROPERTIES['LINKS'] as $LINK) { ?> |
||||||
|
<a class="seometa-menu__link" href="<?php echo $LINK['URL']; ?>">
|
||||||
|
<? echo $LINK['NAME']; ?> |
||||||
|
</a> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
<?}?> |
||||||
|
|
||||||
|
<?if($arParams['SHOW_BRAND_TAB'] == 'Y' && count($arResult['BRANDS_LIST']) > 0):?> |
||||||
|
<div class="seometa-menu__content" |
||||||
|
<?=!is_array($arResult['BOTTOM_MENU_PROPERTIES']) && count($arResult['BOTTOM_MENU_PROPERTIES']) == 0 ? 'style="display: flex"' : '' ?> |
||||||
|
> |
||||||
|
<div class="seometa-menu__section"> |
||||||
|
<? foreach ($arResult['BRANDS_LIST'] as $brand) { ?> |
||||||
|
<a class="seometa-menu__link" href="<?php echo $brand['URL']; ?>">
|
||||||
|
<? echo $brand['NAME']; ?> |
||||||
|
</a> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<?endif;?> |
||||||
|
</div> |
||||||
|
<? } ?> |
||||||
|
|
@ -0,0 +1,14 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
$arComponentDescription = array( |
||||||
|
"NAME" => GetMessage("SM_NAME"), |
||||||
|
"DESCRIPTION" => GetMessage("SM_DESCRIPTION"), |
||||||
|
"ICON" => "/images/icon.png", |
||||||
|
"PATH" => array( |
||||||
|
"ID" => GetMessage("MAIN_GROUP_NAME_SOTBIT"), |
||||||
|
"CHILD" => array( |
||||||
|
"ID" => "sotbit.seo.meta", |
||||||
|
"NAME" => GetMessage("MAIN_MENU_NAME_SOTBIT"), |
||||||
|
) |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,88 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
$arIBlockType = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList(array( |
||||||
|
"sort" => "asc", |
||||||
|
), array( |
||||||
|
"TYPE" => $arCurrentValues["IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
)); |
||||||
|
while ($arr = $rsIBlock->Fetch()) |
||||||
|
$arIBlock[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"]; |
||||||
|
|
||||||
|
$result =\Bitrix\Iblock\SectionTable::getList(array( |
||||||
|
'select' => array('ID','NAME'), |
||||||
|
'filter' => array('IBLOCK_ID' => $arCurrentValues['IBLOCK_ID']) |
||||||
|
)); |
||||||
|
while ($Section = $result->fetch()) |
||||||
|
{ |
||||||
|
$arSections[$Section["ID"]] = "[".$Section["ID"]."] ".$Section["NAME"]; |
||||||
|
} |
||||||
|
|
||||||
|
$arComponentParameters = array( |
||||||
|
"GROUPS" => array(), |
||||||
|
"PARAMETERS" => array( |
||||||
|
"IBLOCK_TYPE" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_TYPE"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arIBlockType, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"IBLOCK_ID" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_IBLOCK"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arIBlock, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"SECTION_ID" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_SECTION_ID"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arSections, |
||||||
|
), |
||||||
|
"INCLUDE_SUBSECTIONS" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_INCLUDE_SUBSECTIONS'), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => array( |
||||||
|
"Y" => GetMessage('SM_INCLUDE_SUBSECTIONS_ALL'), |
||||||
|
"A" => GetMessage('SM_INCLUDE_SUBSECTIONS_ACTIVE'), |
||||||
|
"N" => GetMessage('SM_INCLUDE_SUBSECTIONS_NO'), |
||||||
|
), |
||||||
|
"DEFAULT" => "Y", |
||||||
|
), |
||||||
|
'SORT' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array('NAME'=>GetMessage("SM_SORT_NAME"),'CONDITIONS'=>GetMessage("SM_SORT_CONDITION"),'RANDOM'=>GetMessage("SM_SORT_RANDOM")), |
||||||
|
), |
||||||
|
'SORT_ORDER' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT_ORDER'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array('asc'=>GetMessage("SM_SORT_ORDER_ASC"),'desc'=>GetMessage("SM_SORT_ORDER_DESC")), |
||||||
|
), |
||||||
|
'CNT_TAGS' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_CNT_TAGS"), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => '', |
||||||
|
), |
||||||
|
"CACHE_TIME" => array( |
||||||
|
"DEFAULT" => 36000000, |
||||||
|
), |
||||||
|
"CACHE_GROUPS" => array( |
||||||
|
"PARENT" => "CACHE_SETTINGS", |
||||||
|
"NAME" => GetMessage("SM_CACHE_GROUPS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "Y", |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,221 @@ |
|||||||
|
<? |
||||||
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
|
||||||
|
use Sotbit\Seometa\Orm\ConditionTable; |
||||||
|
use Sotbit\Seometa\Orm\SeometaUrlTable; |
||||||
|
use Sotbit\Seometa\Orm\ChpuLinksTable; |
||||||
|
use Sotbit\Seometa\SeoMetaMorphy; |
||||||
|
use Bitrix\Main\Loader; |
||||||
|
use Sotbit\Seometa\Tags; |
||||||
|
use Bitrix\Iblock\Template\Engine; |
||||||
|
use Bitrix\Iblock\Template\Entity\Section; |
||||||
|
|
||||||
|
if(!Loader::includeModule('sotbit.seometa') || !Loader::includeModule('iblock')) |
||||||
|
{ |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
global $APPLICATION; |
||||||
|
global $SeoMetaWorkingConditions; |
||||||
|
|
||||||
|
if(!$arParams['CACHE_TIME']) |
||||||
|
{ |
||||||
|
$arParams['CACHE_TIME'] = '36000000'; |
||||||
|
} |
||||||
|
if(!$arParams['SORT']) |
||||||
|
{ |
||||||
|
$arParams['SORT'] = 'NAME'; |
||||||
|
} |
||||||
|
$curPage = $APPLICATION->GetCurPage(false); |
||||||
|
$cacheTime = $arParams['CACHE_TIME']; |
||||||
|
$cache_id = md5(serialize(array($curPage, $arParams, $SeoMetaWorkingConditions, ($arParams['CACHE_GROUPS'] === 'N' ? false : $USER->GetGroups())))); |
||||||
|
$cacheDir = '/sotbit.seometa.custom.tags/'; |
||||||
|
$cache = \Bitrix\Main\Application::getInstance()->getManagedCache(); |
||||||
|
$Tags = array(); |
||||||
|
|
||||||
|
if($cache->read($cacheTime, $cache_id, $cacheDir)) |
||||||
|
{ |
||||||
|
$Tags = $cache->get($cache_id); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$strict_relinking = false; |
||||||
|
$Conditions = array(); |
||||||
|
$sections = Tags::findNeedSections($arParams['SECTION_ID'], $arParams['INCLUDE_SUBSECTIONS']); // list of all sections |
||||||
|
$SectionConditions = ConditionTable::GetConditionsBySections($sections); // list of all |
||||||
|
// conditions by sections |
||||||
|
|
||||||
|
// if condition is active |
||||||
|
if($SeoMetaWorkingConditions) |
||||||
|
{ |
||||||
|
foreach($SeoMetaWorkingConditions as $SeoMetaWorkingCondition) |
||||||
|
{ |
||||||
|
$wasSections = false; |
||||||
|
if($SectionConditions[$SeoMetaWorkingCondition]) // if among all conditions by sections there is one that is active |
||||||
|
{ |
||||||
|
if($SectionConditions[$SeoMetaWorkingCondition]['STRICT_RELINKING'] == 'Y') |
||||||
|
{ |
||||||
|
$strict_relinking = true; |
||||||
|
} |
||||||
|
|
||||||
|
if(sizeof($SectionConditions[$SeoMetaWorkingCondition]['SECTIONS']) > 0) |
||||||
|
{ |
||||||
|
$wasSections = true; |
||||||
|
} |
||||||
|
|
||||||
|
//unset($SectionConditions[$SeoMetaWorkingCondition]['SECTIONS'][array_search($arParams['SECTION_ID'], $SectionConditions[$SeoMetaWorkingCondition]['SECTIONS'])]); |
||||||
|
|
||||||
|
if(sizeof($SectionConditions[$SeoMetaWorkingCondition]['SECTIONS']) == 0 && $wasSections) |
||||||
|
{ |
||||||
|
unset($SectionConditions[$SeoMetaWorkingCondition]); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$WorkingConditions = ConditionTable::GetConditionsFromWorkingConditions($SeoMetaWorkingConditions); // conditions selected in relinking |
||||||
|
|
||||||
|
if(is_array($SectionConditions) && is_array($WorkingConditions)) |
||||||
|
{ |
||||||
|
if(!$strict_relinking) |
||||||
|
{ |
||||||
|
$Conditions = $SectionConditions; |
||||||
|
} |
||||||
|
|
||||||
|
// merge conditions selected in relinking with other |
||||||
|
foreach($WorkingConditions as $key => $WorkingCondition) |
||||||
|
{ |
||||||
|
$Conditions[$key] = $WorkingCondition; |
||||||
|
} |
||||||
|
} |
||||||
|
elseif(is_array($SectionConditions)) |
||||||
|
{ |
||||||
|
$Conditions = $SectionConditions; |
||||||
|
} |
||||||
|
elseif(is_array($WorkingConditions)) |
||||||
|
{ |
||||||
|
$Conditions = $WorkingConditions; |
||||||
|
} |
||||||
|
|
||||||
|
$TagsObject = new Tags(); |
||||||
|
|
||||||
|
$Tags = SeometaUrlTable::getAllByCondition($SeoMetaWorkingConditions); |
||||||
|
|
||||||
|
$morphyObject = SeoMetaMorphy::morphyLibInit(); |
||||||
|
$arrIDTags = []; |
||||||
|
foreach ($Tags as &$tag) { |
||||||
|
if ($curPage == $tag['NEW_URL'] && SITE_ID == $tag['SITE_ID']) { |
||||||
|
$res = ChpuLinksTable::getList([ |
||||||
|
'select' => array('*'), |
||||||
|
'filter' => array( |
||||||
|
'MAIN_CHPU_ID' => $tag['ID'] |
||||||
|
) |
||||||
|
]); |
||||||
|
|
||||||
|
while ($item = $res->fetch()) { |
||||||
|
if (is_array($tmp = unserialize($item['SEOMETA_DATA_CHPU_LINK']))) { |
||||||
|
$item = array_merge($item, $tmp); |
||||||
|
if(!$Tags[$item['LINK_CHPU_ID']]) { |
||||||
|
$arrIDTags[] = $item['LINK_CHPU_ID']; |
||||||
|
} |
||||||
|
$Tags[$item['LINK_CHPU_ID']]['SEOMETA_DATA_CHPU_LINK'] = $item; |
||||||
|
} |
||||||
|
} |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($arrIDTags) { |
||||||
|
$arrExternalTags = SeometaUrlTable::getByArrId($arrIDTags); |
||||||
|
|
||||||
|
foreach ($arrExternalTags as $index => $arrExternalTag) { |
||||||
|
$Tags[$index] = array_merge($arrExternalTag, $Tags[$index]); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
foreach ($Tags as $key => &$item) { |
||||||
|
if($item['SEOMETA_DATA_CHPU_LINK']['NAME_CHPU_LINK_REPLACE'] == 'Y') { |
||||||
|
$item['TITLE'] = $item['SEOMETA_DATA_CHPU_LINK']['NAME_CHPU_LINK']; |
||||||
|
} else { |
||||||
|
$item['TITLE'] = $item['NAME']; |
||||||
|
} |
||||||
|
|
||||||
|
if(!empty($item['SEOMETA_DATA_CHPU_LINK']['IMAGE'])) { |
||||||
|
$item['IMAGE'] = $item['SEOMETA_DATA_CHPU_LINK']['IMAGE']; |
||||||
|
} |
||||||
|
|
||||||
|
if(intval($item['IMAGE']) > 0) |
||||||
|
{ |
||||||
|
$fileArray = CFile::GetFileArray($item['IMAGE']); |
||||||
|
$item['IMAGE'] = array(); |
||||||
|
$item['IMAGE']['SRC'] = $fileArray['SRC']; |
||||||
|
$item['IMAGE']['DESCRIPTION'] = $fileArray['DESCRIPTION']; |
||||||
|
} |
||||||
|
|
||||||
|
if(!$item['SEOMETA_DATA_CHPU_LINK'] && empty($item['IMAGE'])) { |
||||||
|
unset($Tags[$key]); |
||||||
|
continue; |
||||||
|
} |
||||||
|
|
||||||
|
$item['PROPERTIES'] = unserialize($item['PROPERTIES']); |
||||||
|
\CSeoMetaTagsProperty::$params = $item['PROPERTIES']; |
||||||
|
$sku = new Section($item['section_id']); |
||||||
|
$title = Engine::process($sku, SeoMetaMorphy::prepareForMorphy($item['TITLE'])); |
||||||
|
if(!empty($title)) { |
||||||
|
$title = SeoMetaMorphy::convertMorphy($title, $morphyObject); |
||||||
|
$item['TITLE'] = $title; |
||||||
|
} |
||||||
|
|
||||||
|
unset($item['SEOMETA_DATA_CHPU_LINK']); |
||||||
|
$item['URL'] = $item['NEW_URL']; |
||||||
|
if(!$item['URL']){ |
||||||
|
unset($Tags[$key]); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($strict_relinking) |
||||||
|
{ |
||||||
|
foreach ($Tags as $key => $tagsArray) { |
||||||
|
if($tagsArray['URL'] == $curPage) { |
||||||
|
unset($Tags[$key]); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$samePage = array_search($curPage, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'URL'))); |
||||||
|
if($samePage === false){ |
||||||
|
$samePage = array_search($curPage, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'REAL_URL'))); |
||||||
|
} |
||||||
|
|
||||||
|
if ($samePage !== false) { |
||||||
|
unset($Tags[$samePage]); |
||||||
|
} |
||||||
|
|
||||||
|
$Tags = $TagsObject->SortTags($Tags, $arParams['SORT'], $arParams['SORT_ORDER']); |
||||||
|
$Tags = $TagsObject->CutTags($Tags, $arParams['CNT_TAGS']); |
||||||
|
|
||||||
|
unset($Conditions); |
||||||
|
if($Tags) { |
||||||
|
$cache->set($cache_id ,$Tags); |
||||||
|
} else { |
||||||
|
$cache->clean($cache_id); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($arParams['AJAX'] === 'Y') { |
||||||
|
$arResult['ITEMS'] = array_map(function($arrVal) { |
||||||
|
$arrVal['URL'] = $arrVal['URL'] . '?ajaxTag=1'; |
||||||
|
return $arrVal; |
||||||
|
}, $Tags); |
||||||
|
} else { |
||||||
|
$arResult['ITEMS'] = $Tags; |
||||||
|
} |
||||||
|
|
||||||
|
unset($Tags); |
||||||
|
|
||||||
|
$this->IncludeComponentTemplate(); |
||||||
|
?> |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_NAME"] = "Настраиваемое облако тегов"; |
||||||
|
$MESS["MAIN_MENU_NAME_SOTBIT"] = "SEO умного фильтра"; |
||||||
|
$MESS["MAIN_GROUP_NAME_SOTBIT"] = "Сотбит"; |
||||||
|
$MESS["SM_DESCRIPTION"] = "Выводит теги для раздела каталога"; |
||||||
|
?> |
@ -0,0 +1,20 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_IBLOCK_TYPE"] = "Тип инфоблока"; |
||||||
|
$MESS["SM_IBLOCK_IBLOCK"] = "Инфоблок"; |
||||||
|
$MESS["SM_SECTION_ID"] = "Раздел"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS"] = "Показывать элементы подразделов раздела"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ALL"] = "всех подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ACTIVE"] = "активных подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_NO"] = "не показывать"; |
||||||
|
$MESS["SM_CACHE_GROUPS"] = "Учитывать права доступа"; |
||||||
|
$MESS["CACHE_TYPE"] = "Тип кеширования"; |
||||||
|
$MESS["CACHE_TIME"] = "Время кеширования (сек.)"; |
||||||
|
$MESS["SM_SORT"] = "Тип сортировки тегов"; |
||||||
|
$MESS["SM_SORT_NAME"] = "По названию"; |
||||||
|
$MESS["SM_SORT_CONDITION"] = "По индексу сортировки условий"; |
||||||
|
$MESS["SM_SORT_RANDOM"] = "Случайно"; |
||||||
|
$MESS["SM_SORT_ORDER"] = "Порядок сортировки"; |
||||||
|
$MESS["SM_SORT_ORDER_ASC"] = "По возрастанию"; |
||||||
|
$MESS["SM_SORT_ORDER_DESC"] = "По убыванию"; |
||||||
|
$MESS["SM_CNT_TAGS"] = "Количество выводимых тегов"; |
||||||
|
?> |
@ -0,0 +1,5 @@ |
|||||||
|
<? |
||||||
|
$MESS["OFTEN_SEARCH"] = "Популярные теги:"; |
||||||
|
$MESS["POPULAR_HIDE"] = "Свернуть"; |
||||||
|
$MESS["POPULAR_SHOW"] = "Все теги"; |
||||||
|
?> |
@ -0,0 +1,105 @@ |
|||||||
|
window.addEventListener("DOMContentLoaded", function () { |
||||||
|
if (document.querySelector(".sotbit-seometa-tags__hide")) { |
||||||
|
let hideTagsBtns = document.querySelector(".sotbit-seometa-tags__hide"); |
||||||
|
|
||||||
|
hideTagsBtns.addEventListener("click", function () { |
||||||
|
replaceClass(); |
||||||
|
}); |
||||||
|
|
||||||
|
hideSeoMetaTags(); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
window.addEventListener("resize", function () { |
||||||
|
if (document.querySelector(".sotbit-seometa-tags__hide")) { |
||||||
|
collapseTags(); |
||||||
|
hideSeoMetaTags(); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
function hideSeoMetaTags() { |
||||||
|
if (document.querySelector(".sotbit-seometa-tags-column")) { |
||||||
|
let seoMetaBlock = document.querySelector(".sotbit-seometa-tags-column"), |
||||||
|
hideTagsBtns = seoMetaBlock.querySelector(".sotbit-seometa-tags__hide"), |
||||||
|
tagsSection = seoMetaBlock.querySelector(".tags_section"), |
||||||
|
windowWidth = window.innerWidth || document.documentElement.clientWidth, |
||||||
|
tagsWrapper = seoMetaBlock.querySelector(".tags_wrapper"); |
||||||
|
|
||||||
|
if (windowWidth > 480) { |
||||||
|
if (tagsSection.clientHeight > 88) { |
||||||
|
setSeometaClass("inline-block"); |
||||||
|
tagsWrapper.style.height = "88px" |
||||||
|
} else { |
||||||
|
hideTagsBtns.style.display = "none"; |
||||||
|
} |
||||||
|
} else { |
||||||
|
if (tagsSection.clientHeight > 176) { |
||||||
|
setSeometaClass("flex"); |
||||||
|
tagsWrapper.style.height = "176px" |
||||||
|
} else { |
||||||
|
hideTagsBtns.style.display = "none"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function setSeometaClass(buttonDislpay) { |
||||||
|
let seoMetaBlock = document.querySelector(".sotbit-seometa-tags-column"), |
||||||
|
hideTagsBtns = seoMetaBlock.querySelector(".sotbit-seometa-tags__hide"); |
||||||
|
let seoMetaClass = seoMetaBlock.getAttribute("class"); |
||||||
|
|
||||||
|
seoMetaClass = seoMetaClass.replace(" closed", ""); |
||||||
|
seoMetaClass = seoMetaClass.replace(" opened", ""); |
||||||
|
seoMetaClass = seoMetaClass + " closed"; |
||||||
|
|
||||||
|
seoMetaBlock.setAttribute("class", seoMetaClass); |
||||||
|
hideTagsBtns.style.display = buttonDislpay; |
||||||
|
} |
||||||
|
|
||||||
|
function replaceClass() { |
||||||
|
let seoMetaBlock = document.querySelector(".sotbit-seometa-tags-column"); |
||||||
|
let seoMetaClass = seoMetaBlock.getAttribute("class"); |
||||||
|
let tagsWrapper = seoMetaBlock.querySelector(".tags_wrapper"); |
||||||
|
let tagsSection = seoMetaBlock.querySelector(".tags_section"), |
||||||
|
windowWidth = window.innerWidth || document.documentElement.clientWidth; |
||||||
|
|
||||||
|
if (seoMetaClass.includes("closed")) { |
||||||
|
seoMetaClass = seoMetaClass.replace("closed", "opened"); |
||||||
|
|
||||||
|
seoMetaBlock.setAttribute("class", seoMetaClass); |
||||||
|
|
||||||
|
tagsWrapper.style.height = tagsSection.clientHeight + "px"; |
||||||
|
|
||||||
|
} else if (seoMetaClass.includes("opened")) { |
||||||
|
|
||||||
|
seoMetaClass = seoMetaClass.replace("opened", "closed"); |
||||||
|
|
||||||
|
seoMetaBlock.setAttribute("class", seoMetaClass); |
||||||
|
|
||||||
|
if (windowWidth > 480) { |
||||||
|
tagsWrapper.style.height = "88px"; |
||||||
|
} else { |
||||||
|
tagsWrapper.style.height = "176px"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function collapseTags() { |
||||||
|
let seoMetaBlock = document.querySelector(".sotbit-seometa-tags-column"); |
||||||
|
let seoMetaClass = seoMetaBlock.getAttribute("class"); |
||||||
|
let tagsWrapper = seoMetaBlock.querySelector(".tags_wrapper"); |
||||||
|
let windowWidth = window.innerWidth || document.documentElement.clientWidth; |
||||||
|
|
||||||
|
if (seoMetaClass.includes("opened")) { |
||||||
|
|
||||||
|
seoMetaClass = seoMetaClass.replace("opened", "closed"); |
||||||
|
|
||||||
|
seoMetaBlock.setAttribute("class", seoMetaClass); |
||||||
|
|
||||||
|
if (windowWidth > 480) { |
||||||
|
tagsWrapper.style.height = "88px"; |
||||||
|
} else { |
||||||
|
tagsWrapper.style.height = "176px"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,121 @@ |
|||||||
|
.sotbit-seometa-tags-column { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; |
||||||
|
-webkit-box-orient: vertical; |
||||||
|
-webkit-box-direction: normal; |
||||||
|
-moz-box-orient: vertical; |
||||||
|
-moz-box-direction: normal; |
||||||
|
-ms-flex-direction: column; |
||||||
|
flex-direction: column; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .sotbit-seometa-tags-column__title { |
||||||
|
width: 100%; |
||||||
|
font-weight: 600; |
||||||
|
font-size: 13px; |
||||||
|
line-height: 20px; |
||||||
|
margin-bottom: 10px; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; |
||||||
|
-ms-flex-wrap: wrap; |
||||||
|
flex-wrap: wrap; |
||||||
|
overflow: hidden; |
||||||
|
-webkit-transition: height 0.4s ease; |
||||||
|
transition: height 0.4s ease; |
||||||
|
margin-bottom: 0; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .tags_section { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; |
||||||
|
-ms-flex-wrap: wrap; |
||||||
|
flex-wrap: wrap; |
||||||
|
overflow: hidden; |
||||||
|
-webkit-transition: height 0.4s ease; |
||||||
|
transition: height 0.4s ease; |
||||||
|
margin-bottom: 0; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .sotbit-seometa-tags-column-wrapper { |
||||||
|
max-width: 100%; |
||||||
|
width: auto; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .sotbit-seometa-tags-column-wrapper .sotbit-seometa-tag-column .sotbit-seometa-tag-link { |
||||||
|
white-space: nowrap; |
||||||
|
overflow: hidden; |
||||||
|
text-overflow: ellipsis; |
||||||
|
display: block; |
||||||
|
max-width: 100%; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show { |
||||||
|
border: 1px solid #ededed; |
||||||
|
-webkit-transition: all 0.2s ease-in-out; |
||||||
|
transition: all 0.2s ease-in-out; |
||||||
|
display: none; |
||||||
|
padding: 0 30px; |
||||||
|
font-size: 0.9rem; |
||||||
|
line-height: 32px; |
||||||
|
color: #000; |
||||||
|
-webkit-box-align: center; |
||||||
|
-moz-box-align: center; |
||||||
|
-ms-flex-align: center; |
||||||
|
align-items: center; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover { |
||||||
|
border: 1px solid #fb0040; |
||||||
|
color: #fb0040; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover .angle-up, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover .angle-up { |
||||||
|
border-bottom: 1px solid #fb0040; |
||||||
|
border-right: 1px solid #fb0040; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide .angle-up, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show .angle-up { |
||||||
|
font-weight: 400; |
||||||
|
display: block; |
||||||
|
content: ''; |
||||||
|
width: 7px; |
||||||
|
height: 7px; |
||||||
|
top: 8px; |
||||||
|
right: 1rem; |
||||||
|
margin-top: 0; |
||||||
|
border-bottom: 1px solid #000; |
||||||
|
border-right: 1px solid #000; |
||||||
|
-webkit-transform: rotate(45deg) translateX(-3px); |
||||||
|
transform: rotate(45deg) translateX(-3px); |
||||||
|
-webkit-transition: all .2s ease-in-out; |
||||||
|
transition: all .2s ease-in-out; |
||||||
|
padding: 0; |
||||||
|
margin-left: 10px; } |
||||||
|
.sotbit-seometa-tags-column.closed .tags_wrapper { |
||||||
|
height: 88px; } |
||||||
|
.sotbit-seometa-tags-column.closed .sotbit-seometa-tags__hide .seometa-tags__hide { |
||||||
|
display: none; } |
||||||
|
.sotbit-seometa-tags-column.closed .sotbit-seometa-tags__hide .seometa-tags__show { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; } |
||||||
|
.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__hide { |
||||||
|
display: -webkit-box; |
||||||
|
display: -moz-box; |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; } |
||||||
|
.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__hide .angle-up { |
||||||
|
-webkit-transform: rotate(225deg) translateX(-3px); |
||||||
|
transform: rotate(225deg) translateX(-3px); } |
||||||
|
.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__show { |
||||||
|
display: none; } |
||||||
|
|
||||||
|
@media screen and (max-width: 480px) { |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show { |
||||||
|
width: 100%; |
||||||
|
-webkit-box-pack: center; |
||||||
|
-moz-box-pack: center; |
||||||
|
-ms-flex-pack: center; |
||||||
|
justify-content: center; |
||||||
|
border: none; } |
||||||
|
.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover, .sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover { |
||||||
|
border: none; } |
||||||
|
.sotbit-seometa-tags-column.closed .tags_wrapper { |
||||||
|
height: 176px; } } |
@ -0,0 +1 @@ |
|||||||
|
.sotbit-seometa-tags-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-moz-box-orient:vertical;-moz-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .sotbit-seometa-tags-column__title{width:100%;font-weight:600;font-size:13px;line-height:20px;margin-bottom:10px}.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper,.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .tags_section{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;overflow:hidden;-webkit-transition:height .4s ease;transition:height .4s ease;margin-bottom:0}.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .sotbit-seometa-tags-column-wrapper{max-width:100%;width:auto}.sotbit-seometa-tags-column .sotbit-seometa-tags-column-container .tags_wrapper .sotbit-seometa-tags-column-wrapper .sotbit-seometa-tag-column .sotbit-seometa-tag-link{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%}.sotbit-seometa-tags-column,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex}.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show{border:1px solid #ededed;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:none;padding:0 30px;font-size:.9rem;line-height:32px;color:#000;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;align-items:center}.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover{border:1px solid #fb0040;color:#fb0040}.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover .angle-up,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover .angle-up{border-bottom:1px solid #fb0040;border-right:1px solid #fb0040}.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide .angle-up,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show .angle-up{font-weight:400;display:block;content:'';width:7px;height:7px;top:8px;right:1rem;margin-top:0;border-bottom:1px solid #000;border-right:1px solid #000;-webkit-transform:rotate(45deg) translateX(-3px);transform:rotate(45deg) translateX(-3px);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;padding:0;margin-left:10px}.sotbit-seometa-tags-column.closed .tags_wrapper{height:88px}.sotbit-seometa-tags-column.closed .sotbit-seometa-tags__hide .seometa-tags__hide{display:none}.sotbit-seometa-tags-column.closed .sotbit-seometa-tags__hide .seometa-tags__show,.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__hide{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex}.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__hide .angle-up{-webkit-transform:rotate(225deg) translateX(-3px);transform:rotate(225deg) translateX(-3px)}.sotbit-seometa-tags-column.opened .sotbit-seometa-tags__hide .seometa-tags__show{display:none}@media screen and (max-width:480px){.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show{width:100%;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;border:0}.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__hide:hover,.sotbit-seometa-tags-column .sotbit-seometa-tags__hide .seometa-tags__show:hover{border:0}.sotbit-seometa-tags-column.closed .tags_wrapper{height:176px}} |
@ -0,0 +1,156 @@ |
|||||||
|
.sotbit-seometa-tags-column { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
|
||||||
|
.sotbit-seometa-tags-column-container { |
||||||
|
|
||||||
|
.sotbit-seometa-tags-column__title { |
||||||
|
width: 100%; |
||||||
|
font-weight: 600; |
||||||
|
font-size: 13px; |
||||||
|
line-height: 20px; |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.tags_wrapper { |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
overflow: hidden; |
||||||
|
transition: height 0.4s ease; |
||||||
|
margin-bottom: 0; |
||||||
|
|
||||||
|
.tags_section { |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
overflow: hidden; |
||||||
|
transition: height 0.4s ease; |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-column-wrapper { |
||||||
|
max-width: 100%; |
||||||
|
width: auto; |
||||||
|
|
||||||
|
.sotbit-seometa-tag-column { |
||||||
|
|
||||||
|
.sotbit-seometa-tag-link { |
||||||
|
white-space: nowrap; |
||||||
|
overflow: hidden; |
||||||
|
text-overflow: ellipsis; |
||||||
|
display: block; |
||||||
|
max-width: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags__hide { |
||||||
|
display: flex; |
||||||
|
|
||||||
|
.seometa-tags__hide, .seometa-tags__show { |
||||||
|
border: 1px solid #ededed; |
||||||
|
transition: all 0.2s ease-in-out; |
||||||
|
display: none; |
||||||
|
padding: 0 30px; |
||||||
|
font-size: 0.9rem; |
||||||
|
line-height: 32px; |
||||||
|
color: #000; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
&:hover { |
||||||
|
border: 1px solid #fb0040; |
||||||
|
color: #fb0040; |
||||||
|
|
||||||
|
.angle-up { |
||||||
|
border-bottom: 1px solid #fb0040; |
||||||
|
border-right: 1px solid #fb0040; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
.angle-up { |
||||||
|
font-weight: 400; |
||||||
|
display: block; |
||||||
|
content: ''; |
||||||
|
width: 7px; |
||||||
|
height: 7px; |
||||||
|
top: 8px; |
||||||
|
right: 1rem; |
||||||
|
margin-top: 0; |
||||||
|
border-bottom: 1px solid #000; |
||||||
|
border-right: 1px solid #000; |
||||||
|
transform: rotate(45deg) translateX(-3px); |
||||||
|
transition: all .2s ease-in-out; |
||||||
|
padding: 0; |
||||||
|
margin-left: 10px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
&.closed { |
||||||
|
|
||||||
|
.tags_wrapper { |
||||||
|
height: 88px; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags__hide { |
||||||
|
|
||||||
|
.seometa-tags__hide { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-tags__show { |
||||||
|
display: flex; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&.opened { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.sotbit-seometa-tags__hide { |
||||||
|
|
||||||
|
.seometa-tags__hide { |
||||||
|
display: flex; |
||||||
|
|
||||||
|
.angle-up { |
||||||
|
transform: rotate(225deg) translateX(-3px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.seometa-tags__show { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@media screen and (max-width: 480px) { |
||||||
|
.sotbit-seometa-tags-column { |
||||||
|
|
||||||
|
.sotbit-seometa-tags__hide { |
||||||
|
|
||||||
|
.seometa-tags__hide, .seometa-tags__show { |
||||||
|
width: 100%; |
||||||
|
justify-content: center; |
||||||
|
border: none; |
||||||
|
|
||||||
|
&:hover { |
||||||
|
border: none; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&.closed { |
||||||
|
|
||||||
|
.tags_wrapper { |
||||||
|
height: 176px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
if ($arResult['ITEMS']):?> |
||||||
|
<div class="sotbit-seometa-tags-column"> |
||||||
|
<? if(is_array($arResult['ITEMS'])){ ?> |
||||||
|
<div class="sotbit-seometa-tags-column-container"> |
||||||
|
<? foreach ($arResult['ITEMS'] as $item){ |
||||||
|
if($item['IMAGE']['SRC']){ ?> |
||||||
|
<a class="seometa__item" href="<?= $item['URL'] ?>" <?= $item['TITLE'] ? "title=\"". $item['TITLE'] .'"' : '' ?>>
|
||||||
|
<div class="seometa__img-wrapper"> |
||||||
|
<img class="seometa__img" |
||||||
|
src="<?= $item['IMAGE']['SRC'] ?>"
|
||||||
|
alt="<?= $item['IMAGE']['SRC'] ?>"
|
||||||
|
<?= $item['TITLE'] ? "title=\"". $item['TITLE'] .'"' : '' ?>>
|
||||||
|
</div> |
||||||
|
<?if($item['TITLE']){?> |
||||||
|
<p class="seometa__title"><?= $item['TITLE'] ?></p>
|
||||||
|
<?}?> |
||||||
|
</a> |
||||||
|
<? }elseif($item['TITLE'] && $item['URL']){ ?> |
||||||
|
<div class="tags_wrapper"> |
||||||
|
<div class="tags_section"> |
||||||
|
<div class="sotbit-seometa-tags-column-wrapper"> |
||||||
|
<div class="sotbit-seometa-tag-column"> |
||||||
|
<a class="sotbit-seometa-tag-link" href="<?= $item['URL'] ?>"
|
||||||
|
title="<?= $item['TITLE'] ?>"><?= $item['TITLE'] ?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<? } |
||||||
|
} ?> |
||||||
|
</div> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
<?endif;?> |
@ -0,0 +1,18 @@ |
|||||||
|
<? |
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
|
||||||
|
use Bitrix\Main\Localization\Loc; |
||||||
|
|
||||||
|
$arComponentDescription = array( |
||||||
|
"NAME" => Loc::getMessage("SM_NAME"), |
||||||
|
"DESCRIPTION" => Loc::getMessage("SM_DESCRIPTION"), |
||||||
|
"ICON" => "/images/icon.png", |
||||||
|
"PATH" => array( |
||||||
|
"ID" => Loc::getMessage("MAIN_GROUP_NAME_SOTBIT"), |
||||||
|
"CHILD" => array( |
||||||
|
"ID" => "sotbit.seo.meta", |
||||||
|
"NAME" => Loc::getMessage("MAIN_MENU_NAME_SOTBIT"), |
||||||
|
) |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,122 @@ |
|||||||
|
<? |
||||||
|
|
||||||
|
use Bitrix\Main\Localization\Loc; |
||||||
|
|
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
|
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
|
||||||
|
$arIBlockType = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList( |
||||||
|
[ |
||||||
|
"sort" => "asc", |
||||||
|
], |
||||||
|
[ |
||||||
|
"TYPE" => $arCurrentValues["IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
] |
||||||
|
); |
||||||
|
while ($arr = $rsIBlock->Fetch()) |
||||||
|
$arIBlock[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"]; |
||||||
|
|
||||||
|
$result = \Bitrix\Iblock\SectionTable::getList( |
||||||
|
[ |
||||||
|
'select' => ['ID', 'NAME'], |
||||||
|
'filter' => ['IBLOCK_ID' => $arCurrentValues['IBLOCK_ID']] |
||||||
|
] |
||||||
|
); |
||||||
|
while ($Section = $result->fetch()) { |
||||||
|
$arSections[$Section["ID"]] = "[" . $Section["ID"] . "] " . $Section["NAME"]; |
||||||
|
} |
||||||
|
|
||||||
|
$arComponentParameters = [ |
||||||
|
"GROUPS" => [], |
||||||
|
"PARAMETERS" => [ |
||||||
|
"IBLOCK_TYPE" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_IBLOCK_TYPE"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arIBlockType, |
||||||
|
"REFRESH" => "Y", |
||||||
|
], |
||||||
|
"IBLOCK_ID" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_IBLOCK_IBLOCK"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arIBlock, |
||||||
|
"REFRESH" => "Y", |
||||||
|
], |
||||||
|
"ELEMENT_ID" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_ELEMENT_ID"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $elementId, |
||||||
|
], |
||||||
|
"SECTION_ID" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_SECTION_ID"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arSections, |
||||||
|
], |
||||||
|
"INCLUDE_SUBSECTIONS" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => Loc::getMessage('SM_INCLUDE_SUBSECTIONS'), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => [ |
||||||
|
"Y" => Loc::getMessage('SM_INCLUDE_SUBSECTIONS_ALL'), |
||||||
|
"N" => Loc::getMessage('SM_INCLUDE_SUBSECTIONS_NO'), |
||||||
|
], |
||||||
|
"DEFAULT" => "Y", |
||||||
|
], |
||||||
|
'SORT' => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => Loc::getMessage('SM_SORT'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => [ |
||||||
|
'NAME' => Loc::getMessage("SM_SORT_NAME"), |
||||||
|
'CONDITIONS' => Loc::getMessage("SM_SORT_CONDITION"), |
||||||
|
'URL_SORT' => Loc::getMessage("SM_SORT_URL_SORT"), |
||||||
|
'PRODUCT_COUNT' => Loc::getMessage('SM_SORT_PRODUCT_COUNT'), |
||||||
|
'RANDOM' => Loc::getMessage("SM_SORT_RANDOM") |
||||||
|
], |
||||||
|
], |
||||||
|
'SORT_ORDER' => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => Loc::getMessage('SM_SORT_ORDER'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => ['asc' => Loc::getMessage("SM_SORT_ORDER_ASC"), 'desc' => Loc::getMessage("SM_SORT_ORDER_DESC")], |
||||||
|
], |
||||||
|
'CNT_TAGS' => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_CNT_TAGS"), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => '', |
||||||
|
], |
||||||
|
"PRODUCT_COUNT" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_PRODUCT_COUNT"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "N", |
||||||
|
], |
||||||
|
"GENERATING_TAGS" => [ |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => Loc::getMessage("SM_GENERATING_TAGS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "N", |
||||||
|
], |
||||||
|
"CACHE_TIME" => [ |
||||||
|
"DEFAULT" => 36000000, |
||||||
|
], |
||||||
|
"CACHE_GROUPS" => [ |
||||||
|
"PARENT" => "CACHE_SETTINGS", |
||||||
|
"NAME" => Loc::getMessage("SM_CACHE_GROUPS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "Y", |
||||||
|
], |
||||||
|
], |
||||||
|
]; |
||||||
|
?> |
@ -0,0 +1,176 @@ |
|||||||
|
<? |
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { |
||||||
|
die(); |
||||||
|
} |
||||||
|
|
||||||
|
use Bitrix\Iblock\Template\Engine; |
||||||
|
use Bitrix\Iblock\Template\Entity\Section; |
||||||
|
use Bitrix\Main\Data\Cache; |
||||||
|
use Bitrix\Main\Loader; |
||||||
|
use Sotbit\Seometa\Orm\ConditionTable; |
||||||
|
use Sotbit\Seometa\Orm\SeometaUrlTable; |
||||||
|
use Sotbit\Seometa\SeoMetaMorphy; |
||||||
|
use Sotbit\Seometa\Tags; |
||||||
|
|
||||||
|
global $APPLICATION; |
||||||
|
global $USER; |
||||||
|
|
||||||
|
$moduleId = 'sotbit.seometa'; |
||||||
|
if (!Loader::includeModule($moduleId) || !Loader::includeModule('iblock')) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arParams['CACHE_TIME'])) { |
||||||
|
$arParams['CACHE_TIME'] = '36000000'; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arParams['SORT'])) { |
||||||
|
$arParams['SORT'] = 'NAME'; |
||||||
|
} |
||||||
|
|
||||||
|
$cacheTime = $arParams['CACHE_TIME']; |
||||||
|
$cache_id = serialize([ |
||||||
|
$arParams, |
||||||
|
$APPLICATION->GetCurPage(false), |
||||||
|
$arParams['CACHE_GROUPS'] === 'N' ? false : $USER->GetGroups() |
||||||
|
]); |
||||||
|
$cacheDir = '/' . $moduleId . '.element.tags/'; |
||||||
|
$cache = Cache::createInstance(); |
||||||
|
$Tags = []; |
||||||
|
|
||||||
|
|
||||||
|
if ($cache->initCache($cacheTime, $cache_id, $cacheDir)) { |
||||||
|
$Tags = $cache->getVars(); |
||||||
|
} elseif ($cache->startDataCache()) { |
||||||
|
$Conditions = []; |
||||||
|
|
||||||
|
$tagsCategory = \Sotbit\Seometa\Orm\CategoryTagsTable::getById(1)->fetch(); |
||||||
|
|
||||||
|
if (isset($arParams['SECTION_ID']) && $arParams['SECTION_ID'] !== 0) { |
||||||
|
$elemSection = $arParams['SECTION_ID']; |
||||||
|
} else { |
||||||
|
$elemSection = array_column(\Bitrix\Iblock\SectionElementTable::query() |
||||||
|
->setFilter(["IBLOCK_ELEMENT_ID" => $arParams['ELEMENT_ID']]) |
||||||
|
->addSelect('IBLOCK_SECTION_ID', 'SECTION_ID') |
||||||
|
->fetchAll() ?: [], 'SECTION_ID'); |
||||||
|
} |
||||||
|
|
||||||
|
$sections = Tags::findNeedSections($elemSection, $arParams['INCLUDE_SUBSECTIONS'], 1); // list of all sections |
||||||
|
$SectionConditions = ConditionTable::GetConditionsBySections($sections); // list of all conditions by sections |
||||||
|
|
||||||
|
if (is_array($SectionConditions)) { |
||||||
|
$Conditions = $SectionConditions; |
||||||
|
} |
||||||
|
|
||||||
|
$TagsObject = new Tags(); |
||||||
|
$currentUrl = $APPLICATION->GetCurPage(false); |
||||||
|
|
||||||
|
//<editor-fold desc="Exclude condition, if in enable HIDE_IN_SECTION and current url is section url"> |
||||||
|
$sectionUrl = CIBlockSection::GetList( |
||||||
|
[], |
||||||
|
['ID' => $arParams['SECTION_ID']], |
||||||
|
false, |
||||||
|
['SECTION_PAGE_URL'] |
||||||
|
)->GetNext()['SECTION_PAGE_URL']; |
||||||
|
|
||||||
|
if ($sectionUrl == $currentUrl) { |
||||||
|
$Conditions = array_filter($Conditions, fn($item) => !($item['HIDE_IN_SECTION'] == 'Y' && in_array($arParams['SECTION_ID'], $item['SECTIONS']))); |
||||||
|
} |
||||||
|
//</editor-fold> |
||||||
|
if ($arParams['GENERATING_TAGS'] == 'Y') { |
||||||
|
$Tags = $TagsObject->GenerateTags($Conditions, array_keys($Conditions), 0, 0, 1); |
||||||
|
if (is_array($Tags)) { |
||||||
|
foreach ($Tags as &$tag) { |
||||||
|
$tag = \Sotbit\Seometa\Orm\CategoryTagsTable::fillCategoryTags($Conditions[$tag['CONDITION_ID']], $tag, $tagsCategory, 'TAGS_DETAIL'); |
||||||
|
} |
||||||
|
unset($tag); |
||||||
|
} |
||||||
|
} else { |
||||||
|
$Tags = []; |
||||||
|
$morphyObject = SeoMetaMorphy::morphyLibInit(); |
||||||
|
foreach ($Conditions as $item) { |
||||||
|
if ($item['ELEMENT_TAG']) { |
||||||
|
$arrTags = SeometaUrlTable::getAllByCondition($item['ID']); |
||||||
|
foreach ($arrTags as &$arrTag) { |
||||||
|
\CSeoMetaTagsProperty::$params = unserialize($arrTag['PROPERTIES']); |
||||||
|
$sku = new Section($arrTag['section_id']); |
||||||
|
$title = Engine::process($sku, SeoMetaMorphy::prepareForMorphy($item['ELEMENT_TAG'])); |
||||||
|
|
||||||
|
if (!empty($title)) { |
||||||
|
$arrTag['TITLE'] = SeoMetaMorphy::convertMorphy($title, $morphyObject);; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arrTag['TITLE'])) { |
||||||
|
$arrTag['TITLE'] = $title; |
||||||
|
} |
||||||
|
|
||||||
|
$arrTag['URL'] = $arrTag['ACTIVE'] == 'Y' ? $arrTag['NEW_URL'] : $arrTag['REAL_URL']; |
||||||
|
$arrTag = \Sotbit\Seometa\Orm\CategoryTagsTable::fillCategoryTags($Conditions[$arrTag['CONDITION_ID']], $arrTag, $tagsCategory, 'TAGS_DETAIL'); |
||||||
|
} |
||||||
|
|
||||||
|
if (is_array($arrTags)) { |
||||||
|
$Tags = array_merge($Tags, $arrTags); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($Tags)) { |
||||||
|
$Tags = []; |
||||||
|
$cache->endDataCache($Tags); |
||||||
|
return $this->IncludeComponentTemplate(); |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($Tags)) { |
||||||
|
foreach ($Tags as $keyTag => $tag) { |
||||||
|
if ($tag['SITE_ID'] !== SITE_ID) { |
||||||
|
unset($Tags[$keyTag]); |
||||||
|
} |
||||||
|
} |
||||||
|
$Tags = array_values($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
$currentUrl = CSeoMeta::encodeRealUrl($currentUrl); |
||||||
|
|
||||||
|
if ($arParams['GENERATING_TAGS'] == 'Y') { |
||||||
|
$Tags = $TagsObject->ReplaceChpuUrls($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
$curPage = array_search( |
||||||
|
$currentUrl, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'URL')) |
||||||
|
); |
||||||
|
if ($curPage === false) { |
||||||
|
$curPage = array_search( |
||||||
|
$currentUrl, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'REAL_URL')) |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
if ($curPage !== false) { |
||||||
|
unset($Tags[$curPage]); |
||||||
|
} |
||||||
|
|
||||||
|
$Tags = $TagsObject->SortTags($Tags, $arParams['SORT'], $arParams['SORT_ORDER']); |
||||||
|
if($componentTemplate !== 'tagscategory') { |
||||||
|
$Tags = $TagsObject->CutTags($Tags, $arParams['CNT_TAGS']); |
||||||
|
} else { |
||||||
|
$arParams['CNT_TAGS'] = $arParams['CNT_TAGS'] ?: 10; |
||||||
|
} |
||||||
|
|
||||||
|
unset($Conditions); |
||||||
|
$cache->endDataCache($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
if ($arParams['AJAX'] === 'Y') { |
||||||
|
$arResult['ITEMS'] = array_map(function ($arrVal) { |
||||||
|
$arrVal['URL'] = $arrVal['URL'] . '?ajaxTag=1'; |
||||||
|
return $arrVal; |
||||||
|
}, $Tags); |
||||||
|
} else { |
||||||
|
$arResult['ITEMS'] = $Tags; |
||||||
|
} |
||||||
|
|
||||||
|
unset($Tags); |
||||||
|
$this->IncludeComponentTemplate(); |
||||||
|
?> |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_NAME"] = "Облако тегов для детальной страницы"; |
||||||
|
$MESS["MAIN_MENU_NAME_SOTBIT"] = "SEO умного фильтра"; |
||||||
|
$MESS["MAIN_GROUP_NAME_SOTBIT"] = "Сотбит"; |
||||||
|
$MESS["SM_DESCRIPTION"] = "Выводит теги для детальной страницы каталога"; |
||||||
|
?> |
@ -0,0 +1,24 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_IBLOCK_TYPE"] = "Тип инфоблока"; |
||||||
|
$MESS["SM_IBLOCK_IBLOCK"] = "Инфоблок"; |
||||||
|
$MESS["SM_SECTION_ID"] = "Раздел"; |
||||||
|
$MESS["SM_ELEMENT_ID"] = "ID товара"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS"] = "Показывать теги родительских разделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ALL"] = "всех родительских разделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_NO"] = "не показывать"; |
||||||
|
$MESS["SM_CACHE_GROUPS"] = "Учитывать права доступа"; |
||||||
|
$MESS["CACHE_TYPE"] = "Тип кеширования"; |
||||||
|
$MESS["CACHE_TIME"] = "Время кеширования (сек.)"; |
||||||
|
$MESS["SM_SORT"] = "Тип сортировки тегов"; |
||||||
|
$MESS["SM_SORT_NAME"] = "По названию"; |
||||||
|
$MESS["SM_SORT_CONDITION"] = "По индексу сортировки условий"; |
||||||
|
$MESS["SM_SORT_URL_SORT"] = "По индексу сортировки ЧПУ"; |
||||||
|
$MESS["SM_SORT_PRODUCT_COUNT"] = "По количеству товаров по ссылке"; |
||||||
|
$MESS["SM_SORT_RANDOM"] = "Случайно"; |
||||||
|
$MESS["SM_SORT_ORDER"] = "Порядок сортировки"; |
||||||
|
$MESS["SM_SORT_ORDER_ASC"] = "По возрастанию"; |
||||||
|
$MESS["SM_SORT_ORDER_DESC"] = "По убыванию"; |
||||||
|
$MESS["SM_CNT_TAGS"] = "Количество выводимых тегов"; |
||||||
|
$MESS["SM_PRODUCT_COUNT"] = "Выводить количество товаров по ссылке (не учитывается доступность товаров)"; |
||||||
|
$MESS["SM_GENERATING_TAGS"] = "Перегенерировать теги"; |
||||||
|
?> |
@ -0,0 +1,19 @@ |
|||||||
|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
if($arResult['ITEMS']) |
||||||
|
{ |
||||||
|
foreach($arResult['ITEMS'] as $Item) |
||||||
|
{ |
||||||
|
if($Item['TITLE'] && $Item['URL']) { |
||||||
|
$count = $arParams['PRODUCT_COUNT'] == 'Y' ? ' (' . $Item['PRODUCT_COUNT'] . ')' : ''; |
||||||
|
?> |
||||||
|
<div class="sotbit-seometa-tags-wrapper"> |
||||||
|
<div class="sotbit-seometa-tag"> |
||||||
|
<a class="sotbit-seometa-tag-link" href="<?=$Item['URL'] ?>" title="<?=$Item['TITLE'] . $count ?>"><?=$Item['TITLE'] . $count?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,13 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
|
||||||
|
$arTemplateParameters = array( |
||||||
|
'SORT_ORDER_TAGS' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT_ORDER'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array('asc' => GetMessage("SM_SORT_ORDER_ASC"), 'desc' => GetMessage("SM_SORT_ORDER_DESC")), |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,5 @@ |
|||||||
|
<? |
||||||
|
$MESS['SM_SORT_ORDER'] = 'Порядок сортировки категорий тегов'; |
||||||
|
$MESS['SM_SORT_ORDER_ASC'] = 'По возрастанию'; |
||||||
|
$MESS['SM_SORT_ORDER_DESC'] = 'По убыванию'; |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
$MESS['SEO_META_TAGS_MORE'] = 'Показать больше'; |
||||||
|
$MESS['SEO_META_TAGS_LESS'] = 'Скрыть'; |
||||||
|
?> |
@ -0,0 +1,31 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
$arCategory = []; |
||||||
|
|
||||||
|
foreach ($arResult['ITEMS'] as $item) { |
||||||
|
if ($arCategory[$item['TAGS_DETAIL_ID']]) { |
||||||
|
$arCategory[$item['TAGS_DETAIL_ID']]['ITEMS'][] = $item; |
||||||
|
} else { |
||||||
|
$arCategory[$item['TAGS_DETAIL_ID'] ?: 1] = [ |
||||||
|
'TITLE' => $item['TAGS_DETAIL_NAME'], |
||||||
|
'SORT' => $item['TAGS_DETAIL_SORT'], |
||||||
|
'ITEMS' => [$item], |
||||||
|
]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($arParams['SORT_ORDER_TAGS']) { |
||||||
|
$sort = $arParams['SORT_ORDER_TAGS']; |
||||||
|
} |
||||||
|
|
||||||
|
if($sort === 'asc') { |
||||||
|
uasort($arCategory, function ($a, $b) { |
||||||
|
return $a['SORT'] <=> $b['SORT']; |
||||||
|
}); |
||||||
|
} else { |
||||||
|
uasort($arCategory, function ($a, $b) { |
||||||
|
return $b['SORT'] <=> $a['SORT']; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
$arResult['CATEGORY_TAGS'] = $arCategory; |
@ -0,0 +1,43 @@ |
|||||||
|
;(function () { |
||||||
|
CategoryTags = function (params) { |
||||||
|
this.tagsWrapper = params.tagsWrapper; |
||||||
|
this.showMoreButton = params.showMoreButton; |
||||||
|
this.categoryTags = params.categoryTags; |
||||||
|
this.hideTag = params.hideTag; |
||||||
|
this.expanded = params.expanded; |
||||||
|
this.init(); |
||||||
|
}; |
||||||
|
|
||||||
|
CategoryTags.prototype.init = function () { |
||||||
|
const tagsWrapper = document.getElementById(this.tagsWrapper); |
||||||
|
const showMoreButton = document.getElementById(this.showMoreButton); |
||||||
|
const hiddenTags = document.querySelectorAll(this.hideTag); |
||||||
|
const categoryTags = document.querySelectorAll(this.categoryTags); |
||||||
|
let startHeight = 0; |
||||||
|
|
||||||
|
if (tagsWrapper) { |
||||||
|
tagsWrapper.style.height = startHeight = tagsWrapper.offsetHeight + 'px'; |
||||||
|
} |
||||||
|
|
||||||
|
if(showMoreButton) { |
||||||
|
showMoreButton.addEventListener('click', async () => { |
||||||
|
tagsWrapper.classList.toggle(this.expanded); |
||||||
|
if (tagsWrapper.classList.contains(this.expanded)) { |
||||||
|
await hiddenTags.forEach(tag => tag.classList.remove('hide-tag')); |
||||||
|
let height = 0; |
||||||
|
await categoryTags.forEach((category) => { |
||||||
|
height += category.offsetHeight; |
||||||
|
}); |
||||||
|
showMoreButton.textContent = BX.message('less_btn'); |
||||||
|
tagsWrapper.style.height = height + 'px'; |
||||||
|
} else { |
||||||
|
showMoreButton.textContent = BX.message('more_btn'); |
||||||
|
tagsWrapper.style.height = startHeight; |
||||||
|
setTimeout(() => { |
||||||
|
hiddenTags.forEach(tag => tag.classList.add('hide-tag')); |
||||||
|
}, 100) |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}; |
||||||
|
})(); |
@ -0,0 +1,44 @@ |
|||||||
|
.sotbit-seometa-tags-common-wrapper { |
||||||
|
padding: 24px; |
||||||
|
background: #F8F9FA; |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper { |
||||||
|
transition: height 0.5s ease-in-out; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper.expanded { |
||||||
|
transition: height 0.5s ease-in-out; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper-category { |
||||||
|
overflow: hidden; |
||||||
|
display: flex; |
||||||
|
width: 100%; |
||||||
|
flex-wrap: wrap; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-padding { |
||||||
|
padding-right: 8px; |
||||||
|
margin-bottom: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.hide-tag { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tag-link { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-btn-more { |
||||||
|
margin-top: 16px; |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-btn-more.show-btn { |
||||||
|
display: block; |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
<? use Bitrix\Main\Localization\Loc; |
||||||
|
|
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
if ($arResult['CATEGORY_TAGS']) { ?> |
||||||
|
<div class="sotbit-seometa-tags-common-wrapper"> |
||||||
|
<div class="sotbit-seometa-tags-wrapper" id="tagsWrapper"> |
||||||
|
<? |
||||||
|
$i = 1; |
||||||
|
foreach ($arResult['CATEGORY_TAGS'] as $cat_tag) { |
||||||
|
?> |
||||||
|
<div class="sotbit-seometa-tags-wrapper-category <?= $i > $arParams['CNT_TAGS'] ? 'hide-tag' : '' ?>">
|
||||||
|
<span class="sotbit-seometa-tags-padding"><?= $cat_tag['TITLE'] ?>: </span>
|
||||||
|
<? foreach ($cat_tag['ITEMS'] as $item) { |
||||||
|
$count = $arParams['PRODUCT_COUNT'] == 'Y' ? ' (' . $item['PRODUCT_COUNT'] . ')' : ''; ?> |
||||||
|
<div class="sotbit-seometa-tags-padding <?= $i > $arParams['CNT_TAGS'] ? 'hide-tag' : '' ?>">
|
||||||
|
<a class="sotbit-seometa-tag-link" href="<?= $item['URL'] ?>"
|
||||||
|
title="<?= $item['TITLE'] . $count ?>">
|
||||||
|
<?= $item['TITLE'] . $count ?> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
$i++; |
||||||
|
} |
||||||
|
?> |
||||||
|
</div> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
<div class="sotbit-seometa-btn-more <?= ($i - 1) > $arParams['CNT_TAGS'] ? 'show-btn' : '' ?>">
|
||||||
|
<a class="sotbit-seometa-tag-link" id="showMoreButton" |
||||||
|
href="javascript:void(0);"><?= Loc::getMessage('SEO_META_TAGS_MORE') ?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<script> |
||||||
|
BX.message({ |
||||||
|
'more_btn': '<?=Loc::getMessage('SEO_META_TAGS_MORE')?>',
|
||||||
|
'less_btn': '<?=Loc::getMessage('SEO_META_TAGS_LESS')?>',
|
||||||
|
}); |
||||||
|
|
||||||
|
new CategoryTags({ |
||||||
|
tagsWrapper: 'tagsWrapper', |
||||||
|
showMoreButton: 'showMoreButton', |
||||||
|
categoryTags: '.sotbit-seometa-tags-wrapper-category', |
||||||
|
hideTag: '.hide-tag', |
||||||
|
expanded: 'expanded', |
||||||
|
cntTags: <?= (int) $arParams['CNT_TAGS'] ?>,
|
||||||
|
}); |
||||||
|
</script> |
@ -0,0 +1,14 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
$arComponentDescription = array( |
||||||
|
"NAME" => GetMessage("SM_NAME"), |
||||||
|
"DESCRIPTION" => GetMessage("SM_DESCRIPTION"), |
||||||
|
"ICON" => "/images/icon.png", |
||||||
|
"PATH" => array( |
||||||
|
"ID" => GetMessage("MAIN_GROUP_NAME_SOTBIT"), |
||||||
|
"CHILD" => array( |
||||||
|
"ID" => "sotbit.seo.meta", |
||||||
|
"NAME" => GetMessage("MAIN_MENU_NAME_SOTBIT"), |
||||||
|
) |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,105 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
$arIBlockType = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList(array( |
||||||
|
"sort" => "asc", |
||||||
|
), array( |
||||||
|
"TYPE" => $arCurrentValues["IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
)); |
||||||
|
while ($arr = $rsIBlock->Fetch()) |
||||||
|
$arIBlock[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"]; |
||||||
|
|
||||||
|
$result = \Bitrix\Iblock\SectionTable::getList(array( |
||||||
|
'select' => array('ID', 'NAME'), |
||||||
|
'filter' => array('IBLOCK_ID' => $arCurrentValues['IBLOCK_ID']) |
||||||
|
)); |
||||||
|
while ($Section = $result->fetch()) { |
||||||
|
$arSections[$Section["ID"]] = "[" . $Section["ID"] . "] " . $Section["NAME"]; |
||||||
|
} |
||||||
|
|
||||||
|
$arComponentParameters = array( |
||||||
|
"GROUPS" => array(), |
||||||
|
"PARAMETERS" => array( |
||||||
|
"IBLOCK_TYPE" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_TYPE"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => $arIBlockType, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"IBLOCK_ID" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_IBLOCK_IBLOCK"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arIBlock, |
||||||
|
"REFRESH" => "Y", |
||||||
|
), |
||||||
|
"SECTION_ID" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_SECTION_ID"), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"ADDITIONAL_VALUES" => "Y", |
||||||
|
"VALUES" => $arSections, |
||||||
|
), |
||||||
|
"INCLUDE_SUBSECTIONS" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_INCLUDE_SUBSECTIONS'), |
||||||
|
"TYPE" => "LIST", |
||||||
|
"VALUES" => array( |
||||||
|
"Y" => GetMessage('SM_INCLUDE_SUBSECTIONS_ALL'), |
||||||
|
"A" => GetMessage('SM_INCLUDE_SUBSECTIONS_ACTIVE'), |
||||||
|
"N" => GetMessage('SM_INCLUDE_SUBSECTIONS_NO'), |
||||||
|
), |
||||||
|
"DEFAULT" => "Y", |
||||||
|
), |
||||||
|
'SORT' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array( |
||||||
|
'NAME' => GetMessage("SM_SORT_NAME"), |
||||||
|
'CONDITIONS' => GetMessage("SM_SORT_CONDITION"), |
||||||
|
'URL_SORT' => GetMessage("SM_SORT_URL_SORT"), |
||||||
|
'PRODUCT_COUNT' => GetMessage('SM_SORT_PRODUCT_COUNT'), |
||||||
|
'RANDOM' => GetMessage("SM_SORT_RANDOM") |
||||||
|
), |
||||||
|
), |
||||||
|
'SORT_ORDER' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT_ORDER'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array('asc' => GetMessage("SM_SORT_ORDER_ASC"), 'desc' => GetMessage("SM_SORT_ORDER_DESC")), |
||||||
|
), |
||||||
|
'CNT_TAGS' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_CNT_TAGS"), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => '', |
||||||
|
), |
||||||
|
"PRODUCT_COUNT" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_PRODUCT_COUNT"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "N", |
||||||
|
), |
||||||
|
"GENERATING_TAGS" => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
"NAME" => GetMessage("SM_GENERATING_TAGS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "N", |
||||||
|
), |
||||||
|
"CACHE_TIME" => array( |
||||||
|
"DEFAULT" => 36000000, |
||||||
|
), |
||||||
|
"CACHE_GROUPS" => array( |
||||||
|
"PARENT" => "CACHE_SETTINGS", |
||||||
|
"NAME" => GetMessage("SM_CACHE_GROUPS"), |
||||||
|
"TYPE" => "CHECKBOX", |
||||||
|
"DEFAULT" => "Y", |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,261 @@ |
|||||||
|
<? |
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { |
||||||
|
die(); |
||||||
|
} |
||||||
|
|
||||||
|
use Bitrix\Iblock\Template\Engine; |
||||||
|
use Bitrix\Iblock\Template\Entity\Section; |
||||||
|
use Bitrix\Main\Data\Cache; |
||||||
|
use Bitrix\Main\Loader; |
||||||
|
use Bitrix\Main\Text\Encoding; |
||||||
|
use Sotbit\Seometa\Orm\ConditionTable; |
||||||
|
use Sotbit\Seometa\Orm\SeometaUrlTable; |
||||||
|
use Sotbit\Seometa\SeoMetaMorphy; |
||||||
|
use Sotbit\Seometa\Tags; |
||||||
|
|
||||||
|
global $SeoMetaWorkingConditions; |
||||||
|
global $APPLICATION; |
||||||
|
global $USER; |
||||||
|
|
||||||
|
$moduleId = 'sotbit.seometa'; |
||||||
|
if (!Loader::includeModule($moduleId) || !Loader::includeModule('iblock')) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arParams['CACHE_TIME'])) { |
||||||
|
$arParams['CACHE_TIME'] = '36000000'; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arParams['SORT'])) { |
||||||
|
$arParams['SORT'] = 'NAME'; |
||||||
|
} |
||||||
|
|
||||||
|
$cacheTime = $arParams['CACHE_TIME']; |
||||||
|
$cache_id = serialize([ |
||||||
|
$arParams, |
||||||
|
$SeoMetaWorkingConditions, |
||||||
|
$APPLICATION->GetCurPage(false), |
||||||
|
$arParams['CACHE_GROUPS'] === 'N' ? false : $USER->GetGroups() |
||||||
|
]); |
||||||
|
$cacheDir = '/' . $moduleId . '.tags/'; |
||||||
|
$cache = Cache::createInstance(); |
||||||
|
$Tags = []; |
||||||
|
|
||||||
|
if ($cache->initCache($cacheTime, $cache_id, $cacheDir)) { |
||||||
|
$Tags = $cache->getVars(); |
||||||
|
} elseif ($cache->startDataCache()) { |
||||||
|
$strict_relinking = false; |
||||||
|
$Conditions = []; |
||||||
|
$sections = Tags::findNeedSections($arParams['SECTION_ID'], $arParams['INCLUDE_SUBSECTIONS']); // list of all sections |
||||||
|
$SectionConditions = ConditionTable::GetConditionsBySections($sections); // list of all conditions by sections |
||||||
|
|
||||||
|
$tagsCategory = \Sotbit\Seometa\Orm\CategoryTagsTable::getById(1)->fetch(); |
||||||
|
|
||||||
|
// if condition is active |
||||||
|
if ($SeoMetaWorkingConditions && is_array($SeoMetaWorkingConditions)) { |
||||||
|
foreach ($SeoMetaWorkingConditions as $SeoMetaWorkingCondition) { |
||||||
|
$wasSections = false; |
||||||
|
// if among all conditions by sections there is one that is active |
||||||
|
if ($SectionConditions[$SeoMetaWorkingCondition]) { |
||||||
|
if ($SectionConditions[$SeoMetaWorkingCondition]['STRICT_RELINKING'] == 'Y') { |
||||||
|
$strict_relinking = true; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($SectionConditions[$SeoMetaWorkingCondition]['SECTIONS'])) { |
||||||
|
$wasSections = true; |
||||||
|
} else { |
||||||
|
unset($SectionConditions[$SeoMetaWorkingCondition]); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$WorkingConditions = ConditionTable::GetConditionsFromWorkingConditions($SeoMetaWorkingConditions); // conditions selected in relinking |
||||||
|
if (is_array($SectionConditions) && is_array($WorkingConditions)) { |
||||||
|
if (!$strict_relinking) { |
||||||
|
$Conditions = $SectionConditions; |
||||||
|
} |
||||||
|
|
||||||
|
// merge conditions selected in relinking with other |
||||||
|
foreach ($WorkingConditions as $key => $WorkingCondition) { |
||||||
|
$Conditions[$key] = $WorkingCondition; |
||||||
|
} |
||||||
|
} elseif (is_array($SectionConditions)) { |
||||||
|
$Conditions = $SectionConditions; |
||||||
|
} elseif ($WorkingConditions) { |
||||||
|
$Conditions = $WorkingConditions; |
||||||
|
} |
||||||
|
|
||||||
|
$TagsObject = new Tags(); |
||||||
|
$currentUrl = $APPLICATION->GetCurPage(false); |
||||||
|
|
||||||
|
//<editor-fold desc="Exclude condition, if in enable HIDE_IN_SECTION and current url is section url"> |
||||||
|
$sectionUrl = CIBlockSection::GetList( |
||||||
|
[], |
||||||
|
['ID' => $arParams['SECTION_ID']], |
||||||
|
false, |
||||||
|
['SECTION_PAGE_URL'] |
||||||
|
)->GetNext()['SECTION_PAGE_URL']; |
||||||
|
|
||||||
|
if ($sectionUrl == $currentUrl) { |
||||||
|
$Conditions = array_filter($Conditions, fn($item) => !($item['HIDE_IN_SECTION'] == 'Y' && in_array($arParams['SECTION_ID'], $item['SECTIONS']))); |
||||||
|
} |
||||||
|
|
||||||
|
$filterResult = CSeoMeta::getFilterResult(); |
||||||
|
|
||||||
|
//</editor-fold> |
||||||
|
if ($arParams['GENERATING_TAGS'] == 'Y') { |
||||||
|
$Tags = $TagsObject->GenerateTags($Conditions, array_keys($Conditions)); |
||||||
|
if(is_array($Tags)) { |
||||||
|
foreach ($Tags as &$tag) { |
||||||
|
$tag = \Sotbit\Seometa\Orm\CategoryTagsTable::fillCategoryTags($Conditions[$tag['CONDITION_ID']], $tag, $tagsCategory); |
||||||
|
} |
||||||
|
unset($tag); |
||||||
|
} |
||||||
|
} else { |
||||||
|
$Tags = []; |
||||||
|
$morphyObject = SeoMetaMorphy::morphyLibInit(); |
||||||
|
foreach ($Conditions as $item) { |
||||||
|
if ($item['TAG']) { |
||||||
|
$arrTags = SeometaUrlTable::getAllByCondition($item['ID']); |
||||||
|
foreach ($arrTags as &$arrTag) { |
||||||
|
$arrTag['PROPERTIES'] = unserialize($arrTag['PROPERTIES']); |
||||||
|
\CSeoMetaTagsProperty::$params = $arrTag['PROPERTIES']; |
||||||
|
$sku = new Section($arrTag['section_id']); |
||||||
|
$title = Engine::process($sku, SeoMetaMorphy::prepareForMorphy($item['TAG'])); |
||||||
|
|
||||||
|
if (!empty($title)) { |
||||||
|
$arrTag['TITLE'] = SeoMetaMorphy::convertMorphy($title, $morphyObject);; |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($arrTag['TITLE'])) { |
||||||
|
$arrTag['TITLE'] = $title; |
||||||
|
} |
||||||
|
|
||||||
|
$arrTag['URL'] = $arrTag['ACTIVE'] == 'Y' ? $arrTag['NEW_URL'] : $arrTag['REAL_URL']; |
||||||
|
$arrTag = \Sotbit\Seometa\Orm\CategoryTagsTable::fillCategoryTags($Conditions[$arrTag['CONDITION_ID']], $arrTag, $tagsCategory); |
||||||
|
} |
||||||
|
|
||||||
|
if (is_array($arrTags)) { |
||||||
|
$Tags = array_merge($Tags, $arrTags); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (empty($Tags)) { |
||||||
|
$Tags = []; |
||||||
|
$cache->endDataCache($Tags); |
||||||
|
return $this->IncludeComponentTemplate(); |
||||||
|
} |
||||||
|
|
||||||
|
if ($strict_relinking) { |
||||||
|
foreach ($Tags as $key => $tag) { |
||||||
|
if ($tag['URL'] == $currentUrl) { |
||||||
|
unset($Tags[$key]); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$Tags = array_values($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
$likeFilter = \Bitrix\Main\Config\Option::get($moduleId, 'TAGS_FILTER', 'N', SITE_ID); |
||||||
|
|
||||||
|
$arFilterResult = []; |
||||||
|
$arFilterRangeResult = []; |
||||||
|
if ($likeFilter === 'Y') { |
||||||
|
foreach ($filterResult['ITEMS'] as $itemKey => $item) { |
||||||
|
foreach ($item['VALUES'] as $key => $value) { |
||||||
|
if ($key === 'MAX' || $key === 'MIN') { |
||||||
|
if ($item['CODE']) { |
||||||
|
$arFilterRangeResult[$item['CODE']][$key] = $value['VALUE']; |
||||||
|
} else { |
||||||
|
$arFilterRangeResult[$itemKey][$key] = $value['VALUE']; |
||||||
|
} |
||||||
|
|
||||||
|
} else { |
||||||
|
$arFilterResult[$item['CODE']][] = $value['LIST_VALUE_NAME'] ?: ($value['LIST_VALUE'] ?: $value['VALUE']); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($Tags)) { |
||||||
|
foreach ($Tags as $keyTag => $tag) { |
||||||
|
if ($tag['SITE_ID'] !== SITE_ID) { |
||||||
|
unset($Tags[$keyTag]); |
||||||
|
} |
||||||
|
|
||||||
|
if ($likeFilter === 'Y' && ($arFilterResult || $arFilterRangeResult)) { |
||||||
|
$unset = true; |
||||||
|
foreach ($tag['PROPERTIES'] as $code => $prop) { |
||||||
|
if ($arFilterRangeResult[$code]) { |
||||||
|
foreach ($prop as $value) { |
||||||
|
if ((float)$arFilterRangeResult[$code]['MIN'] <= (float)$value && (float)$arFilterRangeResult[$code]['MAX'] >= (float)$value) { |
||||||
|
$unset = false; |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($arFilterResult[$code]) { |
||||||
|
$prop = htmlspecialcharsback($prop); |
||||||
|
if (array_intersect($prop, $arFilterResult[$code])) { |
||||||
|
$unset = false; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($unset) { |
||||||
|
unset($Tags[$keyTag]); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
$Tags = array_values($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
$currentUrl = CSeoMeta::encodeRealUrl($currentUrl); |
||||||
|
|
||||||
|
if ($arParams['GENERATING_TAGS'] == 'Y') { |
||||||
|
$Tags = $TagsObject->ReplaceChpuUrls($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
$curPage = array_search( |
||||||
|
$currentUrl, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'URL')) |
||||||
|
); |
||||||
|
if ($curPage === false) { |
||||||
|
$curPage = array_search( |
||||||
|
$currentUrl, |
||||||
|
array_combine(array_keys($Tags), array_column($Tags, 'REAL_URL')) |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
if ($curPage !== false) { |
||||||
|
unset($Tags[$curPage]); |
||||||
|
} |
||||||
|
|
||||||
|
$Tags = $TagsObject->SortTags($Tags, $arParams['SORT'], $arParams['SORT_ORDER']); |
||||||
|
if($componentTemplate !== 'tagscategory') { |
||||||
|
$Tags = $TagsObject->CutTags($Tags, $arParams['CNT_TAGS']); |
||||||
|
} else { |
||||||
|
$arParams['CNT_TAGS'] = $arParams['CNT_TAGS'] ?: 10; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
unset($Conditions); |
||||||
|
$cache->endDataCache($Tags); |
||||||
|
} |
||||||
|
|
||||||
|
if ($arParams['AJAX'] === 'Y') { |
||||||
|
$arResult['ITEMS'] = array_map(function ($arrVal) { |
||||||
|
$arrVal['URL'] = $arrVal['URL'] . '?ajaxTag=1'; |
||||||
|
return $arrVal; |
||||||
|
}, $Tags); |
||||||
|
} else { |
||||||
|
$arResult['ITEMS'] = $Tags; |
||||||
|
} |
||||||
|
|
||||||
|
unset($Tags); |
||||||
|
$this->IncludeComponentTemplate(); |
||||||
|
?> |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_NAME"] = "Облако тегов"; |
||||||
|
$MESS["MAIN_MENU_NAME_SOTBIT"] = "SEO умного фильтра"; |
||||||
|
$MESS["MAIN_GROUP_NAME_SOTBIT"] = "Сотбит"; |
||||||
|
$MESS["SM_DESCRIPTION"] = "Выводит теги для раздела каталога"; |
||||||
|
?> |
@ -0,0 +1,24 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_IBLOCK_TYPE"] = "Тип инфоблока"; |
||||||
|
$MESS["SM_IBLOCK_IBLOCK"] = "Инфоблок"; |
||||||
|
$MESS["SM_SECTION_ID"] = "Раздел"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS"] = "Показывать теги подразделов раздела"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ALL"] = "всех подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_ACTIVE"] = "активных подразделов"; |
||||||
|
$MESS["SM_INCLUDE_SUBSECTIONS_NO"] = "не показывать"; |
||||||
|
$MESS["SM_CACHE_GROUPS"] = "Учитывать права доступа"; |
||||||
|
$MESS["CACHE_TYPE"] = "Тип кеширования"; |
||||||
|
$MESS["CACHE_TIME"] = "Время кеширования (сек.)"; |
||||||
|
$MESS["SM_SORT"] = "Тип сортировки тегов"; |
||||||
|
$MESS["SM_SORT_NAME"] = "По названию"; |
||||||
|
$MESS["SM_SORT_CONDITION"] = "По индексу сортировки условий"; |
||||||
|
$MESS["SM_SORT_URL_SORT"] = "По индексу сортировки ЧПУ"; |
||||||
|
$MESS["SM_SORT_PRODUCT_COUNT"] = "По количеству товаров по ссылке"; |
||||||
|
$MESS["SM_SORT_RANDOM"] = "Случайно"; |
||||||
|
$MESS["SM_SORT_ORDER"] = "Порядок сортировки"; |
||||||
|
$MESS["SM_SORT_ORDER_ASC"] = "По возрастанию"; |
||||||
|
$MESS["SM_SORT_ORDER_DESC"] = "По убыванию"; |
||||||
|
$MESS["SM_CNT_TAGS"] = "Количество выводимых тегов"; |
||||||
|
$MESS["SM_PRODUCT_COUNT"] = "Выводить количество товаров по ссылке (не учитывается доступность товаров)"; |
||||||
|
$MESS["SM_GENERATING_TAGS"] = "Перегенерировать теги"; |
||||||
|
?> |
@ -0,0 +1,19 @@ |
|||||||
|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
if($arResult['ITEMS']) |
||||||
|
{ |
||||||
|
foreach($arResult['ITEMS'] as $Item) |
||||||
|
{ |
||||||
|
if($Item['TITLE'] && $Item['URL']) { |
||||||
|
$count = $arParams['PRODUCT_COUNT'] == 'Y' ? ' (' . $Item['PRODUCT_COUNT'] . ')' : ''; |
||||||
|
?> |
||||||
|
<div class="sotbit-seometa-tags-wrapper"> |
||||||
|
<div class="sotbit-seometa-tag"> |
||||||
|
<a class="sotbit-seometa-tag-link" href="<?=$Item['URL'] ?>" title="<?=$Item['TITLE'] . $count ?>"><?=$Item['TITLE'] . $count?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,13 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
|
||||||
|
$arTemplateParameters = array( |
||||||
|
'SORT_ORDER_TAGS' => array( |
||||||
|
"PARENT" => "BASE", |
||||||
|
'NAME' => GetMessage('SM_SORT_ORDER'), |
||||||
|
'TYPE' => "LIST", |
||||||
|
"VALUES" => array('asc' => GetMessage("SM_SORT_ORDER_ASC"), 'desc' => GetMessage("SM_SORT_ORDER_DESC")), |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,5 @@ |
|||||||
|
<? |
||||||
|
$MESS['SM_SORT_ORDER'] = 'Порядок сортировки категорий тегов'; |
||||||
|
$MESS['SM_SORT_ORDER_ASC'] = 'По возрастанию'; |
||||||
|
$MESS['SM_SORT_ORDER_DESC'] = 'По убыванию'; |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
$MESS['SEO_META_TAGS_MORE'] = 'Показать больше'; |
||||||
|
$MESS['SEO_META_TAGS_LESS'] = 'Скрыть'; |
||||||
|
?> |
@ -0,0 +1,31 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
$arCategory = []; |
||||||
|
|
||||||
|
foreach ($arResult['ITEMS'] as $item) { |
||||||
|
if ($arCategory[$item['TAGS_SECTION_ID']]) { |
||||||
|
$arCategory[$item['TAGS_SECTION_ID']]['ITEMS'][] = $item; |
||||||
|
} else { |
||||||
|
$arCategory[$item['TAGS_SECTION_ID'] ?: 1] = [ |
||||||
|
'TITLE' => $item['TAGS_SECTION_NAME'], |
||||||
|
'SORT' => $item['TAGS_SECTION_SORT'], |
||||||
|
'ITEMS' => [$item], |
||||||
|
]; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if($arParams['SORT_ORDER_TAGS']) { |
||||||
|
$sort = $arParams['SORT_ORDER_TAGS']; |
||||||
|
} |
||||||
|
|
||||||
|
if($sort === 'asc') { |
||||||
|
uasort($arCategory, function ($a, $b) { |
||||||
|
return $a['SORT'] <=> $b['SORT']; |
||||||
|
}); |
||||||
|
} else { |
||||||
|
uasort($arCategory, function ($a, $b) { |
||||||
|
return $b['SORT'] <=> $a['SORT']; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
$arResult['CATEGORY_TAGS'] = $arCategory; |
@ -0,0 +1,43 @@ |
|||||||
|
;(function () { |
||||||
|
CategoryTags = function (params) { |
||||||
|
this.tagsWrapper = params.tagsWrapper; |
||||||
|
this.showMoreButton = params.showMoreButton; |
||||||
|
this.categoryTags = params.categoryTags; |
||||||
|
this.hideTag = params.hideTag; |
||||||
|
this.expanded = params.expanded; |
||||||
|
this.init(); |
||||||
|
}; |
||||||
|
|
||||||
|
CategoryTags.prototype.init = function () { |
||||||
|
const tagsWrapper = document.getElementById(this.tagsWrapper); |
||||||
|
const showMoreButton = document.getElementById(this.showMoreButton); |
||||||
|
const hiddenTags = document.querySelectorAll(this.hideTag); |
||||||
|
const categoryTags = document.querySelectorAll(this.categoryTags); |
||||||
|
let startHeight = 0; |
||||||
|
|
||||||
|
if (tagsWrapper) { |
||||||
|
tagsWrapper.style.height = startHeight = tagsWrapper.offsetHeight + 'px'; |
||||||
|
} |
||||||
|
|
||||||
|
if(showMoreButton) { |
||||||
|
showMoreButton.addEventListener('click', async () => { |
||||||
|
tagsWrapper.classList.toggle(this.expanded); |
||||||
|
if (tagsWrapper.classList.contains(this.expanded)) { |
||||||
|
await hiddenTags.forEach(tag => tag.classList.remove('hide-tag')); |
||||||
|
let height = 0; |
||||||
|
await categoryTags.forEach((category) => { |
||||||
|
height += category.offsetHeight; |
||||||
|
}); |
||||||
|
showMoreButton.textContent = BX.message('less_btn'); |
||||||
|
tagsWrapper.style.height = height + 'px'; |
||||||
|
} else { |
||||||
|
showMoreButton.textContent = BX.message('more_btn'); |
||||||
|
tagsWrapper.style.height = startHeight; |
||||||
|
setTimeout(() => { |
||||||
|
hiddenTags.forEach(tag => tag.classList.add('hide-tag')); |
||||||
|
}, 100) |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}; |
||||||
|
})(); |
@ -0,0 +1,44 @@ |
|||||||
|
.sotbit-seometa-tags-common-wrapper { |
||||||
|
padding: 24px; |
||||||
|
background: #F8F9FA; |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper { |
||||||
|
transition: height 0.5s ease-in-out; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper.expanded { |
||||||
|
transition: height 0.5s ease-in-out; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-wrapper-category { |
||||||
|
overflow: hidden; |
||||||
|
display: flex; |
||||||
|
width: 100%; |
||||||
|
flex-wrap: wrap; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tags-padding { |
||||||
|
padding-right: 8px; |
||||||
|
margin-bottom: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.hide-tag { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-tag-link { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-btn-more { |
||||||
|
margin-top: 16px; |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.sotbit-seometa-btn-more.show-btn { |
||||||
|
display: block; |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
<? use Bitrix\Main\Localization\Loc; |
||||||
|
|
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
if ($arResult['CATEGORY_TAGS']) { ?> |
||||||
|
<div class="sotbit-seometa-tags-common-wrapper"> |
||||||
|
<div class="sotbit-seometa-tags-wrapper" id="tagsWrapper"> |
||||||
|
<? |
||||||
|
$i = 1; |
||||||
|
foreach ($arResult['CATEGORY_TAGS'] as $cat_tag) { |
||||||
|
?> |
||||||
|
<div class="sotbit-seometa-tags-wrapper-category <?= $i > $arParams['CNT_TAGS'] ? 'hide-tag' : '' ?>">
|
||||||
|
<span class="sotbit-seometa-tags-padding"><?= $cat_tag['TITLE'] ?>: </span>
|
||||||
|
<? foreach ($cat_tag['ITEMS'] as $item) { |
||||||
|
$count = $arParams['PRODUCT_COUNT'] == 'Y' ? ' (' . $item['PRODUCT_COUNT'] . ')' : ''; ?> |
||||||
|
<div class="sotbit-seometa-tags-padding <?= $i > $arParams['CNT_TAGS'] ? 'hide-tag' : '' ?>">
|
||||||
|
<a class="sotbit-seometa-tag-link" href="<?= $item['URL'] ?>"
|
||||||
|
title="<?= $item['TITLE'] . $count ?>">
|
||||||
|
<?= $item['TITLE'] . $count ?> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
$i++; |
||||||
|
} |
||||||
|
?> |
||||||
|
</div> |
||||||
|
<? } ?> |
||||||
|
</div> |
||||||
|
<div class="sotbit-seometa-btn-more <?= ($i - 1) > $arParams['CNT_TAGS'] ? 'show-btn' : '' ?>">
|
||||||
|
<a class="sotbit-seometa-tag-link" id="showMoreButton" |
||||||
|
href="javascript:void(0);"><?= Loc::getMessage('SEO_META_TAGS_MORE') ?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<? |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<script> |
||||||
|
BX.message({ |
||||||
|
'more_btn': '<?=Loc::getMessage('SEO_META_TAGS_MORE')?>',
|
||||||
|
'less_btn': '<?=Loc::getMessage('SEO_META_TAGS_LESS')?>',
|
||||||
|
}); |
||||||
|
|
||||||
|
new CategoryTags({ |
||||||
|
tagsWrapper: 'tagsWrapper', |
||||||
|
showMoreButton: 'showMoreButton', |
||||||
|
categoryTags: '.sotbit-seometa-tags-wrapper-category', |
||||||
|
hideTag: '.hide-tag', |
||||||
|
expanded: 'expanded', |
||||||
|
cntTags: <?= (int) $arParams['CNT_TAGS'] ?>,
|
||||||
|
}); |
||||||
|
</script> |
@ -0,0 +1,14 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
$arComponentDescription = array( |
||||||
|
"NAME" => GetMessage("SM_NAME"), |
||||||
|
"DESCRIPTION" => GetMessage("SM_DESCRIPTION"), |
||||||
|
"ICON" => "/images/icon.png", |
||||||
|
"PATH" => array( |
||||||
|
"ID" => GetMessage("MAIN_GROUP_NAME_SOTBIT"), |
||||||
|
"CHILD" => array( |
||||||
|
"ID" => "sotbit.seo.meta", |
||||||
|
"NAME" => GetMessage("MAIN_MENU_NAME_SOTBIT"), |
||||||
|
) |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,44 @@ |
|||||||
|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
if (!CModule::IncludeModule("iblock")) |
||||||
|
return; |
||||||
|
$arIBlockType = CIBlockParameters::GetIBlockTypes(); |
||||||
|
$rsIBlock = CIBlock::GetList( |
||||||
|
array( |
||||||
|
"sort" => "asc", |
||||||
|
), |
||||||
|
array( |
||||||
|
"TYPE" => $arCurrentValues["IBLOCK_TYPE"], |
||||||
|
"ACTIVE" => "Y", |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
while ($arr = $rsIBlock->Fetch()) |
||||||
|
$arIBlock[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"]; |
||||||
|
|
||||||
|
$arComponentParameters = array( |
||||||
|
"GROUPS" => array(), |
||||||
|
"PARAMETERS" => array( |
||||||
|
"FILTER_NAME" => array( |
||||||
|
"PARENT" => "DATA_SOURCE", |
||||||
|
"NAME" => GetMessage("SM_FILTER_NAME"), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => '', |
||||||
|
), |
||||||
|
"SECTION_ID" => array( |
||||||
|
"PARENT" => "DATA_SOURCE", |
||||||
|
"NAME" => GetMessage("SM_SECTION_ID"), |
||||||
|
"TYPE" => "STRING", |
||||||
|
"DEFAULT" => '={$_REQUEST["SECTION_ID"]}', |
||||||
|
), |
||||||
|
"CACHE_TIME" => array( |
||||||
|
"DEFAULT" => 36000000, |
||||||
|
), |
||||||
|
"KOMBOX_FILTER" => array( |
||||||
|
'NAME' => GetMessage('USE_KOMBOX_FILTER'), |
||||||
|
'TYPE' => 'CHECKBOX', |
||||||
|
'DEFAULT' => 'N', |
||||||
|
'REFRESH' => 'Y', |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,710 @@ |
|||||||
|
<? |
||||||
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
|
||||||
|
use Bitrix\Iblock\Template\Engine; |
||||||
|
use Bitrix\Iblock\Template\Entity\Section; |
||||||
|
use Bitrix\Main\Config\Option; |
||||||
|
use Bitrix\Main\Context; |
||||||
|
use Bitrix\Main\Loader; |
||||||
|
use Bitrix\Main\Page\Asset; |
||||||
|
use Bitrix\Main\Text\Emoji; |
||||||
|
use Sotbit\Seometa\Helper\OGraphTWCard; |
||||||
|
use Sotbit\Seometa\Orm\OpengraphTable; |
||||||
|
use Sotbit\Seometa\SeoMetaMorphy; |
||||||
|
use Sotbit\Seometa\Orm\SeometaNotConfiguredPagesTable; |
||||||
|
use Sotbit\Seometa\Orm\SeometaUrlTable; |
||||||
|
use Sotbit\Seometa\Orm\TwitterCardTable; |
||||||
|
|
||||||
|
$moduleId = "sotbit.seometa"; |
||||||
|
|
||||||
|
if (!Loader::includeModule($moduleId) || !Loader::includeModule('iblock')) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
global $USER; |
||||||
|
global $APPLICATION; |
||||||
|
global $sotbitSeoMetaTitle; //Meta title |
||||||
|
global $sotbitSeoMetaKeywords; //Meta keywords |
||||||
|
global $sotbitSeoMetaDescription; //Meta description |
||||||
|
global $sotbitFilterResult; //Filter result |
||||||
|
global $sotbitSeoMetaH1; //for set h1 |
||||||
|
global $sotbitSeoMetaBottomDesc; //for set bottom description |
||||||
|
global $sotbitSeoMetaTopDesc; //for set top description |
||||||
|
global $sotbitSeoMetaAddDesc; //for set additional description |
||||||
|
global $sotbitSeoMetaFile; |
||||||
|
global $sotbitSeoMetaBreadcrumbLink; |
||||||
|
global $sotbitSeoMetaBreadcrumbTitle; |
||||||
|
global ${$arParams['FILTER_NAME']}; |
||||||
|
global $issetCondition; |
||||||
|
global $SeoMetaWorkingConditions; |
||||||
|
|
||||||
|
$SeoMetaWorkingConditions = []; |
||||||
|
|
||||||
|
CSeometa::excludeFilterParams(${$arParams['FILTER_NAME']}); |
||||||
|
|
||||||
|
if ( |
||||||
|
Option::get($moduleId, "NO_INDEX_" . SITE_ID, "N") != "N" |
||||||
|
&& !empty(${$arParams['FILTER_NAME']}) |
||||||
|
) { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'noindex, nofollow'); |
||||||
|
} |
||||||
|
|
||||||
|
$paginationText = ""; |
||||||
|
if ($_REQUEST['PAGEN_1']) { |
||||||
|
$pagOption = Option::get($moduleId, "PAGINATION_TEXT_" . SITE_ID); |
||||||
|
if ($pagOption) { |
||||||
|
$paginationText = " " . str_replace('%N%', $_REQUEST['PAGEN_1'], $pagOption); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$str = $APPLICATION->GetCurPage(); |
||||||
|
if ($arParams['KOMBOX_FILTER'] == 'Y' && CModule::IncludeModule('kombox.filter')) { |
||||||
|
$str = CKomboxFilter::GetCurPageParam(); |
||||||
|
$str = explode("?", $str); |
||||||
|
$str = $str[0]; |
||||||
|
} |
||||||
|
|
||||||
|
$str = CSeoMeta::encodeRealUrl($str); |
||||||
|
|
||||||
|
$metaData = SeometaUrlTable::getByRealUrl($str, SITE_ID); |
||||||
|
if(empty($metaData)) { |
||||||
|
$metaData = SeometaUrlTable::getByRealUrl(preg_replace('/index.php$/', '', $str), SITE_ID); |
||||||
|
} |
||||||
|
|
||||||
|
if(empty($metaData)) { |
||||||
|
$requestGet = Context::getCurrent()->getRequest()->getQueryList()->toArray(); |
||||||
|
$pageParams = array_keys($requestGet); |
||||||
|
$str = $APPLICATION->GetCurPageParam( |
||||||
|
'', |
||||||
|
$pageParams |
||||||
|
); |
||||||
|
$str = CSeoMeta::encodeRealUrl($str); |
||||||
|
$metaData = SeometaUrlTable::getByRealUrl($str, SITE_ID); |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($metaData['NEW_URL'])) { |
||||||
|
$APPLICATION->SetCurPage($metaData['NEW_URL']); |
||||||
|
} |
||||||
|
|
||||||
|
CSeoMeta::SetFilterResult($sotbitFilterResult, $arParams['SECTION_ID']); //filter result for class |
||||||
|
CSeoMeta::AddAdditionalFilterResults(${$arParams['FILTER_NAME']}, $arParams['KOMBOX_FILTER']); |
||||||
|
CSeoMeta::FilterCheck(); |
||||||
|
|
||||||
|
if ($this->StartResultCache($arParams["CACHE_TIME"] ?: false, |
||||||
|
$arParams["CACHE_GROUPS"] ? $USER->GetGroups() : false) |
||||||
|
) { |
||||||
|
$arResult = CSeoMeta::getRules($arParams); //list of conditions for current section |
||||||
|
$this->endResultCache(); |
||||||
|
} |
||||||
|
|
||||||
|
$sku = new Section($arParams['SECTION_ID']); |
||||||
|
$morphyObject = SeoMetaMorphy::morphyLibInit(); |
||||||
|
$curReq = Context::getCurrent()->getRequest(); |
||||||
|
$protocol = $curReq->isHttps() ? 'https://' : 'http://'; |
||||||
|
$port = $curReq->getServerPort() == '80' ? ':' . $curReq->getServerPort() : ''; |
||||||
|
$classEmojiExist = class_exists('\Bitrix\Main\Text\Emoji'); |
||||||
|
|
||||||
|
if(empty($arResult) && !empty($metaData)){ |
||||||
|
|
||||||
|
$APPLICATION->SetPageProperty("robots", 'index, follow'); |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['TITLE'] = Emoji::decode($result['TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['TITLE'])); |
||||||
|
$sotbitSeoMetaTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTitle, $morphyObject); |
||||||
|
$sotbitSeoMetaTitle .= $paginationText ?: ''; |
||||||
|
$APPLICATION->SetPageProperty("title", $sotbitSeoMetaTitle); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_KEYWORDS_REPLACE'] == 'Y') { |
||||||
|
$result['KEYWORDS'] = $metaData['SEOMETA_DATA']['ELEMENT_KEYWORDS']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['KEYWORDS'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['KEYWORDS'] = Emoji::decode($result['KEYWORDS']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaKeywords = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['KEYWORDS'])); |
||||||
|
$sotbitSeoMetaKeywords = SeoMetaMorphy::convertMorphy($sotbitSeoMetaKeywords, $morphyObject); |
||||||
|
$APPLICATION->SetPageProperty("keywords", $sotbitSeoMetaKeywords); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_DESCRIPTION_REPLACE'] == 'Y') { |
||||||
|
$result['DESCRIPTION'] = $metaData['SEOMETA_DATA']['ELEMENT_DESCRIPTION']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['DESCRIPTION'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['DESCRIPTION'] = Emoji::decode($result['DESCRIPTION']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaDescription = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['DESCRIPTION'])); |
||||||
|
$sotbitSeoMetaDescription = SeoMetaMorphy::convertMorphy($sotbitSeoMetaDescription, $morphyObject); |
||||||
|
$sotbitSeoMetaDescription .= $paginationText ?: ''; |
||||||
|
$APPLICATION->SetPageProperty("description", $sotbitSeoMetaDescription); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_PAGE_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['PAGE_TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_PAGE_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['PAGE_TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['PAGE_TITLE'] = Emoji::decode($result['PAGE_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaH1 = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['PAGE_TITLE'])); |
||||||
|
$arResult['ELEMENT_H1'] = $sotbitSeoMetaH1 .= $paginationText ?: ''; |
||||||
|
$sotbitSeoMetaH1 = SeoMetaMorphy::convertMorphy($sotbitSeoMetaH1, $morphyObject); |
||||||
|
$APPLICATION->SetTitle($sotbitSeoMetaH1); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_BREADCRUMB_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['BREADCRUMB_TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_BREADCRUMB_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['BREADCRUMB_TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['BREADCRUMB_TITLE'] = Emoji::decode($result['BREADCRUMB_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$url = $protocol . $curReq->getServer()->getServerName() . $port . $curReq->getRequestUri(); |
||||||
|
$sotbitSeoMetaBreadcrumbLink = $url; |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['BREADCRUMB_TITLE'])); |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBreadcrumbTitle, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaBreadcrumbLink)) { |
||||||
|
$arResult['BREADCRUMB_TITLE'] = $sotbitSeoMetaBreadcrumbTitle; |
||||||
|
$arResult['BREADCRUMB_LINK'] = $url; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_TOP_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_TOP_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_TOP_DESC']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['ELEMENT_TOP_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_TOP_DESC'] = Emoji::decode($result['ELEMENT_TOP_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTopDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_TOP_DESC']))); |
||||||
|
$sotbitSeoMetaTopDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTopDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaTopDesc)) { |
||||||
|
if ($result['ELEMENT_TOP_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaTopDesc = htmlspecialchars($sotbitSeoMetaTopDesc); |
||||||
|
} |
||||||
|
$arResult['ELEMENT_TOP_DESC'] = $sotbitSeoMetaTopDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_BOTTOM_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_BOTTOM_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_BOTTOM_DESC']; |
||||||
|
} |
||||||
|
if (!empty($result['ELEMENT_BOTTOM_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_BOTTOM_DESC'] = Emoji::decode($result['ELEMENT_BOTTOM_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaBottomDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_BOTTOM_DESC']))); |
||||||
|
$sotbitSeoMetaBottomDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBottomDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaBottomDesc)) { |
||||||
|
if ($result['ELEMENT_BOTTOM_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaBottomDesc = htmlspecialchars($sotbitSeoMetaBottomDesc); |
||||||
|
} |
||||||
|
|
||||||
|
$arResult['ELEMENT_BOTTOM_DESC'] = $sotbitSeoMetaBottomDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_ADD_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_ADD_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_ADD_DESC']; |
||||||
|
} |
||||||
|
if (!empty($result['ELEMENT_ADD_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_ADD_DESC'] = Emoji::decode($result['ELEMENT_ADD_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaAddDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_ADD_DESC']))); |
||||||
|
$sotbitSeoMetaAddDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaAddDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaAddDesc)) { |
||||||
|
if ($result['ELEMENT_ADD_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaAddDesc = htmlspecialchars($sotbitSeoMetaAddDesc); |
||||||
|
} |
||||||
|
$arResult['ELEMENT_ADD_DESC'] = $sotbitSeoMetaAddDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_FILE_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_FILE'] = $metaData['SEOMETA_DATA']['ELEMENT_FILE']; |
||||||
|
} |
||||||
|
if (intval($result['ELEMENT_FILE']) > 0) { |
||||||
|
$fileArray = CFile::GetFileArray($result['ELEMENT_FILE']); |
||||||
|
$arResult['ELEMENT_FILE']['SRC'] = $fileArray['SRC']; |
||||||
|
$arResult['ELEMENT_FILE']['DESCRIPTION'] = $fileArray['DESCRIPTION']; |
||||||
|
$sotbitSeoMetaFile = '<img src="' . $arResult['ELEMENT_FILE']['SRC'] . '" alt="' . $arResult['ELEMENT_FILE']['DESCRIPTION'] . '">'; |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
}else{ |
||||||
|
$COND = []; |
||||||
|
foreach ($arResult as $key => $condition) { |
||||||
|
//get conditions and metatags |
||||||
|
$COND[$key]['RULES'] = unserialize($condition['RULE']); |
||||||
|
$COND[$key]['META'] = unserialize($condition['META']); |
||||||
|
$COND[$key]['ID'] = $condition['ID']; |
||||||
|
$COND[$key]['NO_INDEX'] = $condition['NO_INDEX']; |
||||||
|
$COND[$key]['STRONG'] = $condition['STRONG']; |
||||||
|
} |
||||||
|
|
||||||
|
$issetCondition = false; |
||||||
|
$results = []; |
||||||
|
foreach ($COND as $rule) //get metatags if condition true |
||||||
|
{ |
||||||
|
if ($res = CSeoMeta::SetMetaCondition($rule, $arParams['SECTION_ID'], $condition['INFOBLOCK'])) { |
||||||
|
$results[] = $res; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$sectionParams = CIBlockSection::GetList( |
||||||
|
[], |
||||||
|
['ID' => $arParams['SECTION_ID']], |
||||||
|
false, |
||||||
|
['SECTION_PAGE_URL'] |
||||||
|
)->GetNext(); |
||||||
|
|
||||||
|
if ($results && is_array($results)) { |
||||||
|
foreach ($results as $result) //set metatags |
||||||
|
{ |
||||||
|
//INDEX |
||||||
|
if ($result['NO_INDEX'] == 'Y') { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'noindex, nofollow'); |
||||||
|
} elseif ($result['NO_INDEX'] == 'N') { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'index, follow'); |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['TITLE'] = Emoji::decode($result['TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['TITLE'])); |
||||||
|
$sotbitSeoMetaTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTitle, $morphyObject); |
||||||
|
$sotbitSeoMetaTitle .= $paginationText ?: ''; |
||||||
|
$APPLICATION->SetPageProperty("title", $sotbitSeoMetaTitle); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_KEYWORDS_REPLACE'] == 'Y') { |
||||||
|
$result['KEYWORDS'] = $metaData['SEOMETA_DATA']['ELEMENT_KEYWORDS']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['KEYWORDS'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['KEYWORDS'] = Emoji::decode($result['KEYWORDS']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaKeywords = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['KEYWORDS'])); |
||||||
|
$sotbitSeoMetaKeywords = html_entity_decode(SeoMetaMorphy::convertMorphy($sotbitSeoMetaKeywords, $morphyObject)); |
||||||
|
$APPLICATION->SetPageProperty("keywords", $sotbitSeoMetaKeywords); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_DESCRIPTION_REPLACE'] == 'Y') { |
||||||
|
$result['DESCRIPTION'] = $metaData['SEOMETA_DATA']['ELEMENT_DESCRIPTION']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['DESCRIPTION'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['DESCRIPTION'] = Emoji::decode($result['DESCRIPTION']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaDescription = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['DESCRIPTION']))); |
||||||
|
$sotbitSeoMetaDescription = html_entity_decode(SeoMetaMorphy::convertMorphy($sotbitSeoMetaDescription, $morphyObject)); |
||||||
|
$sotbitSeoMetaDescription .= $paginationText ?: ''; |
||||||
|
$APPLICATION->SetPageProperty("description", $sotbitSeoMetaDescription); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_PAGE_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['PAGE_TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_PAGE_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['PAGE_TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['PAGE_TITLE'] = Emoji::decode($result['PAGE_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaH1 = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['PAGE_TITLE'])); |
||||||
|
$arResult['ELEMENT_H1'] = $sotbitSeoMetaH1 .= $paginationText ?: ''; |
||||||
|
$sotbitSeoMetaH1 = SeoMetaMorphy::convertMorphy($sotbitSeoMetaH1, $morphyObject); |
||||||
|
$APPLICATION->SetTitle($sotbitSeoMetaH1); |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_BREADCRUMB_TITLE_REPLACE'] == 'Y') { |
||||||
|
$result['BREADCRUMB_TITLE'] = $metaData['SEOMETA_DATA']['ELEMENT_BREADCRUMB_TITLE']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['BREADCRUMB_TITLE'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['BREADCRUMB_TITLE'] = Emoji::decode($result['BREADCRUMB_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$url = $protocol . $curReq->getServer()->getServerName() . $port . $curReq->getRequestUri(); |
||||||
|
$sotbitSeoMetaBreadcrumbLink = $url; |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($result['BREADCRUMB_TITLE'])); |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBreadcrumbTitle, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaBreadcrumbLink)) { |
||||||
|
$arResult['BREADCRUMB_TITLE'] = $sotbitSeoMetaBreadcrumbTitle; |
||||||
|
$arResult['BREADCRUMB_LINK'] = $url; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_TOP_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_TOP_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_TOP_DESC']; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($result['ELEMENT_TOP_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_TOP_DESC'] = Emoji::decode($result['ELEMENT_TOP_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTopDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_TOP_DESC']))); |
||||||
|
$sotbitSeoMetaTopDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTopDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaTopDesc)) { |
||||||
|
if ($result['ELEMENT_TOP_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaTopDesc = htmlspecialchars($sotbitSeoMetaTopDesc); |
||||||
|
} |
||||||
|
$arResult['ELEMENT_TOP_DESC'] = $sotbitSeoMetaTopDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_BOTTOM_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_BOTTOM_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_BOTTOM_DESC']; |
||||||
|
} |
||||||
|
if (!empty($result['ELEMENT_BOTTOM_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_BOTTOM_DESC'] = Emoji::decode($result['ELEMENT_BOTTOM_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaBottomDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_BOTTOM_DESC']))); |
||||||
|
$sotbitSeoMetaBottomDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBottomDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaBottomDesc)) { |
||||||
|
if ($result['ELEMENT_BOTTOM_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaBottomDesc = htmlspecialchars($sotbitSeoMetaBottomDesc); |
||||||
|
} |
||||||
|
|
||||||
|
$arResult['ELEMENT_BOTTOM_DESC'] = $sotbitSeoMetaBottomDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_ADD_DESC_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_ADD_DESC'] = $metaData['SEOMETA_DATA']['ELEMENT_ADD_DESC']; |
||||||
|
} |
||||||
|
if (!empty($result['ELEMENT_ADD_DESC'])) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$result['ELEMENT_ADD_DESC'] = Emoji::decode($result['ELEMENT_ADD_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaAddDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($result['ELEMENT_ADD_DESC']))); |
||||||
|
$sotbitSeoMetaAddDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaAddDesc, $morphyObject); |
||||||
|
if (!empty($sotbitSeoMetaAddDesc)) { |
||||||
|
if ($result['ELEMENT_ADD_DESC_TYPE'] == 'text') { |
||||||
|
$sotbitSeoMetaAddDesc = htmlspecialchars($sotbitSeoMetaAddDesc); |
||||||
|
} |
||||||
|
$arResult['ELEMENT_ADD_DESC'] = $sotbitSeoMetaAddDesc; |
||||||
|
} |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
if ($metaData['SEOMETA_DATA']['ELEMENT_FILE_REPLACE'] == 'Y') { |
||||||
|
$result['ELEMENT_FILE'] = $metaData['SEOMETA_DATA']['ELEMENT_FILE']; |
||||||
|
} |
||||||
|
if (intval($result['ELEMENT_FILE']) > 0) { |
||||||
|
$fileArray = CFile::GetFileArray($result['ELEMENT_FILE']); |
||||||
|
$arResult['ELEMENT_FILE']['SRC'] = $fileArray['SRC']; |
||||||
|
$arResult['ELEMENT_FILE']['DESCRIPTION'] = $fileArray['DESCRIPTION']; |
||||||
|
$sotbitSeoMetaFile = '<img src="' . $arResult['ELEMENT_FILE']['SRC'] . '" alt="' . $arResult['ELEMENT_FILE']['DESCRIPTION'] . '">'; |
||||||
|
$issetCondition = true; |
||||||
|
} |
||||||
|
|
||||||
|
//CANONICAL |
||||||
|
|
||||||
|
if ($arParams['KOMBOX_FILTER'] == 'Y' && CModule::IncludeModule('kombox.filter')) { |
||||||
|
$str = CKomboxFilter::GetCurPageParam(); |
||||||
|
$str = explode("?", $str); |
||||||
|
$CurPage_temp = SeometaUrlTable::getByRealUrl($str[0], SITE_ID); |
||||||
|
if (!empty($CurPage_temp['NEW_URL'])) { |
||||||
|
$CurPage = $CurPage_temp['NEW_URL']; |
||||||
|
} else { |
||||||
|
$CurPage = $str[0]; |
||||||
|
} |
||||||
|
} else { |
||||||
|
$CurPage = $APPLICATION->GetCurPage(false); |
||||||
|
} |
||||||
|
|
||||||
|
if ($issetCondition && Option::get($moduleId, "USE_CANONICAL_" . SITE_ID, "Y") != "N") { |
||||||
|
if ($metaData['NEW_URL'] || $metaData['REAL_URL']) { |
||||||
|
$APPLICATION->SetPageProperty("canonical", |
||||||
|
$protocol . $curReq->getServer()->getServerName() |
||||||
|
. $metaData['NEW_URL'] ?: $metaData['REAL_URL']); |
||||||
|
} elseif ($curReq->getServer()->get('REDIRECT_URL') || $curReq->getRequestUri()) { |
||||||
|
$APPLICATION->SetPageProperty("canonical", |
||||||
|
$protocol . $curReq->getServer()->getServerName() |
||||||
|
. $curReq->getServer()->get('REDIRECT_URL') ?: $curReq->getRequestUri()); |
||||||
|
} else { |
||||||
|
$APPLICATION->SetPageProperty("canonical", $protocol . $curReq->getServer()->getServerName() . $CurPage); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//OpenGraph and TwitterCard |
||||||
|
$metaDataOgTw = new OGraphTWCard(); |
||||||
|
$arOGParams = OpengraphTable::getByConditionID($result['ID']); |
||||||
|
if(is_array($arOGParams) && $arOGParams['OG_FIELD_ACTIVE'] == 'Y') { |
||||||
|
unset($arOGParams['OG_FIELD_ACTIVE']); |
||||||
|
unset($arOGParams['ID']); |
||||||
|
unset($arOGParams['CONDITION_ID']); |
||||||
|
if ($metaData['NEW_URL'] || $metaData['REAL_URL']) { |
||||||
|
$arOGParams['OG_FIELD_URL'] = $protocol . $curReq->getServer()->getServerName() . $metaData['NEW_URL'] ?: $metaData['REAL_URL']; |
||||||
|
} else { |
||||||
|
$arOGParams['OG_FIELD_URL'] = $metaDataOgTw->getHttpSchema() . '://' . $curReq->getServer()->getServerName() . $CurPage; |
||||||
|
} |
||||||
|
foreach ($arOGParams as $name => $value) { |
||||||
|
if($name == 'OG_FIELD_TITLE' || $name == 'OG_FIELD_DESCRIPTION') { |
||||||
|
$afterProcess = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($value)); |
||||||
|
$afterProcess = SeoMetaMorphy::convertMorphy($afterProcess, |
||||||
|
$morphyObject); |
||||||
|
|
||||||
|
if($afterProcess) { |
||||||
|
$value = $afterProcess; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$metaDataOgTw->setData($name, |
||||||
|
$value); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$arTWParams = TwitterCardTable::getByConditionID($result['ID']); |
||||||
|
if(is_array($arTWParams) && $arTWParams['TW_FIELD_ACTIVE'] == 'Y') { |
||||||
|
unset($arTWParams['TW_FIELD_ACTIVE']); |
||||||
|
unset($arTWParams['ID']); |
||||||
|
unset($arTWParams['CONDITION_ID']); |
||||||
|
unset($arTWParams['TW_FIELD_IMAGE_descr']); |
||||||
|
foreach ($arTWParams as $name => $value) { |
||||||
|
if($name == 'TW_FIELD_TITLE' || $name == 'TW_FIELD_DESCRIPTION') { |
||||||
|
$afterProcess = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($value)); |
||||||
|
$afterProcess = SeoMetaMorphy::convertMorphy($afterProcess, |
||||||
|
$morphyObject); |
||||||
|
|
||||||
|
if($afterProcess) { |
||||||
|
$value = $afterProcess; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$metaDataOgTw->setData($name, $value); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//tags |
||||||
|
if ($issetCondition && $result['ID'] > 0) { |
||||||
|
$SeoMetaWorkingConditions[] = $result['ID']; |
||||||
|
} |
||||||
|
} |
||||||
|
} else { |
||||||
|
$notConfiguredSeoData = SeometaNotConfiguredPagesTable::getBySiteID(SITE_ID); |
||||||
|
if($notConfiguredSeoData['ACTIVE'] == 'Y' && CSeoMeta::isFilterChecked()) { |
||||||
|
$mode = $_REQUEST['PAGEN_1'] ? $notConfiguredSeoData['BEHAVIOR_PAGINATION_PAGES'] : $notConfiguredSeoData['BEHAVIOR_FILTERED_PAGES']; |
||||||
|
if ($mode == 'no_index') { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'noindex, nofollow'); |
||||||
|
} elseif ($mode == 'canonical') { |
||||||
|
if (Option::get($moduleId, "NO_INDEX_" . SITE_ID, "N") === 'Y') { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'noindex, nofollow'); |
||||||
|
} else { |
||||||
|
$APPLICATION->SetPageProperty("robots", 'index, follow'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_TITLE']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_TITLE'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($notConfiguredSeoData['META_ELEMENT_TITLE'])); |
||||||
|
$sotbitSeoMetaTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTitle, $morphyObject); |
||||||
|
$sotbitSeoMetaTitle .= $paginationText ?: ''; |
||||||
|
$sotbitSeoMetaTitle = \CSeoMeta::UserFields($sotbitSeoMetaTitle, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$APPLICATION->SetPageProperty("title", $sotbitSeoMetaTitle); |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_KEYWORDS']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_KEYWORDS'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_KEYWORDS']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaKeywords = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($notConfiguredSeoData['META_ELEMENT_KEYWORDS'])); |
||||||
|
$sotbitSeoMetaKeywords = SeoMetaMorphy::convertMorphy($sotbitSeoMetaKeywords, $morphyObject); |
||||||
|
$sotbitSeoMetaKeywords = \CSeoMeta::UserFields($sotbitSeoMetaKeywords, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$APPLICATION->SetPageProperty("keywords", $sotbitSeoMetaKeywords); |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_DESCRIPTION']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_DESCRIPTION'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_DESCRIPTION']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaDescription = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($notConfiguredSeoData['META_ELEMENT_DESCRIPTION'])); |
||||||
|
$sotbitSeoMetaDescription = SeoMetaMorphy::convertMorphy($sotbitSeoMetaDescription, $morphyObject); |
||||||
|
$sotbitSeoMetaDescription .= $paginationText ?: ''; |
||||||
|
$sotbitSeoMetaDescription = \CSeoMeta::UserFields($sotbitSeoMetaDescription, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$APPLICATION->SetPageProperty("description", $sotbitSeoMetaDescription); |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_PAGE_TITLE']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_PAGE_TITLE'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_PAGE_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaH1 = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($notConfiguredSeoData['META_ELEMENT_PAGE_TITLE'])); |
||||||
|
|
||||||
|
if ($sotbitSeoMetaH1) { |
||||||
|
$sotbitSeoMetaH1 .= $paginationText ?: ''; |
||||||
|
$sotbitSeoMetaH1 = SeoMetaMorphy::convertMorphy($sotbitSeoMetaH1, $morphyObject); |
||||||
|
$sotbitSeoMetaH1 = \CSeoMeta::UserFields($sotbitSeoMetaH1, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$arResult['ELEMENT_H1'] = $sotbitSeoMetaH1; |
||||||
|
$APPLICATION->SetTitle($sotbitSeoMetaH1); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_BREADCRUMB_TITLE']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_BREADCRUMB_TITLE'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_BREADCRUMB_TITLE']); |
||||||
|
} |
||||||
|
|
||||||
|
$url = $protocol . $curReq->getServer()->getServerName() . $port . $curReq->getRequestUri(); |
||||||
|
$sotbitSeoMetaBreadcrumbLink = $url; |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy($notConfiguredSeoData['META_ELEMENT_BREADCRUMB_TITLE'])); |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBreadcrumbTitle, $morphyObject); |
||||||
|
$sotbitSeoMetaBreadcrumbTitle = \CSeoMeta::UserFields($sotbitSeoMetaBreadcrumbTitle, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
if (isset($sotbitSeoMetaBreadcrumbLink) && !empty($sotbitSeoMetaBreadcrumbLink)) { |
||||||
|
$arResult['BREADCRUMB_TITLE'] = $sotbitSeoMetaBreadcrumbTitle; |
||||||
|
$arResult['BREADCRUMB_LINK'] = $url; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_TOP_DESC']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_TOP_DESC'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_TOP_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaTopDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($notConfiguredSeoData['META_ELEMENT_TOP_DESC']))); |
||||||
|
$sotbitSeoMetaTopDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaTopDesc, $morphyObject); |
||||||
|
$sotbitSeoMetaTopDesc = \CSeoMeta::UserFields($sotbitSeoMetaTopDesc, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$arResult['ELEMENT_TOP_DESC'] = $sotbitSeoMetaTopDesc ?: ''; |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_BOTTOM_DESC']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_BOTTOM_DESC'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_BOTTOM_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaBottomDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($notConfiguredSeoData['META_ELEMENT_BOTTOM_DESC']))); |
||||||
|
$sotbitSeoMetaBottomDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaBottomDesc, $morphyObject); |
||||||
|
$sotbitSeoMetaBottomDesc = \CSeoMeta::UserFields($sotbitSeoMetaBottomDesc, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$arResult['ELEMENT_BOTTOM_DESC'] = $sotbitSeoMetaBottomDesc ?: ''; |
||||||
|
} |
||||||
|
|
||||||
|
if ($notConfiguredSeoData['META_ELEMENT_ADD_DESC']) { |
||||||
|
if ($classEmojiExist) { |
||||||
|
$notConfiguredSeoData['META_ELEMENT_ADD_DESC'] = Emoji::decode($notConfiguredSeoData['META_ELEMENT_ADD_DESC']); |
||||||
|
} |
||||||
|
|
||||||
|
$sotbitSeoMetaAddDesc = Engine::process($sku, |
||||||
|
SeoMetaMorphy::prepareForMorphy(html_entity_decode($notConfiguredSeoData['META_ELEMENT_ADD_DESC']))); |
||||||
|
$sotbitSeoMetaAddDesc = SeoMetaMorphy::convertMorphy($sotbitSeoMetaAddDesc, $morphyObject); |
||||||
|
$sotbitSeoMetaAddDesc = \CSeoMeta::UserFields($sotbitSeoMetaAddDesc, $arParams['SECTION_ID'], $condition['INFOBLOCK']); |
||||||
|
$arResult['ELEMENT_ADD_DESC'] = $sotbitSeoMetaAddDesc ?: ''; |
||||||
|
} |
||||||
|
|
||||||
|
//CANONICAL |
||||||
|
if ($mode == 'canonical') { |
||||||
|
$CurPage = $APPLICATION->GetCurPage(false); |
||||||
|
if ($arParams['KOMBOX_FILTER'] == 'Y' && CModule::IncludeModule('kombox.filter')) { |
||||||
|
$str = CKomboxFilter::GetCurPageParam(); |
||||||
|
$str = explode("?", $str); |
||||||
|
$CurPage_temp = SeometaUrlTable::getByRealUrl($str[0], SITE_ID); |
||||||
|
$CurPage = $str[0]; |
||||||
|
if (!empty($CurPage_temp['NEW_URL'])) { |
||||||
|
$CurPage = $CurPage_temp['NEW_URL']; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ($sectionParams['SECTION_PAGE_URL']) { |
||||||
|
$APPLICATION->SetPageProperty("canonical", |
||||||
|
$protocol . $curReq->getServer()->getServerName() . $sectionParams['SECTION_PAGE_URL']); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$SeoMetaWorkingConditions = array_unique($SeoMetaWorkingConditions); |
||||||
|
|
||||||
|
if(Option::get("sotbit.seometa",'INC_STATISTIC','N',SITE_ID) == 'Y') { |
||||||
|
$arParams['KOMBOX_FILTER'] = $arParams['KOMBOX_FILTER'] ?: 'N'; |
||||||
|
Asset::getInstance()->addJs("/bitrix/components/sotbit/seo.meta/js/stat.js"); |
||||||
|
|
||||||
|
$prop['ITEMS'] = $sotbitFilterResult['ITEMS'] ?: []; |
||||||
|
|
||||||
|
echo '<script> new Stat('.CUtil::PhpToJSObject(${$arParams['FILTER_NAME']}).','.$arParams['SECTION_ID'].',"'.$arParams['KOMBOX_FILTER'].'","'.SITE_ID.'","'.LANG_CHARSET.'",'.CUtil::PhpToJSObject($prop).') </script>'; |
||||||
|
} |
||||||
|
|
||||||
|
$this->IncludeComponentTemplate(); |
||||||
|
?> |
After Width: | Height: | Size: 684 B |
@ -0,0 +1,43 @@ |
|||||||
|
function Stat(arFilter, section, komboxFilter, siteID, siteCharSet, sotbitFilter) |
||||||
|
{ |
||||||
|
if(komboxFilter !== 'Y'){ |
||||||
|
komboxFilter = 'N'; |
||||||
|
} |
||||||
|
|
||||||
|
let title = document.querySelector('title').innerText; |
||||||
|
let keywords = document.querySelector('meta[name=keywords]').content; |
||||||
|
let description = document.querySelector('meta[name=description]').content; |
||||||
|
|
||||||
|
// regex for search emoji
|
||||||
|
if(siteCharSet.toLowerCase() !== "utf-8"){ |
||||||
|
let regexp = /[\u{1f300}-\u{1f5ff}\u{1f900}-\u{1f9ff}\u{1f600}-\u{1f64f}\u{1f680}-\u{1f6ff}\u{2600}-\u{26ff}\u{2700}-\u{27bf}\u{1f1e6}-\u{1f1ff}\u{1f191}-\u{1f251}\u{1f004}\u{1f0cf}\u{1f170}-\u{1f171}\u{1f17e}-\u{1f17f}\u{1f18e}\u{3030}\u{2b50}\u{2b55}\u{2934}-\u{2935}\u{2b05}-\u{2b07}\u{2b1b}-\u{2b1c}\u{3297}\u{3299}\u{303d}\u{00a9}\u{00ae}\u{2122}\u{23f3}\u{24c2}\u{23e9}-\u{23ef}\u{25b6}\u{23f8}-\u{23fa}]/ug; |
||||||
|
title = title.replace(regexp, function (title){ |
||||||
|
return "%26#"+title.codePointAt(0)+";"; // get emoji html code
|
||||||
|
}); |
||||||
|
keywords = keywords.replace(regexp, function (keywords){ |
||||||
|
return "%26#"+keywords.codePointAt(0)+";"; |
||||||
|
}); |
||||||
|
description = description.replace(regexp, function (description){ |
||||||
|
return "%26#"+description.codePointAt(0)+";"; |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
let metaInfo = { |
||||||
|
title: title, |
||||||
|
keywords: keywords, |
||||||
|
description: description, |
||||||
|
index: document.querySelector('meta[name=robots]') ? document.querySelector('meta[name=robots]').content : 'index, follow', |
||||||
|
section: section, |
||||||
|
komboxFilter: komboxFilter, |
||||||
|
} |
||||||
|
|
||||||
|
const test = BX.ajax.runAction('sotbit:seometa.statistics.fillStat', { |
||||||
|
data: { |
||||||
|
to: window.location.href, |
||||||
|
siteID: siteID, |
||||||
|
metaInfo: JSON.stringify(metaInfo), |
||||||
|
arFilter: JSON.stringify(arFilter), |
||||||
|
sotbitFilter: JSON.stringify(sotbitFilter), |
||||||
|
} |
||||||
|
}).then(response => {}, error => {console.error(error);}); |
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_NAME"] = "Метаинформация"; |
||||||
|
$MESS["MAIN_MENU_NAME_SOTBIT"] = "SEO умного фильтра"; |
||||||
|
$MESS["MAIN_GROUP_NAME_SOTBIT"] = "Сотбит"; |
||||||
|
$MESS["SM_DESCRIPTION"] = "Выводит мета информацию, в зависимости от значения фильтра"; |
||||||
|
?> |
@ -0,0 +1,7 @@ |
|||||||
|
<? |
||||||
|
$MESS["SM_SECTION_ID"] = "ID раздела"; |
||||||
|
$MESS["CACHE_TYPE"] = "Тип кеширования"; |
||||||
|
$MESS["CACHE_TIME"] = "Время кеширования (сек.)"; |
||||||
|
$MESS["SM_FILTER_NAME"] = "Имя фильтра"; |
||||||
|
$MESS["USE_KOMBOX_FILTER"] = "Используется фильтр kombox:filter"; |
||||||
|
?> |
@ -0,0 +1,35 @@ |
|||||||
|
<? |
||||||
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); |
||||||
|
$this->setFrameMode(true); |
||||||
|
|
||||||
|
if(isset($arResult['ELEMENT_H1']) && !empty($arResult['ELEMENT_H1'])) |
||||||
|
{ |
||||||
|
$this->SetViewTarget("sotbit_seometa_h1"); |
||||||
|
echo $arResult['ELEMENT_H1']; |
||||||
|
$this->EndViewTarget(); |
||||||
|
} |
||||||
|
if(isset($arResult['ELEMENT_TOP_DESC']) && !empty($arResult['ELEMENT_TOP_DESC'])) |
||||||
|
{ |
||||||
|
$this->SetViewTarget("sotbit_seometa_top_desc"); |
||||||
|
echo $arResult['ELEMENT_TOP_DESC']; |
||||||
|
$this->EndViewTarget(); |
||||||
|
} |
||||||
|
if(isset($arResult['ELEMENT_BOTTOM_DESC']) && !empty($arResult['ELEMENT_BOTTOM_DESC'])) |
||||||
|
{ |
||||||
|
$this->SetViewTarget("sotbit_seometa_bottom_desc"); |
||||||
|
echo $arResult['ELEMENT_BOTTOM_DESC']; |
||||||
|
$this->EndViewTarget(); |
||||||
|
} |
||||||
|
if(isset($arResult['ELEMENT_ADD_DESC']) && !empty($arResult['ELEMENT_ADD_DESC'])) |
||||||
|
{ |
||||||
|
$this->SetViewTarget("sotbit_seometa_add_desc"); |
||||||
|
echo $arResult['ELEMENT_ADD_DESC']; |
||||||
|
$this->EndViewTarget(); |
||||||
|
} |
||||||
|
if(isset($arResult['ELEMENT_FILE']) && !empty($arResult['ELEMENT_FILE'])) |
||||||
|
{ |
||||||
|
$this->SetViewTarget("sotbit_seometa_file"); |
||||||
|
echo '<img src="' . $arResult['ELEMENT_FILE']['SRC'] . '" alt="' . $arResult['ELEMENT_FILE']['DESCRIPTION'] . '">'; |
||||||
|
$this->EndViewTarget(); |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,6 @@ |
|||||||
|
<? |
||||||
|
if(defined("B_PROLOG_INCLUDED") && B_PROLOG_INCLUDED===true) |
||||||
|
{ |
||||||
|
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog.php"); |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1 @@ |
|||||||
|
<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog.php");?> |
@ -0,0 +1,3 @@ |
|||||||
|
<head> |
||||||
|
<meta http-equiv="REFRESH" content="0;URL=/bitrix/admin/index.php"> |
||||||
|
</head> |
@ -0,0 +1 @@ |
|||||||
|
<? $LICENSE_KEY = "S24-NA-IOENB3XRXSVHUEONJ9HV"; ?> |
@ -0,0 +1,3 @@ |
|||||||
|
<?php |
||||||
|
$this->queryExecute("SET NAMES 'utf8'"); |
||||||
|
$this->queryExecute('SET collation_connection = "utf8_unicode_ci"'); |
@ -0,0 +1,101 @@ |
|||||||
|
#!#PHP_PATH# -q |
||||||
|
<?php |
||||||
|
/* replace #PHP_PATH# to real path of php binary |
||||||
|
For example: |
||||||
|
/user/bin/php |
||||||
|
/usr/bin/perl |
||||||
|
/usr/bin/env python |
||||||
|
*/ |
||||||
|
$_SERVER["DOCUMENT_ROOT"] = "#DOCUMENT_ROOT#"; // replace #DOCUMENT_ROOT# to real document root path |
||||||
|
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"]; |
||||||
|
|
||||||
|
$siteID = '#SITE_ID#'; // replace #SITE_ID# to your real site ID - need for language ID |
||||||
|
|
||||||
|
define("NO_KEEP_STATISTIC", true); |
||||||
|
define("NOT_CHECK_PERMISSIONS",true); |
||||||
|
define("BX_CAT_CRON", true); |
||||||
|
define('NO_AGENT_CHECK', true); |
||||||
|
if (preg_match('/^[a-z0-9_]{2}$/i', $siteID) === 1) |
||||||
|
{ |
||||||
|
define('SITE_ID', $siteID); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
die('No defined site - $siteID'); |
||||||
|
} |
||||||
|
|
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); |
||||||
|
|
||||||
|
global $DB; |
||||||
|
|
||||||
|
if (!defined('LANGUAGE_ID') || preg_match('/^[a-z]{2}$/i', LANGUAGE_ID) !== 1) |
||||||
|
die('Language id is absent - defined site is bad'); |
||||||
|
|
||||||
|
set_time_limit(0); |
||||||
|
|
||||||
|
if (!\Bitrix\Main\Loader::includeModule('catalog')) |
||||||
|
die('Can\'t include module'); |
||||||
|
|
||||||
|
$profile_id = 0; |
||||||
|
if (isset($argv[1])) |
||||||
|
$profile_id = (int)$argv[1]; |
||||||
|
if ($profile_id <= 0) |
||||||
|
die('No profile id'); |
||||||
|
|
||||||
|
$ar_profile = CCatalogExport::GetByID($profile_id); |
||||||
|
if (!$ar_profile) |
||||||
|
die('No profile'); |
||||||
|
|
||||||
|
$strFile = CATALOG_PATH2EXPORTS.$ar_profile["FILE_NAME"]."_run.php"; |
||||||
|
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile)) |
||||||
|
{ |
||||||
|
$strFile = CATALOG_PATH2EXPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php"; |
||||||
|
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile)) |
||||||
|
die('No export script'); |
||||||
|
} |
||||||
|
|
||||||
|
$arSetupVars = array(); |
||||||
|
$intSetupVarsCount = 0; |
||||||
|
if ($ar_profile["DEFAULT_PROFILE"] != 'Y') |
||||||
|
{ |
||||||
|
parse_str($ar_profile["SETUP_VARS"], $arSetupVars); |
||||||
|
if (!empty($arSetupVars) && is_array($arSetupVars)) |
||||||
|
$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP); |
||||||
|
} |
||||||
|
|
||||||
|
$firstStep = true; |
||||||
|
|
||||||
|
global $arCatalogAvailProdFields; |
||||||
|
$arCatalogAvailProdFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_ELEMENT); |
||||||
|
global $arCatalogAvailPriceFields; |
||||||
|
$arCatalogAvailPriceFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_CATALOG); |
||||||
|
global $arCatalogAvailValueFields; |
||||||
|
$arCatalogAvailValueFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE); |
||||||
|
global $arCatalogAvailQuantityFields; |
||||||
|
$arCatalogAvailQuantityFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE_EXT); |
||||||
|
global $arCatalogAvailGroupFields; |
||||||
|
$arCatalogAvailGroupFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_SECTION); |
||||||
|
|
||||||
|
global $defCatalogAvailProdFields; |
||||||
|
$defCatalogAvailProdFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_ELEMENT); |
||||||
|
global $defCatalogAvailPriceFields; |
||||||
|
$defCatalogAvailPriceFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CATALOG); |
||||||
|
global $defCatalogAvailValueFields; |
||||||
|
$defCatalogAvailValueFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE); |
||||||
|
global $defCatalogAvailQuantityFields; |
||||||
|
$defCatalogAvailQuantityFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE_EXT); |
||||||
|
global $defCatalogAvailGroupFields; |
||||||
|
$defCatalogAvailGroupFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_SECTION); |
||||||
|
global $defCatalogAvailCurrencies; |
||||||
|
$defCatalogAvailCurrencies = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CURRENCY); |
||||||
|
|
||||||
|
CCatalogDiscountSave::Disable(); |
||||||
|
include($_SERVER["DOCUMENT_ROOT"].$strFile); |
||||||
|
CCatalogDiscountSave::Enable(); |
||||||
|
|
||||||
|
CCatalogExport::Update( |
||||||
|
$profile_id, |
||||||
|
array( |
||||||
|
"=LAST_USE" => $DB->GetNowFunction() |
||||||
|
) |
||||||
|
); |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Export CSV (new)</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/csv_new_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/csv_new_setup.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Export CSV</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/csv_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/csv_setup.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Froogle</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/froogle_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/froogle_setup.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/froogle_util.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_detail.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Yandex</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_setup.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Yandex - simple</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_simple_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_simple_setup.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load/yandex_util.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>CommerceML MySql Fast - BETA VERS</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/commerceml_g_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/commerceml_g_setup.php"); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>CommerceML</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/commerceml_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/commerceml_setup.php"); |
||||||
|
?> |
@ -0,0 +1,104 @@ |
|||||||
|
#!#PHP_PATH# -q |
||||||
|
<?php |
||||||
|
/* replace #PHP_PATH# to real path of php binary |
||||||
|
For example: |
||||||
|
/user/bin/php |
||||||
|
/usr/bin/perl |
||||||
|
/usr/bin/env python |
||||||
|
*/ |
||||||
|
$_SERVER["DOCUMENT_ROOT"] = "#DOCUMENT_ROOT#"; // replace #DOCUMENT_ROOT# to real document root path |
||||||
|
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"]; |
||||||
|
|
||||||
|
$siteID = '#SITE_ID#'; // replace #SITE_ID# to your real site ID - need for language ID |
||||||
|
|
||||||
|
define("NO_KEEP_STATISTIC", true); |
||||||
|
define("NOT_CHECK_PERMISSIONS",true); |
||||||
|
define("BX_CAT_CRON", true); |
||||||
|
define('NO_AGENT_CHECK', true); |
||||||
|
if (preg_match('/^[a-z0-9_]{2}$/i', $siteID) === 1) |
||||||
|
{ |
||||||
|
define('SITE_ID', $siteID); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
die('No defined site - $siteID'); |
||||||
|
} |
||||||
|
|
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); |
||||||
|
|
||||||
|
global $DB; |
||||||
|
|
||||||
|
if (!defined('LANGUAGE_ID') || preg_match('/^[a-z]{2}$/i', LANGUAGE_ID) !== 1) |
||||||
|
die('Language id is absent - defined site is bad'); |
||||||
|
|
||||||
|
set_time_limit(0); |
||||||
|
|
||||||
|
if (!defined("CATALOG_LOAD_NO_STEP")) |
||||||
|
define("CATALOG_LOAD_NO_STEP", true); |
||||||
|
|
||||||
|
if (!\Bitrix\Main\Loader::includeModule('catalog')) |
||||||
|
die('Can\'t include module'); |
||||||
|
|
||||||
|
$profile_id = 0; |
||||||
|
if (isset($argv[1])) |
||||||
|
$profile_id = (int)$argv[1]; |
||||||
|
if ($profile_id<=0) |
||||||
|
die('No profile id'); |
||||||
|
|
||||||
|
$ar_profile = CCatalogImport::GetByID($profile_id); |
||||||
|
if (!$ar_profile) |
||||||
|
die('No profile'); |
||||||
|
|
||||||
|
$strFile = CATALOG_PATH2IMPORTS.$ar_profile["FILE_NAME"]."_run.php"; |
||||||
|
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile)) |
||||||
|
{ |
||||||
|
$strFile = CATALOG_PATH2IMPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php"; |
||||||
|
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile)) |
||||||
|
die('No import script'); |
||||||
|
} |
||||||
|
|
||||||
|
$bFirstLoadStep = true; |
||||||
|
|
||||||
|
$arSetupVars = array(); |
||||||
|
$intSetupVarsCount = 0; |
||||||
|
if ($ar_profile["DEFAULT_PROFILE"] != 'Y') |
||||||
|
{ |
||||||
|
parse_str($ar_profile["SETUP_VARS"], $arSetupVars); |
||||||
|
if (!empty($arSetupVars) && is_array($arSetupVars)) |
||||||
|
$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP); |
||||||
|
} |
||||||
|
|
||||||
|
global $arCatalogAvailProdFields; |
||||||
|
$arCatalogAvailProdFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_ELEMENT); |
||||||
|
global $arCatalogAvailPriceFields; |
||||||
|
$arCatalogAvailPriceFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_CATALOG); |
||||||
|
global $arCatalogAvailValueFields; |
||||||
|
$arCatalogAvailValueFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE); |
||||||
|
global $arCatalogAvailQuantityFields; |
||||||
|
$arCatalogAvailQuantityFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE_EXT); |
||||||
|
global $arCatalogAvailGroupFields; |
||||||
|
$arCatalogAvailGroupFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_SECTION); |
||||||
|
|
||||||
|
global $defCatalogAvailProdFields; |
||||||
|
$defCatalogAvailProdFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_ELEMENT); |
||||||
|
global $defCatalogAvailPriceFields; |
||||||
|
$defCatalogAvailPriceFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CATALOG); |
||||||
|
global $defCatalogAvailValueFields; |
||||||
|
$defCatalogAvailValueFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE); |
||||||
|
global $defCatalogAvailQuantityFields; |
||||||
|
$defCatalogAvailQuantityFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE_EXT); |
||||||
|
global $defCatalogAvailGroupFields; |
||||||
|
$defCatalogAvailGroupFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_SECTION); |
||||||
|
global $defCatalogAvailCurrencies; |
||||||
|
$defCatalogAvailCurrencies = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CURRENCY); |
||||||
|
|
||||||
|
CCatalogDiscountSave::Disable(); |
||||||
|
include($_SERVER["DOCUMENT_ROOT"].$strFile); |
||||||
|
CCatalogDiscountSave::Enable(); |
||||||
|
|
||||||
|
CCatalogImport::Update( |
||||||
|
$profile_id, |
||||||
|
array( |
||||||
|
"=LAST_USE" => $DB->GetNowFunction() |
||||||
|
) |
||||||
|
); |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
//<title>Import CSV (new)</title> |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/csv_new_run.php"); |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
<? |
||||||
|
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/load_import/csv_new_setup.php"); |
||||||
|
?> |
@ -0,0 +1,43 @@ |
|||||||
|
<?php |
||||||
|
define('DEFAULT_TEMPLATE_PATH', '/local/templates/.default'); |
||||||
|
define('SITE_TEMPLATE_PATH', '/local/templates/EraSeptik'); |
||||||
|
|
||||||
|
function debug($data) { |
||||||
|
echo "<pre>" . print_r($data, true) . "</pre>"; |
||||||
|
} |
||||||
|
|
||||||
|
function getAverageRating($reviews): float |
||||||
|
{ |
||||||
|
$totalRating = 0; |
||||||
|
$count = 0; |
||||||
|
|
||||||
|
if (!$reviews) return 0; |
||||||
|
|
||||||
|
foreach ($reviews as $review) { |
||||||
|
if (!empty($review['SUB_VALUES']['REV_RATING']['VALUE'])) { |
||||||
|
$rating = (float)$review['SUB_VALUES']['REV_RATING']['VALUE']; |
||||||
|
$totalRating += $rating; |
||||||
|
$count++; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return $count > 0 ? round($totalRating / $count, 1) : 0; |
||||||
|
} |
||||||
|
|
||||||
|
function getReviewWordForm($reviews): string { |
||||||
|
|
||||||
|
if (!$reviews) return 'отзыв'; |
||||||
|
|
||||||
|
$count = count($reviews); |
||||||
|
|
||||||
|
$mod10 = $count % 10; |
||||||
|
$mod100 = $count % 100; |
||||||
|
|
||||||
|
if ($mod10 == 1 && $mod100 != 11) { |
||||||
|
return 'отзыв'; |
||||||
|
} elseif (in_array($mod10, [2, 3, 4]) && !in_array($mod100, [12, 13, 14])) { |
||||||
|
return 'отзыва'; |
||||||
|
} else { |
||||||
|
return 'отзывов'; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
<? |
||||||
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); |
||||||
|
|
||||||
|
$arTemplate = |
||||||
|
Array( |
||||||
|
"NAME"=>GetMessage("news_template_name"), |
||||||
|
"DESCRIPTION"=>GetMessage("news_template_desc") |
||||||
|
); |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
$MESS ['news_template_name'] = "News digest"; |
||||||
|
$MESS ['news_template_desc'] = "News digest template."; |
||||||
|
?> |
@ -0,0 +1,4 @@ |
|||||||
|
<? |
||||||
|
$MESS ['news_template_name'] = "Дайджест новостей"; |
||||||
|
$MESS ['news_template_desc'] = "Шаблон генерации дайджеста новостей."; |
||||||
|
?> |
@ -0,0 +1,41 @@ |
|||||||
|
<? |
||||||
|
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die(); |
||||||
|
global $SUBSCRIBE_TEMPLATE_RUBRIC; |
||||||
|
$SUBSCRIBE_TEMPLATE_RUBRIC=$arRubric; |
||||||
|
global $APPLICATION; |
||||||
|
?> |
||||||
|
<STYLE type=text/css> |
||||||
|
.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size:12px; color: #1C1C1C; font-weight: normal;} |
||||||
|
.newsdata{font-family: Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; color: #346BA0; text-decoration:none;} |
||||||
|
H1 {font-family: Verdana, Arial, Helvetica, sans-serif; color:#346BA0; font-size:15px; font-weight:bold; line-height: 16px; margin-bottom: 1mm;} |
||||||
|
</STYLE> |
||||||
|
|
||||||
|
<P>Новости магазина</P> |
||||||
|
<P><?$SUBSCRIBE_TEMPLATE_RESULT = $APPLICATION->IncludeComponent( |
||||||
|
"bitrix:subscribe.news", |
||||||
|
"", |
||||||
|
Array( |
||||||
|
"SITE_ID" => "s1", |
||||||
|
"IBLOCK_TYPE" => "news", |
||||||
|
"ID" => "", |
||||||
|
"SORT_BY" => "ACTIVE_FROM", |
||||||
|
"SORT_ORDER" => "DESC", |
||||||
|
), |
||||||
|
null, |
||||||
|
array( |
||||||
|
"HIDE_ICONS" => "Y", |
||||||
|
) |
||||||
|
);?></P> |
||||||
|
<? |
||||||
|
|
||||||
|
if($SUBSCRIBE_TEMPLATE_RESULT) |
||||||
|
return array( |
||||||
|
"SUBJECT"=>$SUBSCRIBE_TEMPLATE_RUBRIC["NAME"], |
||||||
|
"BODY_TYPE"=>"html", |
||||||
|
"CHARSET"=>"UTF-8", |
||||||
|
"DIRECT_SEND"=>"Y", |
||||||
|
"FROM_FIELD"=>$SUBSCRIBE_TEMPLATE_RUBRIC["FROM_FIELD"], |
||||||
|
); |
||||||
|
else |
||||||
|
return false; |
||||||
|
?> |
@ -0,0 +1,3 @@ |
|||||||
|
iframe.waitwindowlocal {position:absolute; border:0px; z-index:9999;} |
||||||
|
div.waitwindowlocal {position:absolute; width:25px; height: 25px; padding:0px; z-index:10000; background-color:#FCF7D1; border:1px solid #E1B52D; background-image:url(images/wait.gif); background-position:center center; background-repeat:no-repeat;} |
||||||
|
div.waitwindowlocalshadow {position:absolute; z-index:9998; background-image:url(images/shadow.gif); border:1px solid #808080;} |
@ -0,0 +1 @@ |
|||||||
|
iframe.waitwindowlocal{position:absolute;border:0;z-index:9999}div.waitwindowlocal{position:absolute;width:25px;height:25px;padding:0;z-index:10000;background-color:#fcf7d1;border:1px solid #e1b52d;background-image:url(images/wait.gif);background-position:center center;background-repeat:no-repeat}div.waitwindowlocalshadow{position:absolute;z-index:9998;background-image:url(images/shadow.gif);border:1px solid #808080} |
After Width: | Height: | Size: 70 B |
After Width: | Height: | Size: 726 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue