You are here

context_domain.module in Context Domain 7

File

context_domain.module
View source
<?php

/**
 * Implements hook_context_plugin().
 */
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;
}

/**
 * Implements hook_context_registry().
 */
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;
}

/**
 * Implementats of hook_init().
 */
function context_domain_init() {
  if ($plugin = context_get_plugin('condition', 'domain')) {
    $plugin
      ->execute();
  }
}

Functions

Namesort descending Description
context_domain_context_plugins Implements hook_context_plugin().
context_domain_context_registry Implements hook_context_registry().
context_domain_init Implementats of hook_init().