Wedge

Public area => The Pub => Features => Topic started by: live627 on November 6th, 2012, 03:24 AM

Title: $context['current_area']
Post by: live627 on November 6th, 2012, 03:24 AM
There's an equivalent for both action and sa, so why not area as well?
Title: Re: $context['current_area']
Post by: Arantor on November 6th, 2012, 03:27 AM
Because it's not generally needed, and if you do really really need it, $menu_context['current_area'] will generally have it anyway.

Besides, action and sa are actually more widely used than area, though you're expecting complete system-wide consistency from SMF?
Title: Re: $context['current_area']
Post by: live627 on November 6th, 2012, 03:33 AM
Quote from Arantor on November 6th, 2012, 03:27 AM
you're expecting complete system-wide consistency from SMF?
yes.

II want to use a context variable to determine if I'm in a certain area. In a plugin, so I don't have $menu_context available. I'm also not creating a menu.
Title: Re: $context['current_area']
Post by: Arantor on November 6th, 2012, 03:41 AM
Quote
yes.
Excuse me while I wake up the household with laughter.
Quote
II want to use a context variable to determine if I'm in a certain area. In a plugin, so I don't have $menu_context available. I'm also not creating a menu.
Area URLs are only used in places where there is a menu. Which means you will either have $menu_context directly available, or you will be able to find  it inside $context.

Or, you could just use $_REQUEST['area'] like the rest of us would do.
Title: Re: $context['current_area']
Post by: live627 on November 6th, 2012, 03:49 AM
Quote from Arantor on November 6th, 2012, 03:41 AM
Excuse me while I wake up the household with laughter.
Oh shit, that was sarcasm, wasn't it...?
Quote from Arantor on November 6th, 2012, 03:41 AM
Area URLs are only used in places where there is a menu. Which means you will either have $menu_context directly available, or you will be able to find  it inside $context.

Or, you could just use $_REQUEST['area'] like the rest of us would do.
mmk. I just thought it was an oversight when there was action and sa in loadTheme but not area.
Title: Re: $context['current_area']
Post by: Arantor on November 6th, 2012, 03:56 AM
Quote
Oh shit, that was sarcasm, wasn't it...?
Best of British, yes. SMF has a lot of internal inconsistencies. Wedge has, in some ways, more.
Quote
mmk. I just thought it was an oversight when there was action and sa in loadTheme but not area.
Nah, area only appears in the three places where the twisted voodoo demigod GenericMenu appears, admin, moderate and profile.
Title: Re: $context['current_area']
Post by: live627 on November 6th, 2012, 04:09 AM
I can find obvious sarcasm as in Sarcastaball (South Park, season 16). Subtle traces, not so much. heh.
Title: Re: $context['current_area']
Post by: Arantor on November 6th, 2012, 04:12 AM
That's the biggest reason I avoid American comedies - everything tends to be so overstated and blatant, but being British, I like my sarcasm a little less well done, just south of medium and just north of medium rare ;)
Title: Re: $context['current_area']
Post by: garou on December 20th, 2012, 04:21 AM
All too often most people dont get sarcasm, especially in text. I often use a *sarcasm* tag because some people take me seriously. I had a girlfriend about 20 years ago dump me over sarcasm I used in an email. It was a joke, seriously. LOL