You are here

function mobile_tools_block_message in Mobile Tools 6.3

Same name and namespace in other branches
  1. 6 mobile_tools.module \mobile_tools_block_message()
  2. 7.3 mobile_tools.module \mobile_tools_block_message()
  3. 7.2 mobile_tools.module \mobile_tools_block_message()

Helper function returning the configurable message for the notification

1 call to mobile_tools_block_message()
mobile_tools_block in ./mobile_tools.module
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 187
Mobile Tools provides a range of functionality assisting in creating a mobile Drupal site . this functionality contains:

Code

function mobile_tools_block_message() {
  $site = mobile_tools_site_type();
  $querystring = drupal_query_string_encode($_GET, array(
    'q',
    'device',
  ));
  if (!empty($querystring)) {
    $querystring = '?' . $querystring;
  }
  if ($site == 'mobile') {

    // Fix for security issue https://security.drupal.org/node/70779
    $output = filter_xss(variable_get('mobile_notification', MOBILE_NOTIFICATION));
    $desktop_url = filter_xss(mobile_tools_switch_menu_link('desktop', $_GET['q']));
    $output = t($output, array(
      '!desktop_url' => '/' . $desktop_url . $querystring,
    ));
    return $output;
  }
  elseif ($site == 'desktop') {

    // Fix for security issue https://security.drupal.org/node/70779
    $output = filter_xss(variable_get('desktop_notification', DESKTOP_NOTIFICATION));
    $mobile_url = filter_xss(mobile_tools_switch_menu_link('mobile', $_GET['q']));
    $output = t($output, array(
      '!mobile_url' => '/' . $mobile_url . $querystring,
    ));
    return $output;
  }
}