This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Isaev; | |
use \Bitrix\Main\Loader; | |
use \Bitrix\Sale; | |
use \Bitrix\Main\SystemException; | |
Loader::includeModule('sale'); | |
Loader::includeModule('catalog'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDeviceIos = navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i); | |
var historyScrollBack = (historyTab) => { | |
if (history.state && historyTab.hasOwnProperty('lastScroll')) { | |
window.scrollTo(0, historyTab.lastScroll); | |
} | |
}; | |
// Возрват к позиции при нажатии кнопки назад (Запись) | |
window.addEventListener((isDeviceIos ? "pagehide" : "beforeunload"), function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
\Bitrix\Main\EventManager::getInstance()->addEventHandler("main", "OnEndBufferContent", "OnEndBufferWebFormAntiSpam"); | |
function OnEndBufferWebFormAntiSpam(&$content) | |
{ | |
// Добавляем стили перед head | |
$xStyle = '<style>.xname{display:block;height:.1px;margin:0!important;overflow:hidden;padding:0!important;width:.1px;border:0;opacity:.01;}</style>'; // Стили для поля | |
$content = str_ireplace('</head>', $xStyle.'</head>', $content); | |
// Добавляем поля | |
$findField = '<input type="hidden" name="WEB_FORM_ID"'; // У всех веб-форм есть это поле (Должно быть) | |
$xField = '<input class="xname name" tabindex="-1" autocomplete="off" type="text" name="last_name" value="">'; // Максимально завлекающее ботов поля с утыканными name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://api-maps.yandex.ru/2.1/?lang=ru-RU" type="text/javascript"></script> | |
<script> | |
ymaps.ready(init); | |
function init () { | |
var myMap = new ymaps.Map('map', { | |
center: [55.83, 37.41], | |
zoom: 10 | |
}, { | |
searchControlProvider: 'yandex#search' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$res = CIBlockSection::GetList( | |
Array('name' => 'asc'), | |
Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y') | |
); | |
while ($row = $res->GetNext()) | |
{ | |
echo $row['NAME'].'<br>'; | |
$rsParentSection = CIBlockSection::GetByID($row['ID']); | |
if ($arParentSection = $rsParentSection->GetNext()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Настройка столбцов списка элементов ИБ в админке инфоблоков | |
* | |
* @param integer $IBlockID — ID инфоблока | |
* @param string $arIBlockListAdminColumns — символьные коды полей и свойств для показа в списке элементов ИБ | |
* @param string $orderByColumnName — наименования поля или свойства по которому нудно отсортировать | |
* @param string $orderDirection - направление сортировки | |
* @param integer $pageSize - количество элементов на страницу | |
* @param boolean $isToAllUsers - значение будет для всех, или для текущего пользователя | |
* @return boolean |
NewerOlder