Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
bypublicmode.php
1
<?php
2
namespace
Bitrix\Sale\Delivery\Restrictions
;
3
4
use
Bitrix\Main\Application
;
5
use
Bitrix\Sale\Delivery\Restrictions
;
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Sale\Internals\Entity
;
8
9
Loc::loadMessages
(__FILE__);
10
16
class
ByPublicMode
extends
Restrictions\Base
17
{
18
public
static
function
getClassTitle
()
19
{
20
return
Loc::getMessage
(
"SALE_DLVR_RSTR_BY_PUBLIC_MODE_NAME"
);
21
}
22
23
public
static
function
getClassDescription
()
24
{
25
return
Loc::getMessage
(
"SALE_DLVR_RSTR_BY_PUBLIC_MODE_DESCRIPT"
);
26
}
27
28
public
static
function
check
($dummy, array $restrictionParams, $deliveryId = 0)
29
{
30
$context =
Application::getInstance
()->getContext();
31
$request = $context->getRequest();
32
33
if
(empty($restrictionParams) || $request->isAdminSection() || (defined(
"BX_PUBLIC_MODE"
) && BX_PUBLIC_MODE ==
true
))
34
return
true
;
35
36
return
$restrictionParams[
"PUBLIC_SHOW"
] ==
'Y'
;
37
}
38
39
protected
static
function
extractParams
(
Entity
$shipment)
40
{
41
return
null
;
42
}
43
44
public
static
function
getParamsStructure
($entityId = 0)
45
{
46
return
array(
47
"PUBLIC_SHOW"
=> array(
48
'TYPE'
=>
'Y/N'
,
49
'VALUE'
=>
'Y'
,
50
'LABEL'
=>
Loc::getMessage
(
"SALE_DLVR_RSTR_BY_PUBLIC_MODE_SHOW"
)
51
)
52
);
53
}
54
}
Bitrix\Catalog\Model\Entity
Definition
entity.php:12
Bitrix\Catalog\Product\Store\DistributionStrategy\Base
Definition
base.php:21
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getInstance
static getInstance()
Definition
application.php:95
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Delivery\Restrictions\ByPublicMode
Definition
bypublicmode.php:17
Bitrix\Sale\Delivery\Restrictions\ByPublicMode\check
static check($dummy, array $restrictionParams, $deliveryId=0)
Definition
bypublicmode.php:28
Bitrix\Sale\Delivery\Restrictions\ByPublicMode\getClassTitle
static getClassTitle()
Definition
bypublicmode.php:18
Bitrix\Sale\Delivery\Restrictions\ByPublicMode\getClassDescription
static getClassDescription()
Definition
bypublicmode.php:23
Bitrix\Sale\Delivery\Restrictions\ByPublicMode\extractParams
static extractParams(Entity $shipment)
Definition
bypublicmode.php:39
Bitrix\Sale\Delivery\Restrictions\ByPublicMode\getParamsStructure
static getParamsStructure($entityId=0)
Definition
bypublicmode.php:44
Bitrix\Sale\Delivery\Restrictions
Definition
base.php:2
modules
sale
lib
delivery
restrictions
bypublicmode.php
Создано системой
1.10.0