You are here

function fb_devel_page in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb_devel.module \fb_devel_page()
  2. 5 fb_devel.module \fb_devel_page()
  3. 6.3 fb_devel.module \fb_devel_page()
  4. 7.4 fb_devel.module \fb_devel_page()
  5. 7.3 fb_devel.module \fb_devel_page()

Provides a page with useful debug info.

1 string reference to 'fb_devel_page'
fb_devel_menu in ./fb_devel.module
@file Makes development with Drupal for Facebook much easier. Keep this module enabled until you're confident your app works perfectly.

File

./fb_devel.module, line 187
Makes development with Drupal for Facebook much easier. Keep this module enabled until you're confident your app works perfectly.

Code

function fb_devel_page() {
  global $_fb, $_fb_app;
  global $user;
  if (isset($_REQUEST['require_login']) && $_REQUEST['require_login']) {
    $_fb
      ->require_login();
  }
  if ($_fb) {
    if (fb_is_iframe_canvas()) {
      drupal_set_message("fb_is_iframe_canvas() returns TRUE");
    }
    if (fb_is_fbml_canvas()) {
      drupal_set_message("fb_is_fbml_canvas() returns TRUE");
    }
    drupal_set_message(t("session name: " . session_name()));
    drupal_set_message(t("session id: " . session_id()));
    drupal_set_message(t("<a href=\"!url\">processed link</a>, <a href=!url>unprocessed</a>", array(
      '!url' => url('fb/devel'),
    )));
    drupal_set_message(t("get_loggedin_user returns " . $_fb
      ->get_loggedin_user()));
    drupal_set_message(t("current_url returns " . $_fb
      ->current_url()));
    drupal_set_message(t("base_url: " . $GLOBALS['base_url']));
    drupal_set_message(t("base_path: " . $GLOBALS['base_path']));
    drupal_set_message(t("url() returns: " . url()));
    drupal_set_message(t("session_key is " . $_fb->api_client->session_key));
  }
  if ($fbu = fb_get_fbu($user)) {
    $path = "fb/devel/fbu/{$fbu}";
    drupal_set_message(t("Learn more about the current user at !link", array(
      '!link' => l($path, $path),
    )));
  }
  dpm(fb_get_fbu($user), 'Facebook user via fb_get_fbu');

  //dpm($user, "Local user " . theme('username', $user));
  if ($GLOBALS['fb_connect_apikey']) {
    drupal_set_message(t("fb_connect_apikey = " . $GLOBALS['fb_connect_apikey']));
  }
  dpm($_COOKIE, 'cookie');
  dpm($_REQUEST, "Request");

  //dpm($_fb_app, "fb_app");
  drupal_set_message(t("session_id returns " . session_id()));
  dpm($_SESSION, "session:");
  return "This is the facebook debug page.";
}