You are here

function fb_install_property_message in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb.install \fb_install_property_message()

Convenience function to display messages like the one from fb_app_update_6003.

File

./fb.install, line 163
Install file to support fb.module.

Code

function fb_install_property_message(&$ret, $reason) {
  $result = db_query("SELECT * FROM {fb_app}");
  $items = array();
  foreach ($result as $data) {
    $items[] = l($data->title, 'admin/build/fb/app/' . $data->label . '/fb/set_props', array(
      'attributes' => array(
        'target' => '_blank',
      ),
    ));
  }
  if (count($items)) {
    $message = 'Manual action required!.  !reason  Click below to update the settings, on facebook, for each of your applications.  !list';
    $args = array(
      '!reason' => $reason,
      '!list' => theme('item_list', $items),
    );
    drupal_set_message(t($message, $args), 'warning', FALSE);
    watchdog('fb', $message, $args, WATCHDOG_WARNING);
  }
  $ret[] = array(
    'success' => FALSE,
    'query' => t('Manual action required.  Go to !link and set properties for each facebook application.', array(
      '!link' => l('Facebook Applications', 'admin/build/fb'),
    )),
  );
}