You are here

function mobile_tools_token_values in Mobile Tools 5

Implementation of the hook_token_values().

File

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

Code

function mobile_tools_token_values($type, $object = NULL) {
  global $base_url;
  if ($type == 'mobile_tools') {
    $mobile_url = variable_get('mobile_tools_mobile_url', mobile_tools_create_mobile_url($base_url));
    $desktop_url = variable_get('mobile_tools_desktop_url', $base_url);
    if ($mobile_url != FALSE || $desktop_url != FALSE) {
      $tokens['mobile-url'] = l($mobile_url, $mobile_url);
      $tokens['desktop-url'] = l($desktop_url, $desktop_url);
      $tokens['mobile-site-link'] = l('mobile site', $mobile_url);
      $tokens['desktop-site-link'] = l('desktop site', $desktop_url);
      if (mobile_tools_is_mobile_site() == 'mobile') {
        $tokens['mobile'] = t('Mobile');
        $tokens['desktop'] = l('Destkop', $desktop_url);
      }
      else {
        $tokens['mobile'] = l('Mobile', $mobile_url);
        $tokens['desktop'] = t('Desktop');
      }
      return $tokens;
    }
  }
}