class BotchaFormNone in BOTCHA Spam Prevention 6.2
Same name and namespace in other branches
- 6.3 controller/form/botcha.form.controller.inc \BotchaFormNone
- 7.2 controller/botcha_form.controller.inc \BotchaFormNone
- 7.3 controller/form/botcha.form.controller.inc \BotchaFormNone
Dummy class, created for data consistency and for interface unifying. When there is no form, this class is used as a handler. It has no logic at all - by design.
Hierarchy
- class \BotchaFormAbstract
- class \BotchaFormNone
Expanded class hierarchy of BotchaFormNone
File
- controller/
botcha_form.controller.inc, line 194 - Controller layer of the BotchaForm objects.
View source
class BotchaFormNone extends BotchaFormAbstract {
public function __construct($form_id = NULL) {
$this->id = !empty($form_id) ? $form_id : 'none';
}
public function getRecipebook() {
return new BotchaRecipebookNone();
}
public function addAdminLinks(&$form) {
$form_id = $form['form_id']['#value'];
// Apply only to allowed forms.
// @todo Move it to new abstraction: form exceptions.
if (!in_array($form_id, array(
'update_script_selection_form',
'user_login',
'user_login_block',
))) {
parent::addAdminLinks($form);
}
}
protected function createAdminLinksFieldset($form_id) {
$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,
)),
);
return $botcha_element;
}
public function save() {
Botcha::unsetForm($this);
// Save form to DB.
BotchaFormModel::save($this);
// Clean session to fetch new values.
Botcha::clean();
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BotchaFormAbstract:: |
protected | property | ||
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public static | function | @todo BotchaForm getForm Description. | |
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
public | function | ||
BotchaFormAbstract:: |
function | |||
BotchaFormNone:: |
public | function |
Overrides BotchaFormAbstract:: |
|
BotchaFormNone:: |
protected | function |
Overrides BotchaFormAbstract:: |
|
BotchaFormNone:: |
public | function |
@todo BotchaForm getRecipebook Description. Overrides BotchaFormAbstract:: |
|
BotchaFormNone:: |
public | function |
Overrides BotchaFormAbstract:: |
|
BotchaFormNone:: |
public | function |
Overrides BotchaFormAbstract:: |