1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Asymptix\ui\components; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* DropBox UI component class. |
7
|
|
|
* |
8
|
|
|
* @category Asymptix PHP Framework |
9
|
|
|
* @author Dmytro Zarezenko <[email protected]> |
10
|
|
|
* @copyright (c) 2009 - 2016, Dmytro Zarezenko |
11
|
|
|
* |
12
|
|
|
* @git https://github.com/Asymptix/Framework |
13
|
|
|
* @license http://opensource.org/licenses/MIT |
14
|
|
|
*/ |
15
|
|
|
class UIDropDown extends \Asymptix\ui\UIComponent { |
16
|
|
|
/** |
17
|
|
|
* Default drop-down list HTML template. |
18
|
|
|
*/ |
19
|
|
|
const DEFAULT_TEMPLATE = "classes/ui_/_templates/components/ui_dropdown.tpl.php"; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Makes the select field focused on page load (empty or 'autofocus', optional). |
23
|
|
|
* |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
public $autofocus = ""; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* When true (not empty), it disables the drop-down list (empty or 'disabled', |
30
|
|
|
* optional). |
31
|
|
|
* |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
public $disabled = ""; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Defines one ore more forms the select field belongs to (optional). |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
public $form = ""; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Generate HTML of the list <select> element for drop-down list. |
45
|
|
|
* |
46
|
|
|
* @param array<mixed> $dataSet List of drop-down options data. |
47
|
|
|
* @param string,integer $currentValue Current value if selected. |
|
|
|
|
48
|
|
|
* @param array<string => string> $attributesList List of the HTML attributes |
49
|
|
|
* for the drop-down element (optional). |
50
|
|
|
* @param string $template Path to the template file of the drop-down (optional). |
51
|
|
|
*/ |
52
|
|
|
public function __construct($dataSet = [], $currentValue = null, $attributesList = [], $template = "") { |
53
|
|
|
if (empty($template)) { |
54
|
|
|
$template = self::DEFAULT_TEMPLATE; |
55
|
|
|
} |
56
|
|
|
parent::__construct($attributesList, $template, $dataSet, $currentValue); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.