You are here

function spambot_form_user_admin_account_alter in Spambot 7

Implements hook_form_FORM_ID_alter().

File

./spambot.module, line 92
Main module file.

Code

function spambot_form_user_admin_account_alter(&$form, &$form_state, $form_id) {
  foreach ($form['accounts']['#options'] as $uid => $user_options) {

    // Change $form['accounts']['#options'][$uid]['operations']['data']
    // into a multi-item render array so we can append to it.
    $form['accounts']['#options'][$uid]['operations']['data'] = array(
      'edit' => $form['accounts']['#options'][$uid]['operations']['data'],
    );
    $form['accounts']['#options'][$uid]['operations']['data']['spam'] = array(
      '#type' => 'link',
      '#title' => t('spam'),
      '#href' => "user/{$uid}/spambot",
      // Ugly hack to insert a space.
      '#prefix' => ' ',
    );
  }
}