Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Jun 2009 at 23:01 UTC
Updated:
6 Aug 2009 at 16:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedI have to agree with this. The list of possible use-cases is mighty. Though it is not difficult to write access plugins, either. We have to weigh the difficulty in writing them (after all you still have to have a module and the framework) vs the general distaste of embedding too much CSS into objects like this.
It probably is valuable, nonetheless.
Comment #2
moonray commentedAttached is a patch for a PHP access plugin.
There a few things that I'd like to improve on, but don't see a way to do with the provided arguments.
* Need a way to provide all available contexts to the eval-ed PHP. Currently the $context argument is available to the PHP, but we have no way to send all available contexts to this function without explicitly listing them all (which means we can only list the ones included with ctools, which is limiting).
Comment #3
merlinofchaos commentedcontent types have a mechanism to get all contexts instead of using configuration, which Views use to be able to be a little smarter about context. This mechanism probably needs to be added to the access plugin code as well.
Comment #4
merlinofchaos commentedCommitted with some fixes and permission checking and 'all contexts'.
Comment #5
friolator commentedThanks for implementing this - sounds like it's going to save us a ton of time!
Sorry for being completely daft here, but is there any documentation on how $context is structured? is it an array? a string?
If we're passing a panel an optional argument "!filter" -- and we want to display different panels based on that argument (ie: is it a Username or a Manufacturer, or a Product?), how do we test $context in the PHP Code Selection Rule?
Thanks!
Comment #6
markus_petrux commentedIt's a class defined in ctools/includes/context.inc. The different context implementations can be found in ctools/plugins/contexts.