function botcha_get_form_id_setting in BOTCHA Spam Prevention 6
Same name and namespace in other branches
- 7 botcha.inc \botcha_get_form_id_setting()
Get the BOTCHA setting for a given form_id.
Parameters
$form_id the form_id to query for:
$symbolic flag to return as (symbolic) strings instead of object.:
Return value
NULL if no setting is known or a botcha_point object with fields 'type'. If argument $symbolic is true, returns (symbolic) as 'none', 'default', etc.
4 calls to botcha_get_form_id_setting()
- BotchaAdminTestCase::assertBotchaSetting in ./
botcha.test - Helper function for checking BOTCHA setting of a form.
- BotchaAdminTestCase::testBotchaPointSettingGetterAndSetter in ./
botcha.test - Test the BOTCHA point setting getter/setter.
- botcha_form_alter in ./
botcha.module - Implementation of hook_form_alter().
- botcha_point_admin_form in ./
botcha.pages.inc - Form for adding BOTCHA point.
File
- ./
botcha.inc, line 58 - General BOTCHA functionality and helper functions.
Code
function botcha_get_form_id_setting($form_id, $symbolic = FALSE) {
$result = db_query("SELECT botcha_type FROM {botcha_points} WHERE form_id = '%s'", $form_id);
if (!$result) {
return NULL;
}
$botcha_point = db_fetch_object($result);
if (!$botcha_point) {
return NULL;
}
elseif ($botcha_point->botcha_type == NULL && $symbolic) {
$botcha_point->botcha_type = 'none';
}
if ($symbolic) {
$botcha_point = $botcha_point->botcha_type;
}
return $botcha_point;
}