You are here

public function BotchaRecipeObscureUrl::generateFormElements in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipe.controller.inc \BotchaRecipeObscureUrl::generateFormElements()
  2. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipeObscureUrl::generateFormElements()
  3. 7.2 controller/botcha_recipe.controller.inc \BotchaRecipeObscureUrl::generateFormElements()

Used to get information about the recipe. Must be overridden with calling to parent::generateFormElements. @todo Switch from indexed array to associative. @see?

Overrides BotchaRecipeUsingJsAbstract::generateFormElements

File

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

Class

BotchaRecipeObscureUrl

Code

public function generateFormElements() {
  $fields = $this
    ->getProperty($this->settings['fields'], 'getFields');
  return array_merge(parent::generateFormElements(), array(
    // Add hidden field to keep part of the token.
    $fields[1]['name'] => array(
      '#type' => 'hidden',
      // Store part of secure_token.
      '#default_value' => $fields[1]['default_value'],
      // @todo Abstract it.

      //'#attributes' => array('class' => $fields[1]['class']),
      '#attributes' => array(
        'class' => array(
          $fields[1]['class'],
        ),
      ),
      '#weight' => 20,
    ),
  ));
}