You are here

function fb_app_fb_admin in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 6.3 fb_app.admin.inc \fb_app_fb_admin()
  2. 7.3 fb_app.admin.inc \fb_app_fb_admin()

Implementation of hook_fb_admin().

File

./fb_app.admin.inc, line 13

Code

function fb_app_fb_admin($op, $data, &$return) {
  $fb = isset($data['fb']) ? $data['fb'] : NULL;
  $fb_app = isset($data['fb_app']) ? $data['fb_app'] : NULL;
  if ($op == FB_ADMIN_OP_SET_PROPERTIES) {

    // URLs for Facebook events we support.
    $return['uninstall_url'] = url(FB_APP_PATH_EVENT . '/' . FB_APP_EVENT_POST_REMOVE, array(
      'absolute' => TRUE,
    ));
    $return['authorize_url'] = url(FB_APP_PATH_EVENT . '/' . FB_APP_EVENT_POST_AUTHORIZE, array(
      'absolute' => TRUE,
    ));
  }
  elseif ($op == FB_ADMIN_OP_LIST_PROPERTIES) {
    $return[t('Application Name')] = 'application_name';
    $return[t('About URL')] = 'about_url';
    $return[t('Post-Authorize Callback URL')] = 'authorize_url';
    $return[t('Post-Remove Callback URL')] = 'uninstall_url';

    // Learn canvas name regardless of whether fb_canvas is enabled.
    $return[t('Canvas Name')] = 'canvas_name';
  }
  elseif ($op == FB_ADMIN_OP_LOCAL_LINKS && isset($fb_app->fba_id)) {

    // Path to edit this app.
    $return[t('edit')] = FB_PATH_ADMIN_APPS . '/' . $fb_app->label . '/fb_app';

    // TODO!!! Support delete, and maybe view.
  }
}