You are here

function fb_canvas_theme_registry_alter in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 7.4 fb_canvas.module \fb_canvas_theme_registry_alter()

Implementation of hook_theme_registry_alter().

Wrap original theme functions in our overrides.

File

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

Code

function fb_canvas_theme_registry_alter(&$theme_registry) {

  // Ideally, we'd do this only on themes which will certainly be used for FBML canvas pages.
  if ($theme_registry['username']['type'] == 'module') {

    // Override theme_username
    $theme_registry['fb_canvas_username_orig'] = $theme_registry['username'];
    $theme_registry['username'] = array(
      'arguments' => array(
        'object' => NULL,
      ),
      'function' => 'fb_canvas_theme_username_override',
      'type' => 'module',
    );
  }
  if ($theme_registry['user_picture']['type'] == 'module') {

    // Override theme_user_picture
    $theme_registry['fb_canvas_user_picture_orig'] = $theme_registry['user_picture'];
    $theme_registry['user_picture'] = array(
      'arguments' => array(
        'account' => NULL,
      ),
      'function' => 'fb_canvas_theme_user_picture_override',
      'type' => 'module',
    );
  }
}