Inapp/code/core/Mage/Core/functions.phpMagento offers a function namedmageDebugBacktrace()which is nice, but I thought could be made nicer. This backtrace shows frame numbers, file names and line numbers, classes, methods and arguments where possible. It can be placed anywhere you fancy, as long as it is included by Magento - I normally add it to functions.php when needed, and remove when I’m done.
This should go in adminhtml.xml. Also seeConfig ACL Definition (note that the XML path of the ACL entry needs to match up with the XML path of the menu entry).
To place an entry under the sales node (alter the name for other nodes):
<adminhtml>
<menu>
<sales>
<children>
<namespace_module translate="title" module="namespace_module">
<title>Your Module</title>
<sort_order>100</sort_order>
<action>adminhtml/namespace_module</action>
<!-- Children are optional, you should remove the above <action> if you have them -->
<children>
<this translate="title" module="namespace_module">
<title>This</title>
<sort_order>10</sort_order>
<action>adminhtml/namespace_module_this</action>
</this>
<that translate="title" module="namespace_module">
<title>That</title>
<sort_order>20</sort_order>
<action>adminhtml/namespace_module_that</action>
</that>
</children>
</namespace_module>
</children>
</sales>
</menu>
</adminhtml>
To place an entry on the top bar itself:
<adminhtml>
<menu>
<namespace_module translate="title" module="namespace_module">
<title>Your Module</title>
<sort_order>100</sort_order>
<action>adminhtml/namespace_module</action>
<!-- Children are optional, you should remove the above <action> if you have them -->
<children>
<this translate="title" module="namespace_module">
<title>This</title>
<sort_order>10</sort_order>
<action>adminhtml/namespace_module_this</action>
</this>
<that translate="title" module="namespace_module">
<title>That</title>
<sort_order>20</sort_order>
<action>adminhtml/namespace_module_that</action>
</that>
</children>
</namespace_module>
</menu>
</adminhtml>
Config ACL Definition
This should go inadminhtml.xml. Also seeConfig Menu Definition (note that the XML path of the menu entry needs to match up with the XML path of the ACL entry). To see how to implement the checking of an ACL within an admin controller see the_isAllowed() method inBoilerplate Admin Controller.
To place an entry under the sales node (alter the name for other nodes):
No comments:
Post a Comment