You are here

function fbconnect_theme_registry_alter in Facebook Connect 6

Same name and namespace in other branches
  1. 6.2 fbconnect.module \fbconnect_theme_registry_alter()

Implementation of hook_theme_registry_alter().

Override theme functions for things that can be displayed using XFBML. Currently overriding user_picture. We rename the original entries, as we will use them for users without javascript enabled.

File

./fbconnect.module, line 819

Code

function fbconnect_theme_registry_alter(&$theme_registry) {

  // Only change image handling if user have the permission to use the image.
  $conf = fbconnect_get_config();
  if ($conf['user_pictures'] == 'allow') {

    // Re-register the original theme function under a new name.
    $theme_registry['fbconnect_user_picture_orig'] = $theme_registry['user_picture'];

    // Override theme username
    $theme_registry['user_picture'] = array(
      'arguments' => array(
        'account' => NULL,
      ),
      'function' => 'fbconnect_theme_user_picture_override',
      'preprocess functions' => array(),
    );
  }
}