context_domain.module in Context Domain 7
File
context_domain.module
View source
<?php
function context_domain_context_plugins() {
$plugins = array();
$plugins['context_domain'] = array(
'handler' => array(
'path' => drupal_get_path('module', 'context_domain') . '/plugins',
'file' => 'context_condition_domain.inc',
'class' => 'context_condition_domain',
'parent' => 'context_condition_path',
),
);
return $plugins;
}
function context_domain_context_registry() {
$registry = array();
$registry['conditions'] = array(
'domain' => array(
'title' => t('Domain'),
'description' => t('Set this context when any of the domains above match the domain used to access the page. Put each path on a separate line. You can use the "*" character as a wildcard and <code>~</code> to exclude one or more paths.'),
'plugin' => 'context_domain',
),
);
return $registry;
}
function context_domain_init() {
if ($plugin = context_get_plugin('condition', 'domain')) {
$plugin
->execute();
}
}