You are here

protected function BotchaRecipeObscureUrl::prepare in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeObscureUrl::prepare()

Overrides BotchaRecipe::prepare

File

controller/recipe/botcha.recipe.controller.inc, line 802
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipeObscureUrl

Code

protected function prepare($form, $form_state) {
  parent::prepare($form, $form_state);

  // Make some preparations dependent on form before applying.
  $this->settings['form_id'] = $form['form_id']['#value'];
  $this->settings['form_action'] = $form['#action'];

  // @todo Merge url_elements with just fields.
  // @see?
  $fields = $this
    ->getProperty($this->settings['fields'], 'getFields');
  $js = $this
    ->getProperty($this->settings['js'], 'getJs');
  $this->url_elements[$fields[2]['name']] = array(
    // Describe URL field. JS will return token in URL field.
    '#type' => 'textfield',
    '#default_value' => '',
    '!valid_token' => $js['secure_token'],
  );
}