سؤال

To create a custom menu in back-end we create adminhtml.xml with following code into this file. My question is which file(s) are responsible to process this adminhtml.xml file to add our new menu item to the menu.

<adminhtml>
        <menu>
            <[module] module="[module]">
                <title>[Module]</title>
                <sort_order>71</sort_order>               
                <children>
                    <items module="[module]">
                        <title>Manage Items</title>
                        <sort_order>0</sort_order>
                        <action>[module]/adminhtml_[module]</action>
                    </items>
                </children>
            </[module]>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <[module]>
                            <title>[Module] Module</title>
                            <sort_order>200</sort_order>
                        </[module]>
                    </children>
                </admin>
            </resources>   
        </acl>
</adminhtml>
هل كانت مفيدة؟

المحلول

According to app/design/adminhtml/layout/main.xml this block is loaded for the menu:

<block type="adminhtml/page_menu" name="menu" as="menu"></block>

So that concludes that Mage_Adminhtml_Block_Page_Menu (function _buildMenuArray) takes care of building the menu and processing everything. Of course many different components are used in this block.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top