You are here

function sms_user_tokens in SMS Framework 7

Implements hook_tokens().

File

modules/sms_user/sms_user.module, line 871
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_tokens($type, $tokens, array $data = array(), array $options = array()) {
  global $user;
  $replacements = array();
  if ($type == 'sms_user') {
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'confirm-code':
          $replacements[$original] = $data['confirm-code'];
          break;
        case 'mobile-url':
          $replacements[$original] = url("user/{$user->uid}/edit/mobile", array(
            'absolute' => TRUE,
          ));
          break;
      }
    }
  }
  return $replacements;
}