Magento - js variable category_info_tabsJsTabs - what is this?
I'm trying to reverse engineer some functionality in the admin area but I've come up against a problem. When my custom version of the code runs it fails on this next line, saying that ca开发者_如何学Ctegory_info_tabsJsTabs is not defined
if (category_info_tabsJsTabs.activeTab) {
which was originally in the template file adminhtml_catalog_category_tree.phtml
I've done a text search for this string but I cant seem to find it anywhere and therefore figure out where it was declared. Can anyone help on this?
Thanks, Ian
That particular variable is declared in app/design/adminhtml/default/default/template/widget/tabs.phtml
<script type="text/javascript">
<?php echo $this->getJsObjectName() ?> = new varienTabs('<?php echo $this->getId() ?>', '<?php echo $this->getDestElementId() ?>', '<?php echo $this->getActiveTabId() ?>', <?php echo $this->getAllShadowTabs()?>);
</script>
The method getJsObjectName()
belongs to the class Mage_Adminhtml_Block_Widget_Tabs
. It looks like this:
public function getJsObjectName()
{
return $this->getId() . 'JsTabs';
}
The ID is then set by each descendent of the tabs class, in this case it is Mage_Adminhtml_Block_Catalog_Category_Tabs
which does this:
$this->setId('category_info_tabs');
I was searching for the same stuff, so thought to add location of 'category_info_tabs' here: ./app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php
精彩评论