$(function() {
WCF.TabMenu.init();
new WCF.ACP.Options();
+
+ {if $optionName}
+ var $option = $('#' + $.wcfEscapeID('{$optionName}'));
+ new WCF.PeriodicalExecuter(function(pe) {
+ pe.stop();
+
+ var $scrollHandler = new WCF.Effect.Scroll();
+ $scrollHandler.scrollTo($option, true);
+ $option.focus();
+ }, 200);
+ {/if}
});
//]]>
</script>
use wcf\system\menu\acp\ACPMenu;
use wcf\system\WCF;
use wcf\system\WCFACP;
+use wcf\util\StringUtil;
/**
* Shows the option edit form.
*/
public $activeTabMenuItem = '';
+ /**
+ * option name for highlighting
+ * @var string
+ */
+ public $optionName = '';
+
/**
* the option tree
* @var array
}
$this->categoryName = $this->category->categoryName;
+ if (isset($_GET['optionName'])) $this->optionName = StringUtil::trim($_GET['optionName']);
+
parent::readParameters();
}
$this->optionTree = $this->optionHandler->getOptionTree($this->category->categoryName);
if (!count($_POST)) {
+ // not a valid top (level 1 or 2) category
+ if (!isset($this->optionTree[0])) {
+ throw new IllegalLinkException();
+ }
+
$this->activeTabMenuItem = $this->optionTree[0]['object']->categoryName;
}
}
parent::assignVariables();
WCF::getTPL()->assign(array(
+ 'activeTabMenuItem' => $this->activeTabMenuItem,
'category' => $this->category,
- 'optionTree' => $this->optionTree,
- 'activeTabMenuItem' => $this->activeTabMenuItem
+ 'optionName' => $this->optionName,
+ 'optionTree' => $this->optionTree
));
}