You are here

function mediafront_user_token_values in MediaFront 6

Same name and namespace in other branches
  1. 6.2 plugins/mediafront_user/mediafront_user.module \mediafront_user_token_values()

Implementation of hook_token_values().

File

plugins/mediafront_user/mediafront_user.module, line 70

Code

function mediafront_user_token_values($type, $object = NULL) {
  switch ($type) {
    case 'user':
    case 'all':

      // Get the user...
      if (isset($object)) {
        $object = (object) $object;
        $uid = $object->uid;
      }
      else {
        global $user;
        $uid = $user->uid;
      }

      // Get the user status.
      $status = mediafront_user_get_status($uid);

      // Set the verb and noun of this token.
      $values['user-verb'] = check_plain($status->verb);
      $values['user-noun'] = check_plain($status->noun);
      return $values;
  }
}