<?php
// $Id:

/**
 * Implements hook_ctools_plugin_api().
 */
function context_condition_theme_ctools_plugin_api($module, $api) {
  if ($module == 'context' && $api == 'plugins') {
    return array('version' => 3);
  }
}

/**
 * Implements hook_context_plugins().
 */
function context_condition_theme_context_plugins() {
  $plugins = array();
  
  /** 
  * Conditions
  */
  $plugins['context_condition_theme'] = array(
    'handler' => array(
      'path' => drupal_get_path('module', 'context_condition_theme') . '/plugins',
      'file' => 'context_condition_theme.inc',
      'class' => 'context_condition_theme',
      'parent' => 'context_condition',
    ),
  );
  return $plugins;
}


/**
 * Implements hook_context_registry().
 */
function context_condition_theme_context_registry() {
  $registry = array();

  $registry['conditions'] = array(
    'theme' => array(
      'title' => t('Theme'),
      'description' => 'Set this context on the basis of the theme being rendered',
      'plugin' => 'context_condition_theme',
    ),
  );
  return $registry;
}

/**
 * Implementation of hook_context_page_reaction()
 * adds context based on the browser keywords string.
 */
function context_condition_theme_context_page_condition() {
  if ($plugin = context_get_plugin('condition', 'theme')) {
    $plugin->execute();
  }
}