You are here

context_theme.module in Context Reaction: Theme 6

File

context_theme.module
View source
<?php

/**
 * Implementation of hook_init().
 */
function context_theme_init() {
  global $custom_theme;
  $vals = context_active_values();
  $custom_theme = $vals['theme'][0];
}

/**
 * Implementation of hook_context_reactions().
 */
function context_theme_context_reactions() {
  $items = array();
  $options = array();
  $themes = list_themes();
  foreach ($themes as $name => $theme) {
    if ($theme->status == 1) {
      $options[$name] = $name;
    }
  }
  $items['theme'] = array(
    '#title' => t('Theme'),
    '#description' => t('Activate a given theme when this context is set.'),
    '#options' => $options,
    '#type' => 'checkboxes',
  );
  return $items;
}

Functions

Namesort descending Description
context_theme_context_reactions Implementation of hook_context_reactions().
context_theme_init Implementation of hook_init().