You are here

class apachesolr_context_page_condition in Apache Solr Search 7

Expose Apachesolr pages as a context condition.

Hierarchy

Expanded class hierarchy of apachesolr_context_page_condition

2 string references to 'apachesolr_context_page_condition'
apachesolr_search_context_plugins in ./apachesolr_search.module
Implements hook_context_plugins()
apachesolr_search_context_registry in ./apachesolr_search.module
Implements hook_context_registry().

File

plugins/context/apachesolr_context_page_condition.inc, line 10
Context integration for Apachesolr.

View source
class apachesolr_context_page_condition extends context_condition {

  /**
   * Override of condition_values().
   */
  function condition_values() {

    // Retrieve all Apachesolr pages to return a list of conditions.
    $values = array();
    foreach (apachesolr_search_load_all_search_pages() as $page) {
      $values[$page['page_id']] = check_plain($page['label']);
    }
    return $values;
  }

  /**
   * Override of execute().
   *
   * @param Array $search_page The loaded search page.
   *   Loaded in apachesolr_search_custom_page().
   */
  function execute($search_page) {
    foreach ($this
      ->get_contexts($search_page['page_id']) as $context) {

      // Set contexts for this Apachesolr page.
      $this
        ->condition_met($context, $search_page['page_id']);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
apachesolr_context_page_condition::condition_values function Override of condition_values(). Overrides context_condition::condition_values
apachesolr_context_page_condition::execute function Override of execute().
context_condition::$description property
context_condition::$plugin property
context_condition::$title property
context_condition::$values property
context_condition::condition_form function Condition form. 3
context_condition::condition_form_submit function Condition form submit handler. 2
context_condition::condition_met function Marks a context as having met this particular condition.
context_condition::condition_used function Check whether this condition is used by any contexts. Can be used to prevent expensive condition checks from being triggered when no contexts use this condition.
context_condition::editor_form function Context editor form for conditions. 2
context_condition::editor_form_submit function Context editor form submit handler.
context_condition::fetch_from_context function Retrieve options from the context provided.
context_condition::get_contexts function Retrieve all contexts with the condition value provided. 2
context_condition::options_form function Options form. Provide additional options for your condition. 4
context_condition::options_form_submit function Options form submit handler.
context_condition::settings_form function Settings form. Provide variable settings for your condition.
context_condition::__clone function Clone our references when we're being cloned.
context_condition::__construct function Constructor. Do not override.