*/ /** * [CLASS/FUNCTION INDEX of SCRIPT] * */ /** * Base class for scripts delivering content to the top menu bar/icon panel. * * @author Kasper Skaarhoj * @package TYPO3 * @subpackage core */ class t3lib_topmenubase { function menuItems($menuItems) { $output = ''; // Traverse items: foreach($menuItems as $item) { // Divider has no other options: if ($item['title']=='--div--') { $output.= ''; } else { $itemCode = ''; $onClick = ''; // Render subitems if any: if (is_array($item['subitems'])) { $itemCode.= $this->menuLayer($item['subitems'],$item['id']); } // Render state icon if any: switch ($item['state']) { case 'checked'; $itemCode.= ''; break; default: $itemCode.= ''; break; } // Render icon if any: if ($item['icon']) { if (is_array($item['icon'])) { $itemCode.= ''; } else { $itemCode.= $item['icon']; } } // Title: $itemCode.= htmlspecialchars($item['title']).'  '; // if subitems, show arrow pointing right: $itemCode.= is_array($item['subitems']) ? '' : ''; // Set onclick handlers: $onClick.= $item['xurl'] ? "if (Event.element(event)==this){openUrlInWindow('".$item['xurl']."','aWindow');}" : ''; $onClick.= $item['url'] ? "if (Event.element(event)==this){content.document.location='".$item['url']."';}" : ''; $onClick.= $item['onclick'] ? $item['onclick'] : $item['onclick']; // Wrap it all up: $output.= '
'.$itemCode.'
'; $output.= $item['html']; } } return $output; } /** * */ function menuLayer($menuItems,$baseid='') { $output = $this->menuItems($menuItems); // Encapsulate in menu layer: return $this->simpleLayer($output,$baseid?$baseid.'-layer':''); } function simpleLayer($output,$id='',$class='menulayer') { return ''; } function menuItemLayer($id,$content,$onclick='') { return ''; } function menuItemObject($id,$functionContent) { return ' '; } } ?>