@@ 20-31 (lines=12) @@ | ||
17 | $this->content=array(); |
|
18 | } |
|
19 | ||
20 | public function addItems($items){ |
|
21 | if(JArray::isAssociative($items)){ |
|
22 | foreach ($items as $k=>$v){ |
|
23 | $this->addItem([$k,$v]); |
|
24 | } |
|
25 | }else{ |
|
26 | foreach ($items as $item){ |
|
27 | $this->addItem($item); |
|
28 | } |
|
29 | } |
|
30 | return $this; |
|
31 | } |
|
32 | ||
33 | public function setItems($items){ |
|
34 | $this->content=$items; |
@@ 141-151 (lines=11) @@ | ||
138 | return $this->addItem(HtmlDropdownItem::avatar($caption, $image)); |
|
139 | } |
|
140 | ||
141 | public function addItems($items){ |
|
142 | if(JArray::isAssociative($items)){ |
|
143 | foreach ($items as $k=>$v){ |
|
144 | $this->addItem($v)->setData($k); |
|
145 | } |
|
146 | }else{ |
|
147 | foreach ($items as $item){ |
|
148 | $this->addItem($item); |
|
149 | } |
|
150 | } |
|
151 | } |
|
152 | ||
153 | public function getItem($index){ |
|
154 | return $this->items[$index]; |