Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,103
    Plugin Contributions
    72

    Default Adding a menu item to the v1.5.0 admin

    Every time I'm adding a new item to my v1.5.0 admin, I search the forums and can never find the post (I know it's there) that identifies how to get your new tool added to the admin menu ... so I'm noting the process here.

    Let's say that you have a new tool named new_tool.php that you want to plug into the Tools menu. Here's the file-system structure you should wind up with:

    Code:
    /YOUR_ADMIN/new_tool.php
        Contains the code that implements your new tool.
    
    /YOUR_ADMIN/includes/extra_datafiles/new_tool_filenames.php
        Contains the filename definition for your new tool, e.g. define('FILENAME_NEW_TOOL', 'new_tool.php');
    
    /YOUR_ADMIN/includes/languages/english/extra_definitions/new_tool_name.php
        Contains the menu entry text definition for your new tool, e.g. define('BOX_TOOLS_NEW_TOOL', 'New Tool');
    
    /YOUR_ADMIN/includes/languages/english/new_tool.php
        Contains the language-specific defines for your new tool, filename must be the same name as to tool itself.
    The following file is where your tool is actually added to the admin Tools menu.

    /YOUR_ADMIN/includes/functions/extra_functions/init_new_tool.php:
    Code:
    if (!defined('IS_ADMIN_FLAG')) {
        die('Illegal Access');
    } 
    
    //----
    // If the installation supports admin-page registration (i.e. v1.5.0 and later), then
    // register the New Tools tool into the admin menu structure.
    //
    if (function_exists('zen_register_admin_page')) {
      if (!zen_page_key_exists('toolsNewTool')) {
        zen_register_admin_page('toolsNewTool', 'BOX_TOOLS_NEW_TOOL', 'FILENAME_NEW_TOOL','' , 'tools', 'Y', 20);
      }    
    }
    • The value toolsNewTool is a (hopefully) unique value that identifies your new tool.
    • The values BOX_TOOLS_NEW_TOOL and FILENAME_NEW_TOOL are defined within the other files within your toolset.
    • The fourth parameter ('') has any parameters that your tool might require. (Rarely used.)
    • The fifth parameter ('tools' in the example) identifies which of the high-level menu items your tool "attaches" to, one of: configuration, catalog, modules, customers, taxes, localization, reports, tools, gv, access, or extras.
    • The sixth parameter ('Y') identifies whether ('Y') or not ('N') to display the page on the admin menu.
    • The seventh parameter (20) is the sort order for the page, i.e. where it lives on the drop-down menu in relation to the sort order of others.

  2. #2
    Join Date
    Jan 2004
    Posts
    65,292
    Blog Entries
    7
    Plugin Contributions
    228

    Default Re: Adding a menu item to the v1.5.0 admin

    NOTE: This post has been updated and converted to an FAQ article at: http://www.zen-cart.com/content.php?...e-v1-5-0-admin
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,103
    Plugin Contributions
    72

    Default Re: Adding a menu item to the v1.5.0 admin

    Thanks, DrByte! Is there a procedure that I can use to modify that FAQ? I was eventually planning on adding instructions for enabling plugins that attach to the Configuration menu via SQL patches.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    9,103
    Plugin Contributions
    72

    Default Re: Adding a menu item to the v1.5.0 admin

    I found it ... I suppose since I'm noted as the author there's a teeny "Edit" button next to the FAQ title. I'll try not to mess it up when I edit it!

  5. #5
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    964
    Plugin Contributions
    6

    Default Re: Adding a menu item to the v1.5.0 admin

    Thanks lat9 - much clearer now.

  6. #6
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Adding a menu item to the v1.5.0 admin

    Does this work with Zen Cart 1.5.1 also?
    Using Zen Cart 1.5.1

 

 

Similar Threads

  1. How do i add an item to the admin menu
    By tcarden in forum General Questions
    Replies: 1
    Last Post: 17 Apr 2013, 11:12 PM
  2. back to the admin homepage after adding item
    By fonzie in forum Basic Configuration
    Replies: 2
    Last Post: 20 Feb 2013, 01:22 PM
  3. Adding a link to the Admin Menu
    By MartynG in forum Basic Configuration
    Replies: 3
    Last Post: 10 Dec 2010, 11:11 AM
  4. Replies: 9
    Last Post: 9 Mar 2009, 08:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR