You are here

class ip_geoloc_context_reaction_locate_visitor in IP Geolocation Views & Maps 7

@file Output javascript to locate visitor using GPS/Wifi.

Hierarchy

Expanded class hierarchy of ip_geoloc_context_reaction_locate_visitor

2 string references to 'ip_geoloc_context_reaction_locate_visitor'
ip_geoloc_context_plugins in ./ip_geoloc.context.inc
Implements hook_context_plugins().
ip_geoloc_context_registry in ./ip_geoloc.context.inc
Implements hook_context_registry().

File

plugins/ip_geoloc_context_reaction_locate_visitor.inc, line 7
Output javascript to locate visitor using GPS/Wifi.

View source
class ip_geoloc_context_reaction_locate_visitor extends context_reaction {
  function options_form($context) {
    return array(
      'locate_visitor' => array(
        '#type' => 'value',
        '#value' => TRUE,
      ),
    );
  }
  function options_form_submit($values) {
    return array(
      'locate_visitor' => TRUE,
    );
  }

  /**
   *
   */
  function execute() {
    foreach (context_active_contexts() as $context) {
      if (!empty($context->reactions['locate_visitor'])) {

        /* drupal_set_message(t("Referer, %referer, path: %path, context: %context, reacting with %reaction", array(
             '%referer' => $_SERVER['HTTP_REFERER'],
             '%path' => drupal_get_path_alias(),
             '%context' => $context->name,
             '%reaction' => t('Locate visitor using GPS/Wifi'),
           ))); */
        if (!ip_geoloc_same_path()) {
          ip_geoloc_get_current_location();
        }
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
context_reaction::$description property
context_reaction::$plugin property
context_reaction::$title property
context_reaction::fetch_from_context function Retrieve options from the context provided. 1
context_reaction::get_contexts function Retrieve active contexts that have values for this reaction.
context_reaction::settings_form function Settings form. Provide variable settings for your reaction. 2
context_reaction::__clone function Clone our references when we're being cloned.
context_reaction::__construct function Constructor. Do not override.
ip_geoloc_context_reaction_locate_visitor::execute function
ip_geoloc_context_reaction_locate_visitor::options_form function Overrides context_reaction::options_form
ip_geoloc_context_reaction_locate_visitor::options_form_submit function Options form submit handler. Overrides context_reaction::options_form_submit