Jump to content

Custom admin menu fix


Recommended Posts

Ever upgraded and the admin drop down menu goes back to the default after you have customized it ? Really bites doesn't it?

 

Well I just figured out how to keep those changes.

 

First make a copy of includes/jscript/adminmenu.js and place it under your admin/templates/YOUR-ADMIN-TEMPLATE/

 

Now edit that file and remove all the menu items

 

var menu1=new Array()

through

menu9[5]='<a href="http://forum.whmcs.com/" target="_blank">Community Forums</a>'

 

Make sure you keep everything else after

var menuwidth='170px' //default menu width

 

Now add all your custom menu arrays using the same format BUT you begin using the same menu item numbers as you did before...

 

var menu10=new Array()
menu10[0]='<a href="addonmodules.php?module=enom_extended">Home</a>'
menu10[1]='<a href="addonmodules.php?module=enom_extended&page=settings">Settings</a>'
menu10[2]='<a href="addonmodules.php?module=enom_extended&page=domains">Domains</a>'
menu10[3]='<a href="addonmodules.php?module=enom_extended&page=domaindetail">Domain Detail</a>'
menu10[4]='<a href="addonmodules.php?module=enom_extended&page=transfers">Transfers</a>'
menu10[5]='<a href="addonmodules.php?module=enom_extended&page=sslcerts">SSL Certificates</a>'
menu10[6]='<a href="addonmodules.php?module=enom_extended&page=refillaccount">Refill Account</a>'
menu10[7]='<a href="addonmodules.php?module=enom_extended&page=utilities">Utilities</a>'
menu10[8]='<a href="addonmodules.php?module=enom_extended&page=modconfig">Configuration</a>'

 

Just like that.

 

Now add

 

<script type="text/javascript" src="templates/YOUR-ADMIN-TEMPLATE/adminmenu.js"></script>

 

to your admin/templates/YOUR-ADMIN-TEMPLATE/header.tpl BEFORE

</head>

 

Your done. Now go to your admin area and all your custom drop down menus should be there as before but now they wont get overwritten with each upgrade of WHMCS

 

Now I can't be held responsible if you break your menu or admin area so make backups !!

 

I hope this helps others because I was getting pretty annoyed that my custom admin menu was always getting deleted with upgrades.

Edited by sgrayban
typo
Link to comment
Share on other sites

Actually a large step in this can be omitted after I tested this more.

 

You don't need to copy your

includes/jscript/adminmenu.js

 

Just create a adminmenu.js in your admin area template and add all your custom menu items and add the script code like I posted into your header.tpl.

 

You don't need to add anything but the new

var menu10=new Array()

Link to comment
Share on other sites

  • 2 weeks later...

Damn I just found out you can do this to over ride any of the default menus as well.

 

Say you wanted to always have under the clients menu to list only active clients. Just add the original menu and add your custom links like this:

 

var menu2=new Array()
menu2[0]='<a href="clients.php?searchin=id&q=&status=Active">Active Clients</a>'
menu2[1]='<a href="clients.php">View/Search Clients</a>'
menu2[2]='<a href="clientsadd.php">Add New Client</a>'
menu2[3]='<a href="massmail.php">Mass Mail Clients</a>'
menu2[4]='<a href="clientshostinglist.php">List All Products/Services</a>'
menu2[5]='<a href="clientshostinglist.php?type=hostingaccount">List Hosting Accounts</a>'
menu2[6]='<a href="clientshostinglist.php?type=reselleraccount">List Reseller Accounts</a>'
menu2[7]='<a href="clientshostinglist.php?type=server">List Server Accounts</a>'
menu2[8]='<a href="clientshostinglist.php?type=other">List Other Services</a>'
menu2[9]='<a href="clientsaddonslist.php">List Account Addons</a>'
menu2[10]='<a href="clientsdomainlist.php">List Domains</a>'
menu2[11]='<a href="cancelrequests.php">Cancellation Requests</a>'
menu2[12]='<a href="affiliates.php">Manage Affiliates</a>'

 

See menu2[0] ? Now no matter what the default admin menu is for clients this version will always be the one shown.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated