• 14th, Jun 2010

Magento Admin Menu and Admin Config Variables

<!-- ************************************************ -->
<!-- ADMIN MENU / ADMIN MENU / ADMIN MENU -->
<!-- ************************************************ -->
<!-- USE: http://127.0.0.1/index.php/admin/report_customer/orders/key/b7ce150ef2c79cb01e8a88cc8287f2c1/ -->
<!-- structure menu: Admin >>> Reports >>> Customers >>> Customer by... -->

<!-- menu definition: -->
	<adminhtml>
        <menu>
            <report>
            <children>
	            <customers>
	            <children>
                     <emails translate="title" module="reports">
        	            <title>Customers recently order</title>
        	            <sort_order>60</sort_order>
                        <action>customreports/adminhtml_customer/order</action>
                    </emails>
                </children>
            </report>
        </menu>
    </adminhtml>
<!-- router definition: -->
	<admin>
		<routers>
			<customreports>
			<use>admin</use>
			<args>
				<module>Unexpectedit_CustomReports</module>
				<frontName>customreports</frontName>
			</args>
			</customreports>
		</routers>
	</admin>
<!-- controller file:
class Unexpectedit_CustomReports_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action
{
    public function orderAction(){
    [...]
}
-->

<!-- ************************************************ -->
<!-- DECLARE RESOURCE with for MENUS FOR ADMIN ROLE USER -->
<!-- ************************************************ -->
<!-- for the Menu defined above, this would be the resource  -->
<!-- Note1: just go to Configuration >>> Permissions >>> Roles  -->
    <adminhtml>
		<acl>
	        <resources>
	            <admin>
	                <children>
                        <report>
							<children>
								<customers>
								<children>
								<emails module="reports">
									<title>Customers recentyly order</title>
								</emails>
								</children>
							</children>
						</report>
					</children>
				</admin>
			</resources>
		</acl>
	</adminhtml>

<!-- ************************************************ -->
<!-- CONFIG VARIABLES, CONFIGURATION >>> Options -->
<!-- ************************************************ -->
<!-- File: etc/system.xml -->
	<?xml version="1.0"?>
      <config>
          <sections>
              <customer>
                  <groups>
                      <create_account>
	                      <fields>
	                        <email_welcome_copy translate="label">
	                            <label>Send Welcome Copy To</label>
	                            <frontend_type>text</frontend_type>
	                            <sort_order>10</sort_order>
	                            <show_in_default>1</show_in_default>
	                            <show_in_website>1</show_in_website>
	                            <show_in_store>1</show_in_store>
	                        </email_welcome_copy>
	                        </fields>
                      </create_account>
                  </groups>
              </customer>
          </sections>
      </config>
<!-- use: -->
<?php
	$email_welcome_copy=Mage::getStoreConfig('customer/create_account/email_welcome_copy');
?>

Tags: , , ,

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.