News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Lazy Admin Menu

Started by dougiefresh, July 21, 2014, 09:15:48 AM

Previous topic - Next topic

dougiefresh

Link to Mod



LAZY ADMIN MENU v2.5
By Dougiefresh -> Link to Mod



Introduction
This mod alters the main menu's Moderate menu to bring all the functionality of the moderation area to the main forum's menu bar.

This mod was inspired by tip provided by snow in Lazy Admin Menu in order to make it easier for the admin to navigate straight to where they want to go.

The only difference is that this mod built dynamically, so that any changes to the moderation menu are shown immediately.

Security Issue Notice
If you are running VERSION 2.0, you are STRONGLY URGED to stop using the mod immediately and upgrade to the latest version, which addresses a MAJOR SECURITY ISSUE that has been resolved.  All version 1.x and version 2.1+ mods are not affected by this security issue!

Admin Settings
There are no admin settings to this mod.  To disable, you must uninstall this mod.

Related Discussions
o [TIP] Lazy Admin Menu

Compatibility Notes
This mod was tested on SMF 2.0.12, but should work on SMF 2.1 Beta 2, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

kat

Excellent! Thanks for modding this up and ta to snow, again, for the original tip!

ladyquack

I rather like this mod. Very nice work! :)

Masterd

Great idea. Lazy admins can now also skip manual editing. :P

Arantor

Not a fan of loading potentially many extra files every page load for admins.

Masterd

Quote from: ‽ on July 21, 2014, 01:41:20 PM
Not a fan of loading potentially many extra files every page load for admins.

De gustibus non disputandum est.

Arantor

No accounting for taste, eh? Well, I do have a thing about keeping per-page effort low where possible... it's just a shame that more people don't care about such things. Mind you, most people don't seem to care about quality any more.

dougiefresh

#7
Uploaded v1.1 - July 21th, 2014
o Reduced the potential need to load so many files by caching the admin area menu.
o Subs-LazyAdmin.php uses the cached version of admin area menu when possible.

EDIT: It should be noted that if the user doesn't have admin rights, this code will not be run for that user.....

EDIT2: If something in the admin menu changes, the main menu's Admin menu won't be updated for the other admins until the other admins logs into the admin area....

Quote from: ‽ on July 21, 2014, 01:41:20 PM
Not a fan of loading potentially many extra files every page load for admins.
Good point, ‽......  Fixed that issue in v1.1.....

Ninja ZX-10RR

LOL I do am lazy in that as I use it everyday, more than once. Installed :3 thanks ♥
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

kat

I hope this is standard, in 2.1...

Ninja ZX-10RR

Ask the devs to do this :) it won't be that hard I think, as this uses hooks so not really hard to add to 2.1 without breaking things... Of course with dougiefresh's authorization ;)
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

Arantor

I hope not. 2.1 already has enough going on without making it more complicated and more fragile.

dougiefresh

Quote from: K@ on July 21, 2014, 03:20:37 PM
I hope this is standard, in 2.1...
Well, in case you're interested, it DOES work with 2.1 Alpha 1 as of July 21, 2014 using 2.0 emulation....  Future compatibility not guaranteed....

Ninja ZX-10RR

Don't be that pessimist Pete :( "complicated and fragile" for a menu redirecting to another being identical? :|
And dougie... Lol on that. Nothing to add actually.
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

kat

One can hope...

The admin section, for the entire v2 brach, thus far, has been a pile of poop, for me.

It's totally illogical and, generally, as weird as a sack full of whippets wearing lipstick.

Arantor

Quote from: Flavio93Zena on July 21, 2014, 03:31:37 PM
Don't be that pessimist Pete :( "complicated and fragile" for a menu redirecting to another being identical? :|
And dougie... Lol on that. Nothing to add actually.

You have no idea. Yes, complicated and fragile.

Ninja ZX-10RR

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

Arantor

OK, let me explain. There is in design terms this concept called the Single Principle Design. There are other names like Single Responsibility Design. What that means is you create a function or chunk of code with a single principle and if that piece of code is ever used in different contexts with different purposes, you're doing it wrong.

AdminMain() does more than set up the menu. If the menu definition were a single function only, and AdminMain() called that, I'd be happier. It reduces fragility (by making fewer assumptions about how a piece of code will be called or used) and complexity (by ensuring that each piece of code has one responsibility) and it means that future changes are less likely to break things with obscure side effects.

This is something SMF has a *lot* of in its design right now.

Ninja ZX-10RR

Thanks for the indirectly-asked explanation :) well but if the mod code is safe it wouldn't hurt to just roughly paste it in there huh? (I love that roughly copy/paste, when it works, rarely XD)
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

Arantor

For now, sure. But if AdminMenu changes its behaviour in the future, it's entirely possible it might not work properly.

This whole failing-single-use deal is the result of so much mod instability.

Advertisement: