You are here

function BotchaRecipeObscureUrl::applyRecipe in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 7.2 controller/botcha_recipe.controller.inc \BotchaRecipeObscureUrl::applyRecipe()

Overrides BotchaRecipe::applyRecipe

File

controller/botcha_recipe.controller.inc, line 736
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipeObscureUrl

Code

function applyRecipe(&$form, &$form_state) {

  // Make some preparations dependent on form before applying.
  $this
    ->setSetting('form_id', $form['form_id']['#value']);
  $this
    ->setSetting('form_action', $form['#action']);
  parent::applyRecipe($form, $form_state);

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

  // @todo Refactor url_elements saving.
  Botcha::setRecipe($this);
}