You are here

function fb_load in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb.module \fb_load()
  2. 6.2 fb.module \fb_load()
  3. 7.4 fb.module \fb_load()

Implementation of a %wildcard_load(). http://drupal.org/node/224170

Handles menu items with %fb in the path. Seems to get called a lot(!) so we cache.

File

./fb.module, line 1417
This is the core required module of Drupal for Facebook.

Code

function fb_load($id) {
  $cache =& drupal_static(__FUNCTION__);
  if (!isset($cache)) {
    $cache = array();
  }
  if (!isset($cache[$id])) {
    $query = array(
      'label' => $id,
    );
    if (fb_is_fb_admin_page()) {

      // Show disabled apps to admins.
      $query['status'] = 0;

      // status >= 0
    }
    $cache[$id] = fb_get_app($query);
  }
  return $cache[$id];
}