Support forums : You can sense the bug

User Tools widget

Not like "it smells funny when I click that". This is for bugs that don't show an error but something just doesn't seem right or ends up doing something you think is wrong. It doesn't show you an error but you know something ain't right.

Moderator: Dracones

User Tools widget

Postby Yabs » Mon Aug 09, 2010 8:14 am

Ok this isn't a bug just the "expected behaviour" wasn't what I expected ;)

I installed the user tools widget and decided that I never wanted a login/register/subscriptions/profile link, so i deleted the text from those bits, changed the title to "Admin Tools" as I'm dead unimaginative when it comes to naming stuff, and hit save ... job done!

Then I hit the home page and was promptly shown the links I'd removed! Aghast I ripped open the files and read the logic ... if( $foo = '' ) $foo = T_('The default text the muppet deleted!' );

I can't even begin to describe the crushing feeling I had at that moment.

Anyway, is it just me that thinks leaving the title blank should mean "I don't want that link thanks!" ?

In a related manner : the admin link shows when logged out, I think it should only be shown when logged in, if appropriate.

Current check :
Code: Select all
    if( is_logged_in() && ! $current_User->check_perm( 'admin', 'visible' ) )
    { // If user should NOT see admin link:
        return $not_visible;
    } 


Proposed check :
Code: Select all
    if( !is_logged_in() || ! $current_User->check_perm( 'admin', 'visible' ) )
    { // If user should NOT see admin link:
        return $not_visible;
    } 


¥
I may have opened the door but you entered of your own free will

Image Techno Babble II
Image Tacky Pad 3
Yabs
Dracone
User avatar
 
Posts: 896
Joined: Sat Nov 21, 2009 9:59 am

Re: User Tools widget

Postby EdB » Mon Aug 09, 2010 8:22 am

Agreed that no title implies no link, but so does a checkbox for on/off. The admin one is just dumb. IF you're logged in then you might want logout and admin, but if you're not logged in you should only get login and/or register if that is enabled.

But this widget and menu link or whatever the other one is called need to talk to each other a bit. They're both kinda related but don't offer the same stuff. Close but not quite. One is all or nothing, the other is only one. How about a widget with all the links between the 2 of 'em that you can have one or some or all?
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: User Tools widget

Postby Yabs » Mon Aug 09, 2010 8:43 am

It'd make more sense to merge them, but they both need to work better.

I might have a play because I'm gonna have to anyway. Unfortunately the hosting site isn't on a bzr enabled server, so it'll be loads of copy pasting ... hmmm, wonder if I could mount the dir from one server on the other and still get it working with bzr. Pretty sure it failed when I used to play in cvs but god loves a trier and all that ;)

¥
I may have opened the door but you entered of your own free will

Image Techno Babble II
Image Tacky Pad 3
Yabs
Dracone
User avatar
 
Posts: 896
Joined: Sat Nov 21, 2009 9:59 am


Return to You can sense the bug

Who is online

Users browsing this forum: No registered users and 1 guest

cron