summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/fb_test.module16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/fb_test.module b/contrib/fb_test.module
index 1ebb645..0d10455 100644
--- a/contrib/fb_test.module
+++ b/contrib/fb_test.module
@@ -43,7 +43,7 @@ function fb_test_create_form(&$form, &$form_state, $fb_app) {
// Which permissions?
$perms = array();
- drupal_alter('fb_required_perms', $perms);
+ drupal_alter('fb_required_perms', $perms); // @TODO pass fb_app to this function.
if (count($perms)) {
$default_perms = implode(',', $perms);
}
@@ -105,7 +105,7 @@ function fb_test_accounts_form($form, &$form_state, $fb_app) {
$options[$test_account['id']] = $markup;
}
- if (count($options)) {
+ if (!empty($options)) {
$form['checkboxes'] = array(
'#type' => 'checkboxes',
'#options' => $options,
@@ -174,6 +174,18 @@ function fb_test_accounts_form_submit($form, &$form_state) {
}
}
}
+ elseif ($values['operation'] == 'delete') {
+ foreach ($values['checkboxes'] as $fbu => $selected) {
+ if ($selected) {
+ $result = $fb->api($fbu, 'DELETE', array('access_token' => fb_get_token($fb)));
+ if ($result) {
+ drupal_set_message(t('Deleted test account %fbu', array(
+ '%fbu' => $fbu,
+ )));
+ }
+ }
+ }
+ }
else {
dpm("Operation $values[operation] not implemented.", __FUNCTION__); // debug
}