Advertisement:

Author Topic: [TIP] Lazy Admin Menu  (Read 31682 times)

Offline ѕησω

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,427
  • Gender: Male
  • Nisi credideritis, non intelligetis.
    • wade.poulsen93 on Facebook
    • acans on GitHub
    • https://www.linkedin.com/profile/view?id=145186638 on LinkedIn
    • @imacans on Twitter
    • Acans
[TIP] Lazy Admin Menu
« on: September 15, 2010, 08:00:30 AM »
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.

Code: (Find:) [Select]
// Set up the menu privileges.
Code: (Add Before:) [Select]
// Load the Lazy Admin Menu Language Strings...
loadLanguage('Admin');

Code: (Find:) [Select]
'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,
),
),
),

Code: (Replace:) [Select]
'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 ;)

Code: (Find:) [Select]
// Load the Lazy Admin Menu Language Strings...
loadLanguage('Admin');

Code: (Add After:) [Select]
loadLanguage('SPortalAdmin');
Code: (Find:) [Select]
'attachments' => array(
'title' => $txt['attachments_avatars'],
'href' => $scripturl . '?action=admin;area=manageattachements',
'show' => allowedTo('manage_attachments'),
),
),
),

Code: (Add After:) [Select]
'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.
« Last Edit: December 26, 2010, 06:06:54 AM by ѕησω »
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not dead yet, the time was soon to come to pass when mysql_query shall be gone and no more."

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #1 on: September 15, 2010, 08:11:47 AM »
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.
« Last Edit: September 16, 2010, 09:18:41 AM by ahrasis »

Offline ѕησω

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,427
  • Gender: Male
  • Nisi credideritis, non intelligetis.
    • wade.poulsen93 on Facebook
    • acans on GitHub
    • https://www.linkedin.com/profile/view?id=145186638 on LinkedIn
    • @imacans on Twitter
    • Acans
Re: [TIP] Lazy Admin Menu
« Reply #2 on: September 15, 2010, 08:22:15 AM »
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.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not dead yet, the time was soon to come to pass when mysql_query shall be gone and no more."

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: [TIP] Lazy Admin Menu
« Reply #3 on: September 15, 2010, 04:59:46 PM »
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. :)

Offline ѕησω

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,427
  • Gender: Male
  • Nisi credideritis, non intelligetis.
    • wade.poulsen93 on Facebook
    • acans on GitHub
    • https://www.linkedin.com/profile/view?id=145186638 on LinkedIn
    • @imacans on Twitter
    • Acans
Re: [TIP] Lazy Admin Menu
« Reply #4 on: September 15, 2010, 11:04:27 PM »
Exactly, it takes less than a minute to remove the tabs and category's you do not want.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not dead yet, the time was soon to come to pass when mysql_query shall be gone and no more."

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #5 on: September 16, 2010, 04:25:56 AM »
I for got to ask, is this for SMF 2.0 RCx or 1.1.x?

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: [TIP] Lazy Admin Menu
« Reply #6 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. ;)

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #7 on: September 16, 2010, 05:47:36 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

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: [TIP] Lazy Admin Menu
« Reply #8 on: September 16, 2010, 08:32:36 AM »
Nice tip , will make admins like me more lazy :P
Github Profile
My Mods
How to enable Post Moderation
Paid Support
Elkarte


"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline ѕησω

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,427
  • Gender: Male
  • Nisi credideritis, non intelligetis.
    • wade.poulsen93 on Facebook
    • acans on GitHub
    • https://www.linkedin.com/profile/view?id=145186638 on LinkedIn
    • @imacans on Twitter
    • Acans
Re: [TIP] Lazy Admin Menu
« Reply #9 on: September 16, 2010, 08:56:40 AM »
Added Simpleportal if anybody wants it.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not dead yet, the time was soon to come to pass when mysql_query shall be gone and no more."

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: [TIP] Lazy Admin Menu
« Reply #10 on: September 16, 2010, 03:48:43 PM »
Oh my kind of tip: promoting lazyness!

Thanks acans :)
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline Kryzen

  • On Hiatus
  • SMF Hero
  • *
  • Posts: 4,046
  • Gender: Male
    • nedroden on GitHub
Re: [TIP] Lazy Admin Menu
« Reply #11 on: September 17, 2010, 01:18:42 AM »
Very nice! :D But you stole my modification idea. :( No, just joking. :P Very good job! :D
Amateur PHP & Java developer
DraiWiki | Project Alpha

kat

  • Guest
Re: [TIP] Lazy Admin Menu
« Reply #12 on: July 21, 2014, 08:29:27 AM »
Dunno how I missed this, for so long...

It's brilliant! Ta, ѕησω!

Offline jamiewalters68

  • Newbie
  • *
  • Posts: 3
Re: [TIP] Lazy Admin Menu
« Reply #13 on: July 21, 2014, 07:16:14 PM »
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!

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #14 on: July 21, 2014, 07:30:44 PM »
Now it is already made a mod K@. Lazy admin can be even lazier when using a packaged mod. Ha ha ha...

kat

  • Guest
Re: [TIP] Lazy Admin Menu
« Reply #15 on: July 22, 2014, 05:25:32 AM »
Heh... As it happens, I think the menus should be like that, as standard. :)

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,135
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: [TIP] Lazy Admin Menu
« Reply #16 on: July 22, 2014, 05:37:14 PM »
As a footnote, it's this one --> http://www.simplemachines.org/community/index.php?topic=525466.0 taken from ѕησω and published by DougieFresh :D
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #17 on: July 22, 2014, 07:10:00 PM »
Hahaha... And now it being discussed by our captain there. Interesting...

Offline kayeshandra85

  • Newbie
  • *
  • Posts: 3
Re: [TIP] Lazy Admin Menu
« Reply #18 on: July 25, 2014, 08:27:27 PM »
Just what I was looking for ;) I better try this. I'll just update you how it works on my end. Thanks!

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: [TIP] Lazy Admin Menu
« Reply #19 on: July 26, 2014, 01:01:51 AM »
There is already a packaged mod for this. But of course you can manually do it.