Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
anonymity.php
1
<?php
8
namespace
Bitrix\Vote\Vote
;
9
use \Bitrix\Main\Localization\Loc;
10
11
Loc::loadMessages
(__FILE__);
12
13
class
Anonymity
14
{
15
const
UNDEFINED
= 0;
16
const
PUBLICLY
= 1;
17
const
ANONYMOUSLY
= 2;
18
23
public
static
function
getList
()
24
{
25
return
(
new
\ReflectionClass(__CLASS__))->getConstants();
26
}
31
public
static
function
getTitledList
()
32
{
33
$res = (new \ReflectionClass(__CLASS__))->getConstants();
34
$result = array();
35
foreach
($res as $code => $id)
36
{
37
$result[$id] =
Loc::getMessage
(
"VOTE_ANONYMITY_TYPE_"
.$code);
38
}
39
return
$result;
40
}
41
45
public
static
function
getValues
()
46
{
47
return
array_values(self::getList());
48
}
55
public
static
function
isUserVoteVisible
(
bool
$userValue,
int
$voteValue)
56
{
57
if
($voteValue === self::ANONYMOUSLY)
58
return
false
;
59
else
if
($voteValue === self::PUBLICLY)
60
return
true
;
61
return
$userValue !==
false
;
62
}
63
public
static
function
getTitle
()
64
{
65
return
Loc::getMessage
(
"VOTE_ANONYMITY_TITLE"
);
66
}
67
public
static
function
validate
($value)
68
{
69
70
}
71
}
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\Vote\Vote\Anonymity
Definition
anonymity.php:14
Bitrix\Vote\Vote\Anonymity\validate
static validate($value)
Definition
anonymity.php:67
Bitrix\Vote\Vote\Anonymity\isUserVoteVisible
static isUserVoteVisible(bool $userValue, int $voteValue)
Definition
anonymity.php:55
Bitrix\Vote\Vote\Anonymity\getValues
static getValues()
Definition
anonymity.php:45
Bitrix\Vote\Vote\Anonymity\PUBLICLY
const PUBLICLY
Definition
anonymity.php:16
Bitrix\Vote\Vote\Anonymity\getTitledList
static getTitledList()
Definition
anonymity.php:31
Bitrix\Vote\Vote\Anonymity\ANONYMOUSLY
const ANONYMOUSLY
Definition
anonymity.php:17
Bitrix\Vote\Vote\Anonymity\UNDEFINED
const UNDEFINED
Definition
anonymity.php:15
Bitrix\Vote\Vote\Anonymity\getList
static getList()
Definition
anonymity.php:23
Bitrix\Vote\Vote\Anonymity\getTitle
static getTitle()
Definition
anonymity.php:63
Bitrix\Vote\Vote
Definition
anonymity.php:8
modules
vote
lib
vote
anonymity.php
Создано системой
1.10.0