class BotchaForm in BOTCHA Spam Prevention 6.2
Same name and namespace in other branches
- 6.3 controller/form/botcha.form.controller.inc \BotchaForm
- 7.2 controller/botcha_form.controller.inc \BotchaForm
- 7.3 controller/form/botcha.form.controller.inc \BotchaForm
Hierarchy
- class \BotchaFormAbstract
- class \BotchaForm
Expanded class hierarchy of BotchaForm
File
- controller/
botcha_form.controller.inc, line 149 - Controller layer of the BotchaForm objects.
View source
class BotchaForm extends BotchaFormAbstract {
protected function createAdminLinksFieldset($form_id) {
$botcha_element = parent::createAdminLinksFieldset($form_id);
$recipebook = $this
->getRecipebook();
if ($recipebook instanceof BotchaRecipebookNone) {
$botcha_element = parent::createAdminLinksFieldset($form_id);
$botcha_element['#title'] = t('BOTCHA: no protection enabled');
$botcha_element['add_botcha'] = array(
// @todo Abstract it.
//'#markup' => l(t('Add BOTCHA protection on form'), Botcha::BOTCHA_ADMIN_PATH . "/form/add", array('query' => array_merge(drupal_get_destination(), array('botcha_form_id' => $form_id)), 'html' => TRUE)),
'#value' => l(t('Add BOTCHA protection on form'), Botcha::BOTCHA_ADMIN_PATH . "/form/add", array(
'query' => drupal_get_destination() . "&botcha_form_id={$form_id}",
'html' => TRUE,
)),
);
}
else {
$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'),
// @todo Abstract it.
//'#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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BotchaForm:: |
protected | function |
Overrides BotchaFormAbstract:: |
|
BotchaFormAbstract:: |
protected | property | ||
BotchaFormAbstract:: |
public | function | 1 | |
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public static | function | @todo BotchaForm getForm Description. | |
BotchaFormAbstract:: |
public | function | @todo BotchaForm getRecipebook Description. | 1 |
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public | function | 1 | |
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
function | |||
BotchaFormAbstract:: |
protected | function | 1 |