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 | |
if (!function_exists('getSectionsHierarchical')): | |
/** | |
* @param Mixed $iblockId ИД информационного блока. Передается в переменную $arFilter[IBLOCK_ID]. | |
* При использовании инфоблоков 1.0 можно передать массив | |
* @param Array $arFilter Остальные параметры переменной $arFilter для CIBlockSection::GetList | |
* @param Array $arOrder Параметры сортировки элементов | |
* @param Array $arSelect Параметры выборки компанентов | |
* @return Array |
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 | |
class UserOptionForm | |
{ | |
const TYPE_ELEMENT = 'element'; | |
const TYPE_SECTION = 'section'; | |
private $name; | |
private $userId; |
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 | |
\Bitrix\Main\Loader::registerAutoLoadClasses(null, [ | |
'\Namespace\Class' => '/local/php_interface/lib/class.php', | |
]); |
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 require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php"); | |
use Bitrix\Main; | |
$eventManager = Main\EventManager::getInstance(); | |
$eventManager->addEventHandler('moduleName', 'onEventName', function(Main\Event $event) { | |
$arUser = $event->getParameter('user'); | |
$arUser['surname'] = 'Doe'; | |
$event->setParameter('user', $arUser); |
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 | |
use Bitrix\Main; | |
use Bitrix\Iblock; | |
function getNews() | |
{ | |
$arNews = []; | |
$arQueryParams = [ | |
'select' => ['*'], |
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
cd /var/www/public/ | |
chown -R www-data:www-data . | |
find . -type d -exec chmod 775 {} \; | |
find . -type f -exec chmod 664 {} \; |
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 | |
if (!defined("ERROR_404")) define("ERROR_404", "Y"); | |
\CHTTP::setStatus("404 Not Found"); | |
if ($APPLICATION->RestartWorkarea()) | |
{ | |
require(\Bitrix\Main\Application::getDocumentRoot() . "/404.php"); | |
die(); |
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 | |
use Bitrix\Main\EventManager; | |
use Bitrix\Main\Localization\Loc; | |
use Bitrix\Main\UserField\Types\StringType; | |
use Bitrix\Main\UserFieldTable; | |
if (!function_exists('escapeTime')): | |
function escapeTime($string, $del = ':') | |
{ |
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 | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
global $USER; | |
$USER->Authorize(1); | |
LocalRedirect("/bitrix/admin/"); |
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
ln -s /etc/nginx/sites-available/www.example.org.conf /etc/nginx/sites-enabled/ |