IconInAddItems.patch

Philipp Mueller, 2012-04-12 10:44

Download (1.24 KB)

View differences:

typo3_src/t3lib/class.t3lib_tceforms.php 2012-04-12 10:25:50.000000000 +0200
4465 4465
	 * Merges items into an item-array
4466 4466
	 *
4467 4467
	 * @param	array		The existing item array
4468
	 * @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.
4468
	 * @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).
4469 4469
	 * @return	array		The updated $item array
4470 4470
	 */
4471 4471
	function addItems($items, $iArray) {
4472 4472
		if (is_array($iArray)) {
4473
			foreach ($iArray as $value => $label) {
4474
				$items[] = array($this->sl($label), $value);
4473
			foreach ($iArray as $value => $config) {
4474
				$configArray = t3lib_div::trimExplode('|',$config);
4475
				$label = (isset($configArray[0]) && $configArray[0] ? $configArray[0] : '' );
4476
				$icon = (isset($configArray[1]) && $configArray[1] ? $configArray[1] : '' );
4477
				
4478
				$items[] = array($this->sl($label), $value, $icon);
4475 4479
			}
4476 4480
		}
4477 4481
		return $items;