You are here

function _mobile_switch_get_mobile_detect_details in Mobile Switch 7.2

Helper function to get details detected by Mobile Detect.

Parameters

$browser: Associative array from Mobile Detect.

Return value

string HTML table contains Mobile Detect details.

See also

mobile_switch_page_alter()

1 call to _mobile_switch_get_mobile_detect_details()
mobile_switch_page_alter in ./mobile_switch.module
Implements hook_page_alter().

File

./mobile_switch.module, line 770
Provides various functionalities to develop mobile ready websites.

Code

function _mobile_switch_get_mobile_detect_details($browser) {
  $rows = array();
  foreach ($browser as $key => $value) {
    $rows[] = array(
      $key,
      filter_xss_admin($value),
    );
  }
  return theme('table', array(
    'header' => array(
      '',
      '',
    ),
    'rows' => $rows,
    'attributes' => array(
      'id' => 'mobile-switch-mobile-detect-details',
    ),
  ));
}