You are here

function mobile_detect_block_view in Mobile Detect 7

Implements function hook_block_view().

File

./mobile_detect.module, line 166
Lightweight mobile detection based on the Mobile_Detect.php library.

Code

function mobile_detect_block_view($delta) {
  $block = array();
  if (user_access('view mobile detect debug')) {
    switch ($delta) {
      case 'mobile_detect_simple_debug':
        $block['subject'] = t('Mobile Detect: Simple debug');
        $block['content'] = array(
          '#markup' => _mobile_detect_simple_debug(),
        );
        break;
      case 'mobile_detect_full_debug':
        $block['subject'] = t('Mobile Detect: Full debug');
        $block['content'] = array(
          '#markup' => _mobile_detect_full_debug(),
        );
        break;
    }
  }
  return $block;
}