function BotchaRecipebookAbstract::apply in BOTCHA Spam Prevention 6.2
Same name and namespace in other branches
- 7.2 controller/botcha_recipebook.controller.inc \BotchaRecipebookAbstract::apply()
File
- controller/botcha_recipebook.controller.inc, line 373
- Controller layer of the BotchaRecipebook objects.
Class
- BotchaRecipebookAbstract
- @file
Controller layer of the BotchaRecipebook objects.
Code
function apply(&$form, &$form_state) {
$form += array(
'#input' => TRUE,
);
$form['#process'][] = 'botcha_fprocess';
if (!empty($_POST['form_build_id'])) {
$build_id = $_POST['form_build_id'];
$method = 'build_id_submit';
}
else {
$build_id = $form['#build_id'];
$method = 'build_id';
}
$this
->applyForBuildId($form, $form_state, $method, $build_id);
if (is_array($form['#validate'])) {
array_unshift($form['#validate'], '');
$form['#validate'][0] = '_botcha_form_validate';
}
else {
$form['#validate'] = array(
'_botcha_form_validate',
);
}
$form_state['#botcha'] = $this->id;
$csss = $this
->getCsss();
$jss = $this
->getJss();
if (BOTCHA_LOGLEVEL >= 4) {
watchdog(BOTCHA_LOG, '%form_id form prepared by BOTCHA: added recipes - !botchas!more', array(
'%form_id' => $form['form_id']['#value'],
'!botchas' => join(', ', $this->recipes),
'!more' => '' . (BOTCHA_LOGLEVEL >= 5 ? '<br /><br />' . 'POST=<pre>' . print_r(_botcha_filter_form_values_log($_POST), 1) . '</pre>' : '') . (BOTCHA_LOGLEVEL >= 5 ? '<br /><br />' . 'GET=<pre>' . print_r(_botcha_filter_form_values_log($_GET), 1) . '</pre>' : '') . (BOTCHA_LOGLEVEL >= 5 ? '<br /><br />' . 'SERVER=<pre>' . print_r($_SERVER, 1) . '</pre>' : '') . (BOTCHA_LOGLEVEL >= 5 ? '<br /><br />' . 'form=<pre>' . print_r(_botcha_filter_form_log($form), 1) . '</pre>' : '') . (BOTCHA_LOGLEVEL >= 5 && count($jss) ? '<br /><br />' . 'JS=<pre>' . join("\n", $jss) . '</pre>' : '') . (BOTCHA_LOGLEVEL >= 5 && count($csss) ? '<br /><br />' . 'CSS=<pre>' . join("\n", $csss) . '</pre>' : ''),
), WATCHDOG_NOTICE);
}
}