Feature #35891 ยป IconInAddItems.patch
typo3_src/t3lib/class.t3lib_tceforms.php 2012-04-12 10:25:50.000000000 +0200 | ||
---|---|---|
* Merges items into an item-array
|
||
*
|
||
* @param array The existing item array
|
||
* @param array An array of items to add. NOTICE: The keys are mapped to values, and the values and mapped to be labels. No possibility of adding an icon.
|
||
* @param array An array of items to add. NOTICE: The keys are mapped to values, and the values and mapped to be labels and icons (pipe separated, the icon is optional).
|
||
* @return array The updated $item array
|
||
*/
|
||
function addItems($items, $iArray) {
|
||
if (is_array($iArray)) {
|
||
foreach ($iArray as $value => $label) {
|
||
$items[] = array($this->sl($label), $value);
|
||
foreach ($iArray as $value => $config) {
|
||
$configArray = t3lib_div::trimExplode('|',$config);
|
||
$label = (isset($configArray[0]) && $configArray[0] ? $configArray[0] : '' );
|
||
$icon = (isset($configArray[1]) && $configArray[1] ? $configArray[1] : '' );
|
||
|
||
$items[] = array($this->sl($label), $value, $icon);
|
||
}
|
||
}
|
||
return $items;
|