summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryoung hahn2008-08-06 14:50:25 (GMT)
committer young hahn2008-08-06 14:50:25 (GMT)
commit8b2e6c917c94493b8ec8b250bed575001cdc76dd (patch)
treed8fbe0c9e24a8d8643259be7cfac7f01bc6475aa
parent55461f3ea430e67db71662ae54da8951f2f8a1fc (diff)
Added a check which allows prefix providers to limit the prefixing methods that can be used with their prefixes
-rw-r--r--context_prefix/context_prefix.module12
1 files changed, 11 insertions, 1 deletions
diff --git a/context_prefix/context_prefix.module b/context_prefix/context_prefix.module
index 747b662..0d7a2f6 100644
--- a/context_prefix/context_prefix.module
+++ b/context_prefix/context_prefix.module
@@ -384,12 +384,22 @@ function context_prefix_settings_form() {
);
foreach (context_prefix_providers() as $id => $provider) {
+ // Check to see whether provider has limited the available prefixing methods
+ if (is_array($provider['methods']) && count($provider['methods'])) {
+ $provider_options = array();
+ foreach ($provider['methods'] as $method) {
+ $provider_options[$method] = $options[$method];
+ }
+ }
+ else {
+ $provider_options = $options;
+ }
$form['context_prefix_method_'. $id] = array(
'#provider' => true,
'#title' => $provider['name'],
'#description' => $provider['description'],
'#type' => 'select',
- '#options' => $options,
+ '#options' => $provider_options,
'#default_value' => variable_get('context_prefix_method_'. $id, CONTEXT_PREFIX_PATH),
);
}