You are here

function mobile_tools_block in Mobile Tools 5

Same name and namespace in other branches
  1. 6.3 mobile_tools.module \mobile_tools_block()
  2. 6 mobile_tools.module \mobile_tools_block()
  3. 6.2 mobile_tools.module \mobile_tools_block()

Implementation of hook_block() Provides the blocks that can be used to show a message to the user to go to the mobile or desktop version.

File

./mobile_tools.module, line 217
Mobile Tools provides a range of functionality assisting in creating a mobile drupal site . this functionality contains:

Code

function mobile_tools_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      if (variable_get('mobile_tools_handling', 'notification') == 'notification' && variable_get('mobile_tools_enable_redirect', 0) == 1) {
        $blocks[0]['info'] = t('Mobile Tools block notification');
        return $blocks;
      }
      break;
    case 'view':
      if (variable_get('mobile_tools_handling', 'notification') == 'notification' && $_SESSION['mobile-tools-mobile-device']['type'] != $_SESSION['mobile-tools-site-type'] && variable_get('mobile_tools_enable_redirect', 0) == 1) {
        $block['title'] = '';
        $block['content'] = _mobile_tools_message();
        return $block;
      }
      break;
  }
}