You are here

context_mobile_detect_type_condition.inc in Context Mobile Detect 7

Same filename and directory in other branches
  1. 7.2 plugins/context_mobile_detect_type_condition.inc

The file, which controls Mobile Device Type plugin.

File

plugins/context_mobile_detect_type_condition.inc
View source
<?php

/**
 * @file
 * The file, which controls Mobile Device Type plugin.
 */

/**
 * Main context class to detect user's device type.
 */
class cmd_type_condition extends context_condition {
  function condition_values() {
    return _context_mobile_detect_devices_types();
  }
  function execute() {
    $data = _context_mobile_detect_detect(FALSE);
    foreach ($this
      ->get_contexts($data['device_type']) as $context) {
      $this
        ->condition_met($context, $data['device_type']);
    }
  }

}

Classes

Namesort descending Description
cmd_type_condition Main context class to detect user's device type.