You are here

function fb_admin_get_app_options in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb.admin.inc \fb_admin_get_app_options()
  2. 6.2 fb.admin.inc \fb_admin_get_app_options()

Convenience method to return a list of all known apps, suitable for form elements.

3 calls to fb_admin_get_app_options()
fb_connect_admin_settings in ./fb_connect.admin.inc
Form builder; Configure settings for this site.
fb_graph_form_alter in ./fb_graph.module
fb_user_admin_settings in ./fb_user.admin.inc
Form builder; Configure settings for this site.

File

./fb.admin.inc, line 232
Admin pages and forms for Drupal for Facebook.

Code

function fb_admin_get_app_options($include_current = FALSE, $key = 'label') {
  $apps = fb_get_all_apps();
  $options = array();
  if ($include_current) {
    $options[FB_APP_CURRENT] = t('<current>');
  }
  foreach ($apps as $app) {
    $title = !empty($app->title) ? $app->title : $app->label;
    if ($key == 'id') {

      // Still needed?
      $options[$app->id] = $title;
    }
    else {
      $options[$app->label] = $title;
    }
  }
  return $options;
}