1 | <?php |
||
14 | abstract class cfg_fields |
||
15 | { |
||
16 | /** @var user */ |
||
17 | protected $user; |
||
18 | |||
19 | /** |
||
20 | * Constructor |
||
21 | * |
||
22 | * @param user $user User object |
||
23 | */ |
||
24 | 48 | public function __construct(user $user) |
|
28 | |||
29 | /** |
||
30 | * Used to add multi-select drop down in blocks config |
||
31 | * |
||
32 | * @param array $option_ary |
||
33 | * @param $selected_items |
||
34 | * @param $key |
||
35 | * @return string |
||
36 | */ |
||
37 | 3 | public function build_multi_select(array $option_ary, $selected_items, $key) |
|
51 | |||
52 | /** |
||
53 | * Used to build multi-column checkboxes for blocks config |
||
54 | * |
||
55 | * if multi-dimensional array, we break the checkboxes into columns ex. |
||
56 | * array( |
||
57 | * 'news' => array( |
||
58 | * 'field1' => 'Label 1', |
||
59 | * 'field2' => 'Label 2', |
||
60 | * ), |
||
61 | * 'articles' => array( |
||
62 | * 'field1' => 'Label 1', |
||
63 | * 'field2' => 'Label 2', |
||
64 | * ), |
||
65 | * ) |
||
66 | * @param array $option_ary |
||
67 | * @param $selected_items |
||
68 | * @param $field |
||
69 | * @return string |
||
70 | */ |
||
71 | 4 | public function build_checkbox(array $option_ary, $selected_items, $field) |
|
86 | |||
87 | /** |
||
88 | * Build radio buttons other than yes_no/enable_disable in blocks config |
||
89 | * |
||
90 | * @param array $option_ary |
||
91 | * @param $selected_items |
||
92 | * @param $key |
||
93 | * @return string |
||
94 | */ |
||
95 | 3 | public function build_radio(array $option_ary, $selected_item, $key) |
|
109 | |||
110 | /** |
||
111 | * build hidden field for blocks config |
||
112 | * |
||
113 | * @param $value |
||
114 | * @param $key |
||
115 | * @return string |
||
116 | */ |
||
117 | 2 | public function build_hidden($value, $key) |
|
121 | |||
122 | /** |
||
123 | * @param $selected_items |
||
124 | * @return array |
||
125 | */ |
||
126 | 13 | protected function _ensure_array($selected_items) |
|
130 | |||
131 | /** |
||
132 | * @param $options |
||
133 | * @param $css_class |
||
134 | * @return array |
||
135 | */ |
||
136 | 4 | protected function _ensure_multi_array($options, &$css_class) |
|
146 | |||
147 | /** |
||
148 | * @param string $needle |
||
149 | * @param array $haystack |
||
150 | * @param string $type selected|checked |
||
151 | * @return string |
||
152 | */ |
||
153 | 7 | protected function _get_selected_option($needle, array $haystack, $type = 'selected') |
|
157 | |||
158 | /** |
||
159 | * @param array $row |
||
160 | * @param array $selected_items |
||
161 | * @param string $field |
||
162 | * @param integer $column_count |
||
163 | * @param string $column_class |
||
164 | * @return string |
||
165 | */ |
||
166 | 4 | protected function _get_checkbox_column(array $row, array $selected_items, $field, $column_count, $column_class) |
|
179 | } |
||
180 |