This file contains hidden or 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
| let originalBxOnCustomEvent = BX.onCustomEvent; | |
| BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) | |
| { | |
| let realEventName = BX.type.isString(eventName) ? | |
| eventName : BX.type.isString(eventObject) ? eventObject : null; | |
| let i = 0; | |
This file contains hidden or 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\Loader::includeModule('iblock'); | |
| # Делаем запрос в таблицу элементов инфоблока | |
| $dbItems = \Bitrix\Iblock\ElementTable::getList(array( | |
| 'order' => array('SORT' => 'ASC'), // сортировка | |
| 'select' => array('ID', 'NAME', 'IBLOCK_ID', 'SORT', 'TAGS'), // выбираемые поля, без свойств. Свойства можно получать на старом ядре \CIBlockElement::getProperty | |
| 'filter' => array('IBLOCK_ID' => 4), // фильтр только по полям элемента, свойства (PROPERTY) использовать нельзя |
This file contains hidden or 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
| $options = new \Bitrix\Main\Grid\Options('catering_events'); | |
| $options->deleteView("default"); | |
| $options = new \Bitrix\Main\Grid\Options('catering_events'); | |
| $options->setAdditionalPresetFields($arFilterFields); |
This file contains hidden or 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
| <? | |
| $hlbl = 6; | |
| $hlblock = HL\HighloadBlockTable::getById($hlbl)->fetch(); | |
| $entity = HL\HighloadBlockTable::compileEntity($hlblock); | |
| $entity_data_class = $entity->getDataClass(); | |
| $rsData = $entity_data_class::getList(array( | |
| "select" => array( | |
| "*", |
This file contains hidden or 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
| архивирование файлов с исключением папок, файлов: | |
| tar -zcpvf site.tar.gz --exclude={upload/video,bitrix/backup,bitrix/cache,bitrix/managed_cache,/.git,/upload} | |
| zip -r apps.zip ../apps -x "**/vendor/*" -x "**/logs/*" -x "**/log/*" -x "**/.idea/*" -x "**/upload/*" -x "**/uploads/*" -x "**/.git/*" -x "**/cache/*" -x "**/bundles/*" -x "**/bundle/*" -x "*.sqlite" -x "*.tar" -x "*.zip" -x "*.gz" |
This file contains hidden or 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
| # -m - создание директории | |
| sudo useradd -m login | |
| # usermod -aG - добавлить пользователя в группу sudo | |
| sudo usermod -aG sudo login | |
| # установить пароль | |
| sudo passwd login |
This file contains hidden or 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
| SELECT id, name, description | |
| FROM products | |
| ORDER BY CASE WHEN name LIKE '%string%' THEN 2 WHEN description LIKE '%string%' THEN 1 ELSE 0 END DESC, name |
This file contains hidden or 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
| # 302 редирект | |
| RewriteCond %{REQUEST_URI} /documents/obnovleniya-v-rabote-platformy/$ | |
| RewriteRule ^(.*)$ http://%{SERVER_NAME}/documents/poryadok-raboty-platformy/ [R=302,NC,L] | |
| # 301 редирект | |
| Redirect 301 /dir1/ http://%{SERVER_NAME}/dir2/ |
This file contains hidden or 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
| if (window.performance && window.performance.navigation.type === window.performance.navigation.TYPE_BACK_FORWARD) { | |
| alert('Got here using the browser "Back" or "Forward" button.'); | |
| console.log($('.js-tabs__block.open #searchForm').find('input').val()); | |
| } |
This file contains hidden or 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 | |
| ini_set('error_reporting', E_ALL); | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| //amo | |
| //ПРЕДОПРЕДЕЛЯЕМЫЕ ПЕРЕМЕННЫЕ | |
| $responsible_user_id = 1665910; //id ответственного по сделке, контакту, компании | |
| $lead_name = 'Заявка с сайта'; //Название добавляемой сделки |