You are here

protected function BotchaForm::createAdminLinksFieldset in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_form.controller.inc \BotchaForm::createAdminLinksFieldset()
  2. 6.3 controller/form/botcha.form.controller.inc \BotchaForm::createAdminLinksFieldset()
  3. 7.3 controller/form/botcha.form.controller.inc \BotchaForm::createAdminLinksFieldset()

Overrides BotchaFormAbstract::createAdminLinksFieldset

1 call to BotchaForm::createAdminLinksFieldset()
BotchaFormNone::createAdminLinksFieldset in controller/botcha_form.controller.inc
1 method overrides BotchaForm::createAdminLinksFieldset()
BotchaFormNone::createAdminLinksFieldset in controller/botcha_form.controller.inc

File

controller/botcha_form.controller.inc, line 148
Controller layer of the BotchaForm objects.

Class

BotchaForm

Code

protected function createAdminLinksFieldset($form_id) {
  $botcha_element = parent::createAdminLinksFieldset($form_id);
  $recipebook = Botcha::getForm($form_id, FALSE)
    ->getRecipebook();
  $botcha_element['#title'] = t('BOTCHA: protection enabled (@recipebook recipe book)', array(
    '@recipebook' => $recipebook->id,
  ));
  $botcha_element['#description'] = t('Untrusted users will have form %form_id protected by BOTCHA (!recipebook_settings, !general_settings).', array(
    '%form_id' => $form_id,
    '!recipebook_settings' => l(t('Recipe book settings'), Botcha::BOTCHA_ADMIN_PATH . "/recipebook/{$recipebook->id}"),
    '!general_settings' => l(t('General BOTCHA settings'), Botcha::BOTCHA_ADMIN_PATH),
  ));
  $botcha_element['protection'] = array(
    '#type' => 'item',
    '#title' => t('Enabled protection'),
    '#markup' => t('Form is protected by "@recipebook" recipe book (!edit, !disable)', array(
      //'#value' => t('Form is protected by "@recipebook" recipe book (!edit, !disable)', array(
      '@recipebook' => $recipebook->id,
      '!edit' => l(t('edit'), Botcha::BOTCHA_ADMIN_PATH . "/form/{$form_id}", array(
        'query' => drupal_get_destination(),
        'html' => TRUE,
      )),
      '!disable' => l(t('disable'), Botcha::BOTCHA_ADMIN_PATH . "/form/{$form_id}/disable", array(
        'query' => drupal_get_destination(),
        'html' => TRUE,
      )),
    )),
  );
  return $botcha_element;
}