Grants or denies access based on whether the context specified in the settings form is set.

Strikes me that it's primarily useful for when you have optional url args (!arg) and want variants based on whether or not the arg is specified without having to make two separate pages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sdboyer’s picture

Simple enough and makes sense; let me have a look, and I'll likely commit.

merlinofchaos’s picture

Status: Needs review » Needs work

This does not pass a coding standards review. All if statements must contain { } to prevent errors in the future.

brynbellomy’s picture

Status: Needs work » Needs review
FileSize
2.41 KB

Fixed the {} braces and ran this through coder. Should be clean now.

merlinofchaos’s picture

Hm. So for another purpose, I had to retool contexts such that optional contexts now provide an empty context when they do not appear. So this approach doesn't quite work right, now. And, in fact, opens it up to a much easier approach. Which I'm sorry about because now this needs to be redone.

brynbellomy’s picture

FileSize
2.58 KB

Alright, this has been fixed per your suggestions on IRC, I think. Happy to settle any other changes as well, though.

brynbellomy’s picture

FileSize
2.54 KB

Whoops, the hooks all still bore my name. Fixed.

brynbellomy’s picture

FileSize
2.57 KB

Sigh. Multiple versions of this file are ruining my life.

merlinofchaos’s picture

Status: Needs review » Fixed

Reworked somewhat and committed.

One note of import: When using t() try to avoid using a / in the text, as it's harder on translators. So switch from using '' to "" if there is a ' in the text; only use / if you absolutely have to.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.