You are here

function context_contrib_context_conditions in Context 6

Same name and namespace in other branches
  1. 6.2 context_contrib/context_contrib.module \context_contrib_context_conditions()

Implementation of hook_context_conditions().

File

context_contrib/context_contrib.module, line 6

Code

function context_contrib_context_conditions() {
  $items = array();

  // Views
  if (module_exists('views')) {
    $items['views'] = array(
      '#title' => t('Views'),
      '#description' => t('Set this context when displaying the page of one of these views.'),
      '#options' => _context_contrib_get_views(),
      '#type' => 'checkboxes',
    );
  }

  // Nodequeue
  if (module_exists('nodequeue')) {
    $result = db_query("SELECT qid, title FROM {nodequeue_queue}");
    $options = array();
    while ($nq = db_fetch_object($result)) {
      $options[$nq->qid] = $nq->title;
    }
    $items['nodequeue'] = array(
      '#title' => t('Nodequeue'),
      '#description' => t('Set this context when a node in the selected nodequeue(s) is viewed.'),
      '#options' => $options,
      '#type' => 'checkboxes',
    );
  }
  return $items;
}