if (is_array($val)) {
$cc=0;
while(list(,$content)=each($val)) {
if (is_array($val)) {
$cc=0;
while(list(,$content)=each($val)) {
- $wrap= is_array($layoutRow[$cc]) ? $layoutRow[$cc] : (is_array($layout[$cc]) ? $layout[$cc] : $layout['defCol']);
+ $wrap= is_array($layoutRow[$cc]) ? $layoutRow[$cc] : (is_array($layoutRow['defCol']) ? $layoutRow['defCol'] : (is_array($layout[$cc]) ? $layout[$cc] : $layout['defCol']));
$code_td.=$wrap[0].$content.$wrap[1];
$cc++;
}
$code_td.=$wrap[0].$content.$wrap[1];
$cc++;
}
* Returns a tab menu for a module
* Requires the JS function jumpToUrl() to be available
*
* Returns a tab menu for a module
* Requires the JS function jumpToUrl() to be available
*
- * @param string $id is the "&id=" parameter value to be sent to the module
+ * @param string $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentValue is the value to be selected currently.
* @param array $menuItems is an array with the menu items for the selector box
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentValue is the value to be selected currently.
* @param array $menuItems is an array with the menu items for the selector box
* @return string HTML code for tab menu
* @author René Fritz <r.fritz@colorcube.de>
*/
* @return string HTML code for tab menu
* @author René Fritz <r.fritz@colorcube.de>
*/
- function getTabMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='') {
+ function getTabMenu($mainParams,$elementName,$currentValue,$menuItems,$script='',$addparams='') {
$content='';
if (is_array($menuItems)) {
$content='';
if (is_array($menuItems)) {
+ if (!is_array($mainParams)) {
+ $mainParams = array('id' => $mainParams);
+ }
+ $mainParams = t3lib_div::implodeArrayForUrl('',$mainParams);
+
if (!$script) {$script=basename(PATH_thisScript);}
$menuDef = array();
foreach($menuItems as $value => $label) {
$menuDef[$value]['isActive'] = !strcmp($currentValue,$value);
$menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
if (!$script) {$script=basename(PATH_thisScript);}
$menuDef = array();
foreach($menuItems as $value => $label) {
$menuDef[$value]['isActive'] = !strcmp($currentValue,$value);
$menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
- $menuDef[$value]['url'] = htmlspecialchars($script.'?id='.rawurlencode($id).$addparams.'&'.$elementName.'='.$value);
+ $menuDef[$value]['url'] = htmlspecialchars($script.'?'.$mainParams.$addparams.'&'.$elementName.'='.$value);
}
$content = $this->getTabMenuRaw($menuDef);
}
$content = $this->getTabMenuRaw($menuDef);