Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
answertypes.php
1
<?php
8
namespace
Bitrix\Vote
;
9
use \Bitrix\Main\Localization\Loc;
10
11
Loc::loadMessages
(__FILE__);
12
13
class
AnswerTypes
14
{
15
const
RADIO
= 0;
16
const
CHECKBOX
= 1;
17
const
DROPDOWN
= 2;
18
const
MULTISELECT
= 3;
19
const
TEXT
= 4;
20
const
TEXTAREA
= 5;
21
26
public
static
function
getFullList
()
27
{
28
$res = (new \ReflectionClass(__CLASS__))->getConstants();
29
$result = array();
30
foreach
($res as $code => $id)
31
{
32
$result[] = array(
"ID"
=> $id,
"CODE"
=> $code,
"TITLE"
=>
Loc::getMessage
(
"VOTE_ANSWER_TYPE_"
.$code));
33
}
34
return
$result;
35
}
36
41
public
static
function
getTitledList
()
42
{
43
$res = (new \ReflectionClass(__CLASS__))->getConstants();
44
$result = array();
45
foreach
($res as $code => $id)
46
{
47
$result[$id] =
Loc::getMessage
(
"VOTE_ANSWER_TYPE_"
.$code);
48
}
49
return
$result;
50
}
51
57
public
static
function
getTitleById
($id)
58
{
59
$res = array_flip((
new
\ReflectionClass(__CLASS__))->getConstants());
60
$val = $id;
61
if
(array_key_exists($id, $res))
62
{
63
$val =
Loc::getMessage
(
"VOTE_ANSWER_TYPE_"
.$res[$id]);
64
}
65
return
$val;
66
}
67
}
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\AnswerTypes
Definition
answertypes.php:14
Bitrix\Vote\AnswerTypes\CHECKBOX
const CHECKBOX
Definition
answertypes.php:16
Bitrix\Vote\AnswerTypes\TEXT
const TEXT
Definition
answertypes.php:19
Bitrix\Vote\AnswerTypes\getTitledList
static getTitledList()
Definition
answertypes.php:41
Bitrix\Vote\AnswerTypes\RADIO
const RADIO
Definition
answertypes.php:15
Bitrix\Vote\AnswerTypes\getTitleById
static getTitleById($id)
Definition
answertypes.php:57
Bitrix\Vote\AnswerTypes\getFullList
static getFullList()
Definition
answertypes.php:26
Bitrix\Vote\AnswerTypes\DROPDOWN
const DROPDOWN
Definition
answertypes.php:17
Bitrix\Vote\AnswerTypes\TEXTAREA
const TEXTAREA
Definition
answertypes.php:20
Bitrix\Vote\AnswerTypes\MULTISELECT
const MULTISELECT
Definition
answertypes.php:18
Bitrix\Vote
Definition
answer.php:8
modules
vote
lib
answertypes.php
Создано системой
1.10.0