You are here

function fb_canvas_url_outbound_alter in Drupal for Facebook 7.4

Same name and namespace in other branches
  1. 6.3 fb_canvas.module \fb_canvas_url_outbound_alter()
  2. 6.2 fb_canvas.module \fb_canvas_url_outbound_alter()
  3. 7.3 fb_canvas.module \fb_canvas_url_outbound_alter()

File

./fb_canvas.module, line 102

Code

function fb_canvas_url_outbound_alter(&$path, &$options, $original_path) {

  // Defaults.
  $options += array(
    'fb_canvas' => FALSE,
    'fb_url_alter' => TRUE,
  );
  if ($options['fb_canvas'] && $options['fb_url_alter']) {
    if (is_string($options['fb_canvas'])) {
      $namespace = $options['fb_canvas'];
    }
    else {
      $fb_app = fb_get_app();
      $namespace = $fb_app['namespace'];
    }
    $options['absolute'] = TRUE;

    // $options['external'] = TRUE; <-- no, don't do this.
    $options['base_url'] = "//apps.facebook.com/{$namespace}";
  }
}