{event name='fieldsets'}
- <div class="tabMenuContainer" data-active="{$activeMenuItem}" data-store="activeTabMenuItem">
+ <div class="tabMenuContainer" data-active="{$activeTabMenuItem}" data-store="activeTabMenuItem">
<nav class="tabMenu">
<ul>
{foreach from=$optionTree item=categoryLevel1}
</nav>
{foreach from=$optionTree item=categoryLevel1}
- <div id="{@$categoryLevel1[object]->categoryName}" class="container containerPadding tabMenuContainer tabMenuContent" data-active="{$activeTabMenuItem}" data-store="activeMenuItem">
+ <div id="{@$categoryLevel1[object]->categoryName}" class="container containerPadding tabMenuContainer tabMenuContent">
<nav class="menu">
<ul>
{foreach from=$categoryLevel1[categories] item=$categoryLevel2}
return true;
}
+ if ($tabMenu.data('store') && !$('#' + $tabMenu.data('store')).length) {
+ $('<input type="hidden" name="' + $tabMenu.data('store') + '" value="" id="' + $tabMenu.data('store') + '" />').appendTo($tabMenu.parents('form').find('.formSubmit'));
+ }
+
// init jQuery UI TabMenu
self._containers[$containerID] = $tabMenu;
$tabMenu.wcfTabs({
var $container = $panel.closest('.tabMenuContainer');
// store currently selected item
- if ($container.data('store')) {
- if ($.wcfIsset($container.data('store'))) {
- $('#' + $container.data('store')).attr('value', $panel.attr('id'));
+ var $tabMenu = $container;
+ while (true) {
+ // do not trigger on init
+ if ($tabMenu.data('isParent') === undefined) {
+ break;
+ }
+
+ if ($tabMenu.data('isParent')) {
+ if ($tabMenu.data('store')) {
+ $('#' + $tabMenu.data('store')).val($panel.attr('id'));
+ }
+
+ break;
+ }
+ else {
+ $tabMenu = $tabMenu.data('parent');
}
}
});
}
- $tabMenu.data('isParent', ($tabMenu.children('.tabMenuContainer').length)).data('parent', false);
+ $tabMenu.data('isParent', ($tabMenu.children('.tabMenuContainer').length > 0)).data('parent', false);
if (!$tabMenu.data('isParent')) {
// check if we're a child element
if ($tabMenu.parent().hasClass('tabMenuContainer')) {
*/
public $categoryID = 0;
- /**
- * active tab menu item name
- * @var string
- */
- public $activeTabMenuItem = '';
-
/**
* option name for highlighting
* @var string
parent::readParameters();
}
- /**
- * @see wcf\form\IForm::readFormParameters()
- */
- public function readFormParameters() {
- parent::readFormParameters();
-
- if (isset($_POST['activeTabMenuItem'])) $this->activeTabMenuItem = $_POST['activeTabMenuItem'];
- }
-
/**
* @see wcf\form\IForm::save()
*/
parent::assignVariables();
WCF::getTPL()->assign(array(
- 'activeTabMenuItem' => $this->activeTabMenuItem,
'category' => $this->category,
'optionName' => $this->optionName,
'optionTree' => $this->optionTree
*/
public $cacheName = 'userGroup-option';
- /**
- * active tab menu item name
- * @var string
- */
- public $activeTabMenuItem = '';
-
- /**
- * active sub tab menu item name
- * @var string
- */
- public $activeMenuItem = '';
-
/**
* option tree
* @var array
I18nHandler::getInstance()->readValues();
if (I18nHandler::getInstance()->isPlainValue('groupName')) $this->groupName = I18nHandler::getInstance()->getValue('groupName');
- if (isset($_POST['activeTabMenuItem'])) $this->activeTabMenuItem = $_POST['activeTabMenuItem'];
- if (isset($_POST['activeMenuItem'])) $this->activeMenuItem = $_POST['activeMenuItem'];
}
/**
WCF::getTPL()->assign(array(
'groupName' => $this->groupName,
'optionTree' => $this->optionTree,
- 'action' => 'add',
- 'activeTabMenuItem' => $this->activeTabMenuItem,
- 'activeMenuItem' => $this->activeMenuItem
+ 'action' => 'add'
));
}
use wcf\system\event\EventHandler;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
+use wcf\util\StringUtil;
/**
* This class provides default implementations for the Form interface.
* @category Community Framework
*/
abstract class AbstractForm extends AbstractPage implements IForm {
+ /**
+ * active tab menu item
+ * @var string
+ */
+ public $activeTabMenuItem = '';
+
/**
* name of error field
* @var string
public function readFormParameters() {
// call readFormParameters event
EventHandler::getInstance()->fireAction($this, 'readFormParameters');
+
+ if (isset($_POST['activeTabMenuItem'])) $this->activeTabMenuItem = StringUtil::trim($_POST['activeTabMenuItem']);
}
/**
// assign default variables
WCF::getTPL()->assign(array(
+ 'activeTabMenuItem' => $this->activeTabMenuItem,
'errorField' => $this->errorField,
'errorType' => $this->errorType
));