<?
$GLOBALS['arrFilter'] = ['IBLOCK_SECTION_ID' => $arResult['VARIABLES']['SECTION_ID']];
$APPLICATION->IncludeComponent(
"bitrix:catalog.top",
"top_on_main_new",
array(
"ACTION_VARIABLE" => "action",
"ADD_PICT_PROP" => "-",
"ADD_PROPERTIES_TO_BASKET" => "Y",
"ADD_TO_BASKET_ACTION" => "ADD",
"BASKET_URL" => "/personal/cart/",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "Y",
"CACHE_TIME" => "36000000",
"CACHE_TYPE" => "A",
"CONVERT_CURRENCY" => "Y",
"DETAIL_URL" => "",
"DISPLAY_COMPARE" => "N",
"ELEMENT_COUNT" => "6",
"ELEMENT_SORT_FIELD" => "RAND",
"ELEMENT_SORT_FIELD2" => "id",
"ELEMENT_SORT_ORDER" => "asc",
"ELEMENT_SORT_ORDER2" => "desc",
"HIDE_NOT_AVAILABLE" => "Y",
"IBLOCK_ID" => "6",
"IBLOCK_TYPE" => "content",
"LABEL_PROP" => "-",
"LINE_ELEMENT_COUNT" => "3",
"MESS_BTN_ADD_TO_BASKET" => "В корзину",
"MESS_BTN_BUY" => "Купить",
"MESS_BTN_COMPARE" => "Сравнить",
"MESS_BTN_DETAIL" => "Подробнее",
"MESS_NOT_AVAILABLE" => "Нет в наличии",
"OFFERS_LIMIT" => "5",
"PARTIAL_PRODUCT_PROPERTIES" => "N",
"PRICE_CODE" => array(
0 => "BASE",
),
"PRICE_VAT_INCLUDE" => "Y",
"PRODUCT_ID_VARIABLE" => "id",
"PRODUCT_PROPERTIES" => array(
),
"PRODUCT_PROPS_VARIABLE" => "prop",
"PRODUCT_QUANTITY_VARIABLE" => "",
"PROPERTY_CODE" => array(
0 => "act",
1 => "art",
2 => "brand",
3 => "onmain",
4 => "prop",
5 => "oldprice",
6 => "hit",
7 => "",
),
"SECTION_ID_VARIABLE" => "SECTION_ID",
"SECTION_URL" => "",
"SEF_MODE" => "N",
"SHOW_CLOSE_POPUP" => "N",
"SHOW_DISCOUNT_PERCENT" => "N",
"SHOW_OLD_PRICE" => "N",
"SHOW_PRICE_COUNT" => "1",
"TEMPLATE_THEME" => "blue",
"USE_PRICE_COUNT" => "N",
"USE_PRODUCT_QUANTITY" => "N",
"VIEW_MODE" => "SECTION",
"COMPONENT_TEMPLATE" => "top_on_main_new",
"CURRENCY_ID" => "RUB",
"FILTER_NAME" => "arrFilter",
"CUSTOM_FILTER" => "",
"HIDE_NOT_AVAILABLE_OFFERS" => "Y",
"COMPOSITE_FRAME_MODE" => "A",
"COMPOSITE_FRAME_TYPE" => "AUTO",
"COMPATIBLE_MODE" => "Y"
),
false
);
?>
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
//|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
require __DIR__.'/../vendor/autoload.php';
Debug::enable();
$kernel = new AppKernel('dev', true);
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
$role = $_SESSION['role'];
class admin {
public $addItem;
public static function hasAddItemPermission()
{
return $addItem = true;
}
public $editItem;
public function hasEditItemPermission()
{
return $editItem = true;
}
public $deleteItem;
public function hasDeleteItemPermission()
{
return $deleteItem = true;
}
}
class moderator {
public $addItem;
public static function hasAddItemPermission()
{
return $addItem = false;
}
public $editItem;
public function hasEditItemPermission()
{
return $editItem = true;
}
public $deleteItem;
public function hasDeleteItemPermission()
{
return $deleteItem = true;
}
}
class publicator {
public $addItem;
public static function hasAddItemPermission()
{
return $addItem = true;
}
public $editItem;
public function hasEditItemPermission()
{
return $editItem = false;
}
public $deleteItem;
public function hasDeleteItemPermission()
{
return $deleteItem = false;
}
}
class Factory {
public static function createUsers($role){
if(class_exists($role))
return new $role;
else
echo ("Роль".$role."отсутствует");
}
}
$login = Factory::createUsers($role);
//var_dump($login);
$addPermission = $role::hasAddItemPermission();
$editPermission = $role::hasEditItemPermission();
$deletePermission = $role::hasDeleteItemPermission();
public function hasAddItemPermission()
{
return $this->addItem;
}
Сам файл должен лежать в директории view/frontend/web/css, правильно понимаю?