Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
questiontypes.php
1
<?php
8
namespace
Bitrix\Vote
;
9
use \Bitrix\Main\Localization\Loc;
10
11
Loc::loadMessages
(__FILE__);
12
13
class
QuestionTypes
14
{
15
const
RADIO
= 0;
16
const
CHECKBOX
= 1;
17
const
DROPDOWN
= 2;
18
const
MULTISELECT
= 3;
19
const
COMPATIBILITY
= 99999;
20
25
public
static
function
getValues
()
26
{
27
$res = (new \ReflectionClass(__CLASS__))->getConstants();
28
return
array_values($res);
29
}
34
public
static
function
getList
()
35
{
36
$res = (new \ReflectionClass(__CLASS__))->getConstants();
37
$result = array();
38
foreach
($res as $code => $id)
39
{
40
$result[$id] =
Loc::getMessage
(
"VOTE_QUESTION_TYPE_"
.$code);
41
}
42
return
$result;
43
}
48
public
static
function
getFullList
()
49
{
50
$res = (new \ReflectionClass(__CLASS__))->getConstants();
51
$result = array();
52
foreach
($res as $code => $id)
53
{
54
$result[] = array(
"ID"
=> $id,
"CODE"
=> $code,
"TITLE"
=>
Loc::getMessage
(
"VOTE_QUESTION_TYPE_"
.$code));
55
}
56
return
$result;
57
}
62
public
static
function
getTitledList
()
63
{
64
$res = (new \ReflectionClass(__CLASS__))->getConstants();
65
$result = array();
66
foreach
($res as $code => $id)
67
{
68
$result[$id] =
Loc::getMessage
(
"VOTE_QUESTION_TYPE_"
.$code);
69
}
70
return
$result;
71
}
72
78
public
static
function
getTitleById
($id)
79
{
80
$res = array_flip((
new
\ReflectionClass(__CLASS__))->getConstants());
81
$val = $id;
82
if
(array_key_exists($id, $res))
83
{
84
$val =
Loc::getMessage
(
"VOTE_QUESTION_TYPE_"
.$res[$id]);
85
}
86
return
$val;
87
}
88
}
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\QuestionTypes
Definition
questiontypes.php:14
Bitrix\Vote\QuestionTypes\CHECKBOX
const CHECKBOX
Definition
questiontypes.php:16
Bitrix\Vote\QuestionTypes\getValues
static getValues()
Definition
questiontypes.php:25
Bitrix\Vote\QuestionTypes\getTitledList
static getTitledList()
Definition
questiontypes.php:62
Bitrix\Vote\QuestionTypes\COMPATIBILITY
const COMPATIBILITY
Definition
questiontypes.php:19
Bitrix\Vote\QuestionTypes\RADIO
const RADIO
Definition
questiontypes.php:15
Bitrix\Vote\QuestionTypes\getTitleById
static getTitleById($id)
Definition
questiontypes.php:78
Bitrix\Vote\QuestionTypes\getFullList
static getFullList()
Definition
questiontypes.php:48
Bitrix\Vote\QuestionTypes\DROPDOWN
const DROPDOWN
Definition
questiontypes.php:17
Bitrix\Vote\QuestionTypes\MULTISELECT
const MULTISELECT
Definition
questiontypes.php:18
Bitrix\Vote\QuestionTypes\getList
static getList()
Definition
questiontypes.php:34
Bitrix\Vote
Definition
answer.php:8
modules
vote
lib
questiontypes.php
Создано системой
1.10.0