You are here

function cloudflare_form_comment_admin_overview_alter in CloudFlare 7

Same name and namespace in other branches
  1. 6 cloudflare.module \cloudflare_form_comment_admin_overview_alter()

Implementation of hook_form_FORM_ID_alter().

File

./cloudflare.module, line 61

Code

function cloudflare_form_comment_admin_overview_alter(&$form, $form_state) {

  // If cloudflare hasn't been configured, don't display form alterations.
  if (!_is_cloudflare_configured()) {
    return $form;
  }

  // Add some additional options to the comment operations list.
  $form['options']['operation']['#options']['Cloudflare Actions'] = array(
    'cloudflare_spam' => t('Report Spam'),
    'cloudflare_spam_delete' => t('Report Spam + Delete'),
    'cloudflare_ban_ip' => t('Ban IP'),
    'cloudflare_ban_ip_delete' => t('Ban IP + Delete Comment'),
    'cloudflare_whitelist_ip' => t('Whitelist IP'),
    'cloudflare_whitelist_ip_publish' => t('Whitelist IP + Publish Comment'),
  );

  // append a submit handler that will proces after the default form handler is finished.
  $form['#submit'][] = 'cloudflare_form_comment_admin_overview_submit';
  return $form;
}