I'm quite a lazy person, there for I created a lazy admin menu for all my forums.
Everything is done in subs.php, no need to add anything to modifications.english.php because it gets everything it needs from admin.english.php. This also means it'll work with other languages packs installed. All tabs have the correct permissions, if you don't have to permission to edit boards, it won't show. If you have permissions to maintenance area and reports aren't enabled it'll still show the tab, just won't take you anywhere.
// Set up the menu privileges.
// Load the Lazy Admin Menu Language Strings...
loadLanguage('Admin');
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
'is_last' => true,
),
),
),
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'index' => array(
'title' => $txt['admin_main'],
'show' => $context['allow_admin'],
'sub_buttons' => array(
'admincentre' => array(
'title' => $txt['admin_center'],
'href' => $scripturl . '?action=admin;area=index',
'show' => $context['allow_admin'],
),
'credits' => array(
'title' => $txt['support_credits_title'],
'href' => $scripturl . '?action=admin;area=credits',
'show' => $context['allow_admin'],
),
'news' => array(
'title' => $txt['news_title'],
'href' => $scripturl . '?action=admin;area=news',
'show' => allowedTo('edit_news', 'send_mail', 'admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
),
),
'config' => array(
'title' => $txt['admin_config'],
'show' => allowedTo('admin_forum'),
'sub_buttons' => array(
'corefeatures' => array(
'title' => $txt['core_settings_title'],
'href' => $scripturl . '?action=admin;area=corefeatures',
'show' => allowedTo('admin_forum'),
),
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'security' => array(
'title' => $txt['admin_security_moderation'],
'href' => $scripturl . '?action=admin;area=securitysettings',
'show' => allowedTo('admin_forum'),
),
'languages' => array(
'title' => $txt['language_configuration'],
'href' => $scripturl . '?action=admin;area=languages',
'show' => allowedTo('admin_forum'),
),
'serversettings' => array(
'title' => $txt['admin_server_settings'],
'href' => $scripturl . '?action=admin;area=serversettings',
'show' => allowedTo('admin_forum'),
),
'current_theme' => array(
'title' => $txt['theme_current_settings'],
'href' => $scripturl . '?action=admin;area=theme;sa=settings',
'show' => allowedTo('admin_forum'),
),
'theme' => array(
'title' => $txt['theme_admin'],
'href' => $scripturl . '?action=admin;area=theme;sa=admin',
'show' => allowedTo('admin_forum'),
),
'modsettings' => array(
'title' => $txt['admin_modifications'],
'href' => $scripturl . '?action=admin;area=modsettings',
'show' => allowedTo('admin_forum'),
),
),
),
'forum' => array(
'title' => $txt['layout_controls'],
'show' => allowedTo(array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum')),
'sub_buttons' => array(
'boards' => array(
'title' => $txt['admin_boards'],
'href' => $scripturl . '?action=admin;area=manageboards',
'show' => allowedTo('manage_boards'),
),
'postssettings' => array(
'title' => $txt['manageposts'],
'href' => $scripturl . '?action=admin;area=postsettings',
'show' => allowedTo(array('admin_forum', 'moderate_forum')),
),
'calendar' => array(
'title' => $txt['manage_calendar'],
'href' => $scripturl . '?action=admin;area=managecalander',
'show' => allowedTo('admin_forum'),
),
'search' => array(
'title' => $txt['manage_search'],
'href' => $scripturl . '?action=admin;area=managesearch',
'show' => allowedTo('admin_forum'),
),
'smileys' => array(
'title' => $txt['smileys_manage'],
'href' => $scripturl . '?action=admin;area=smileys',
'show' => allowedTo('manage_smileys'),
),
'attachments' => array(
'title' => $txt['attachments_avatars'],
'href' => $scripturl . '?action=admin;area=manageattachements',
'show' => allowedTo('manage_attachments'),
),
),
),
'member' => array(
'title' => $txt['admin_manage_members'],
'show' => allowedTo(array('moderate_forum', 'manage_membergroups', 'manage_bans', 'manage_permissions', 'admin_forum')),
'sub_buttons' => array(
'members' => array(
'title' => $txt['admin_users'],
'href' => $scripturl . '?action=admin;area=viewmembers',
'show' => allowedTo('moderate_forum'),
),
'membergroup' => array(
'title' => $txt['admin_groups'],
'href' => $scripturl . '?action=admin;area=membergroups',
'show' => allowedTo('manage_membergroups'),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
),
'registration' => array(
'title' => $txt['registration_center'],
'href' => $scripturl . '?action=admin;area=regcenter',
'show' => allowedTo(array('admin_forum', 'moderate_forum')),
),
'banlist' => array(
'title' => $txt['ban_title'],
'href' => $scripturl . '?action=admin;area=ban',
'show' => allowedTo('manage_attachments'),
),
'paidsubscriptions' => array(
'title' => $txt['paid_subscriptions'],
'href' => $scripturl . '?action=admin;area=paidsubscribe',
'show' => allowedTo('admin_forum'),
),
'search_engines' => array(
'title' => $txt['search_engines'],
'href' => $scripturl . '?action=admin;area=sengines',
'show' => allowedTo('admin_forum'),
),
),
),
'maintenance' => array(
'title' => $txt['admin_maintenance'],
'show' => allowedTo('admin_forum'),
'sub_buttons' => array(
'forum_maintenance' => array(
'title' => $txt['maintain_title'],
'href' => $scripturl . '?action=admin;area=maintain',
'show' => allowedTo('admin_forum'),
),
'schedualed' => array(
'title' => $txt['maintain_tasks'],
'href' => $scripturl . '?action=admin;area=scheduledtasks',
'show' => allowedTo('admin_forum'),
),
'mail' => array(
'title' => $txt['mailqueue_title'],
'href' => $scripturl . '?action=admin;area=mailqueue',
'show' => allowedTo('admin_forum'),
),
'reports' => array(
'title' => $txt['generate_reports'],
'href' => $scripturl . '?action=admin;area=reports',
'show' => allowedTo('admin_forum'),
),
'logs' => array(
'title' => $txt['logs'],
'href' => $scripturl . '?action=admin;area=logs',
'show' => allowedTo('admin_forum'),
),
),
),
),
),
Got Simple Portal? No Problem ;)
// Load the Lazy Admin Menu Language Strings...
loadLanguage('Admin');
loadLanguage('SPortalAdmin');
'attachments' => array(
'title' => $txt['attachments_avatars'],
'href' => $scripturl . '?action=admin;area=manageattachements',
'show' => allowedTo('manage_attachments'),
),
),
),
'portal' => array(
'title' => $txt['sp-adminCatTitle'],
'show' => allowedTo(array('sp_admin', 'sp_manage_settings', 'sp_manage_blocks', 'sp_manage_articles', 'sp_manage_pages', 'sp_manage_shoutbox')),
'sub_buttons' => array(
'portalconfig' => array(
'title' => $txt['sp-adminConfiguration'],
'href' => $scripturl . '?action=admin;area=portalconfig',
'show' => allowedTo(array('sp_admin', 'sp_manage_settings')),
),
'portalblocks' => array(
'title' => $txt['sp-blocksBlocks'],
'href' => $scripturl . '?action=admin;area=portalblocks',
'show' => allowedTo(array('sp_admin', 'sp_manage_blocks')),
),
'portalarticles' => array(
'title' => $txt['sp-adminColumnArticles'],
'href' => $scripturl . '?action=admin;area=portalarticles',
'show' => allowedTo(array('sp_admin', 'sp_manage_articles')),
),
'portalpages' => array(
'title' => $txt['sp_admin_pages_title'],
'href' => $scripturl . '?action=admin;area=portalpages',
'show' => allowedTo(array('sp_admin', 'sp_manage_pages')),
),
'portalshoutbox' => array(
'title' => $txt['sp_admin_shoutbox_title'],
'href' => $scripturl . '?action=admin;area=portalshoutbox',
'show' => allowedTo(array('sp_admin', 'sp_manage_shoutbox')),
),
),
),
Credits to Labradoodle-360 showing me how to load language strings.
Nice tips. Thanks. I have been looking for a way to organize my admin menu. Currently I used cms mod to manage my forum menu. May be this can be packaged as that too. And with admin custom page that have the link and button to manage all settings (like cpanel or so). Hmm... Nice, nice indeed.
EDITED: CMS Mod is no longer available from SMF Mod site/ page.
I'm no mod developer or programmer. I couldn't even get it to hide tabs like reports if the feature isn't enabled, even with IchBin™ trying to explain it to me lol.
Cool. I do something similar but don't take it that far as I just want the areas I use regularly. Anyone can alter it to suit themselves though. I'll move this to Tips and Tricks. :)
Exactly, it takes less than a minute to remove the tabs and category's you do not want.
I for got to ask, is this for SMF 2.0 RCx or 1.1.x?
Try loading a 1.1.x menu from an array like that and see how far you get. ;)
Quote from: Antechinus on September 16, 2010, 04:46:03 AM
Try loading a 1.1.x menu from an array like that and see how far you get. ;)
So, it's basically 2.0 RCx. He he he... :D
Nice tip , will make admins like me more lazy :P
Added Simpleportal if anybody wants it.
Oh my kind of tip: promoting lazyness!
Thanks acans :)
Very nice! :D But you stole my modification idea. :( No, just joking. :P Very good job! :D
Dunno how I missed this, for so long...
It's brilliant! Ta, ѕησω!
Pretty laid out actually! I've just started emerging myself into forums. Well, I do hope I'll be able to manage my forums a little easier through this. Thanks!
Now it is already made a mod K@. Lazy admin can be even lazier when using a packaged mod. Ha ha ha...
Heh... As it happens, I think the menus should be like that, as standard. :)
As a footnote, it's this one --> http://www.simplemachines.org/community/index.php?topic=525466.0 taken from ѕησω and published by DougieFresh :D
Hahaha... And now it being discussed by our captain there. Interesting...
Just what I was looking for ;) I better try this. I'll just update you how it works on my end. Thanks!
There is already a packaged mod for this. But of course you can manually do it.
/me wonders how much of a pain it'd be, to extend this to include the "Profile" menu...
Quote from: ahrasis on July 26, 2014, 01:01:51 AM
There is already a packaged mod for this. But of course you can manually do it.
Why take the easy route when you can do it the hard way. ;)
@ K@ ... that would be nice wouldn't it?
Lol @ NanoSector
The answer is ugliness, it's why when I redid the profile menu in 2.1, I deliberately *didn't* do it the same way, especially since while it's not too bad in performance doing the admin menu due to a lack of people doing the admin menu thing, it's significantly more serious for the profile menu.
Shame...
Did you see what I did in 2.1 though? It's almost as good IMNSHO.
Not yet. I have yummy access to young Rick's site, though. I'll have a butcher's.
The profile menu is now at the top, along with messages and notifications.
Oh, yeah! I forgot how to get to the profile, at first... :P
MUCH better. :)
I thought so. There were people who didn't approve of the way I implemented it because loading all the profile menu every page rather than doing a call to the server to get it was obviously terrible.
Well, it works. It seems to work quickly, on Rick's site, and it's infinitely better'n what's in 2.0.x.
Sooooo...
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.katzy.dsl.pipex.com%2FSmileys%2Fc014.gif&hash=f74820123053ff9301b57a2ded5672bfa96b900b)
'course, being an old fart, I still prefer the old "Icons" approach. But, that's another skirmish. ;)
I like to think I made several usability improvements in 2.1 even if they ignore consistency.
Improving the admin menu as per this tip (or mod) though is not one of them :/
Quote from: ‽ on July 26, 2014, 10:28:13 AM
IMNSHO
Lols...
If you could maybe do the same with lazy admin menu the way you did for profile menu in 2.1? :P
I never check the code in 2.1 though have tested it. I'll wait until it is beta to do the Malay translation and going through the codes. [lazy translator mode] ;)
You're presuming that I care enough about 2.1 to write any code for it any more.
What I did was set up a special callback in the profile to serve a dedicated template. Doing that for admin would be a mess in 2.1 simply because there's just so much more stuff and the profile popup is only a specific subset of what's in the profile since most of the things you just don't need instant access to.
I do hope I could get something great from this since I'm still a newbie. Anyway, thanks!
Quote from: K@ on July 26, 2014, 04:30:55 AM
/me wonders how much of a pain it'd be, to extend this to include the "Profile" menu...
Better Profile Menu (http://custom.simplemachines.org/mods/index.php?mod=3904) was written.... Only it duplicates the menu structure as SMF 2.1 Alpha 1 does it, but not the whole effect. It's a static menu, but it's like this tip.
And it has a problem still as I posted in that mod's thread. ;)
The problems have been addressed in the other thread.....
And fixed. (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi1262.photobucket.com%2Falbums%2Fii614%2FOPStuph%2FSmilies%2Fthumbs-up.gif&hash=0a269f01d090bee70f928a97ea14bf37388a718e)
Everyone's a winner :)
I just realize that this mod and the packaged mod is different in the sense that the packaged mod is listing the admin menu automatically while this mod is listing the admin menu manually. I am not sure which one is the best though but automatically should cover new menu added by mods as well, right?
The mod does it better in pretty much every respect since it automatically covers other mods.
What about the loading issue? Does that only applies to manual mod or the packaged mod as well?
Quote from: ‽ on July 21, 2014, 01:41:20 PM
Not a fan of loading potentially many extra files every page load for admins.
The mod handles that by adding caching, which is A Good Thing.
The Better Profile mod doesn't list menu automatically but manually. No caching is added as I can see. Will this cause any loading issue if compared to Lazy Admin Menu mod? (Both were originally based on this mod idea but later extended as I understand).
No, because in the Better Profile Mod's case it doesn't dynamically load anything which is where the performance headache is. If you have a static list the cost is negligible. But the minute it's loaded on demand, you escalate the cost to cover loading all the files in question - don't forget that Admin.php (where the Admin menu is stored) is so much more than just the admin menu.
Same with profile but trying to splice the profile menu is... a joy I wouldn't even begin to recommend to anyone.
One thing I will say that is quietly annoying me about this... instead of putting in effort backporting 2.1 stuff to 2.0, I'd honestly prefer to see the time and energy being spent on getting 2.1 ready.
Thank you for the explanation.
Agreed on the last paragraph as well.
Quote from: ‽ on August 04, 2014, 06:05:26 AM
One thing I will say that is quietly annoying me about this... instead of putting in effort backporting 2.1 stuff to 2.0, I'd honestly prefer to see the time and energy being spent on getting 2.1 ready.
Like you've pointed out, it's the "joy" of modding. Mod authors can focus on what they want to focus on..... Although I admit, I don't understand how to "search" for issues within 2.1 to test.... And yes, I've read the How can I help? (http://www.simplemachines.org/community/index.php?topic=523428.0) topic in the 2.1 section....
I do understand, but at the same time it seems like energy that might better be served elsewhere. My refusal to contribute seriously to 2.1 any longer is not technical but mostly political.
As far as testing, everything needs testing. Every facet of every function needs testing. There are entire functions that have never been tested, not even by their authors. It also needs usability testing by people who, well, aren't the core team to see where there are stupid things that can be changed to improve usability.
Testing at the code level is borderline impossible, despite every attempt I made to clean up unnecessary options and reduce path complexity.
Okay, okay.... Lemme finish up the last two mods that I had submitted like a year ago and never got around to fixing properly so that they would get approved.... (As well as the bug reports :o ) and I'll look at 2.1 further...