You are here

function fb_canvas_theme_user_picture_override in Drupal for Facebook 6.2

Our replacement for theme('user_picture', ...)

1 string reference to 'fb_canvas_theme_user_picture_override'
fb_canvas_theme_registry_alter in ./fb_canvas.module
Implementation of hook_theme_registry_alter().

File

./fb_canvas.module, line 985
This module provides support for Canvas page applications. Use Drupal to power traditional Facebook Apps.

Code

function fb_canvas_theme_user_picture_override($object) {
  $orig = theme('fb_canvas_user_picture_orig', $object);

  // Respect Drupal's profile pic, if uploaded.
  if (isset($object->picture) && $object->picture) {
    return $orig;
  }

  // Make no changes to non-FBML pages.
  if (fb_canvas_is_fbml() && ($fbu = fb_get_object_fbu($object))) {

    // Theme the username with FBML, using original username as backup.
    return theme('fb_canvas_fbml_user_picture', $fbu, $object, $orig);
  }
  else {
    return $orig;
  }
}