You are here

class BotchaRecipebook in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 controller/recipebook/botcha.recipebook.controller.inc \BotchaRecipebook
  2. 7.2 controller/botcha_recipebook.controller.inc \BotchaRecipebook
  3. 7.3 controller/recipebook/botcha.recipebook.controller.inc \BotchaRecipebook

Hierarchy

Expanded class hierarchy of BotchaRecipebook

File

controller/botcha_recipebook.controller.inc, line 436
Controller layer of the BotchaRecipebook objects.

View source
class BotchaRecipebook extends BotchaRecipebookAbstract {

  /* @todo Remove it.
    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'),
        // @todo Abstract it.
        //'#markup' => t('Form is protected by "@recipebook" recipe book (!edit, !delete)', array(
        '#value' => t('Form is protected by "@recipebook" recipe book (!edit, !delete)', array(
          '@recipebook' => $recipebook->id,
          '!edit' => l(t('edit'), Botcha::BOTCHA_ADMIN_PATH . "/form/$form_id", array('query' => drupal_get_destination(), 'html' => TRUE)),
          '!delete' => l(t('delete'), Botcha::BOTCHA_ADMIN_PATH . "/form/$form_id/delete", array('query' => drupal_get_destination(), 'html' => TRUE)),
        )),
      );
      return $botcha_element;
    }
     *
     */
  public function save() {

    // Save recipe book to DB.
    BotchaRecipebookModel::save($this);
    parent::save();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BotchaRecipebook::save public function Overrides BotchaRecipebookAbstract::save
BotchaRecipebookAbstract::$description public property Description of the recipe book.
BotchaRecipebookAbstract::$forms protected property List of forms.
BotchaRecipebookAbstract::$id public property Identifier of the recipe book.
BotchaRecipebookAbstract::$recipes protected property List of recipes.
BotchaRecipebookAbstract::$title public property A title of the book.
BotchaRecipebookAbstract::apply function
BotchaRecipebookAbstract::applyForBuildId protected function
BotchaRecipebookAbstract::delete public function
BotchaRecipebookAbstract::getCsss protected function
BotchaRecipebookAbstract::getDescription function
BotchaRecipebookAbstract::getForms function @todo BotchaRecipebook getForms Description.
BotchaRecipebookAbstract::getJss protected function
BotchaRecipebookAbstract::getRecipebook public static function
BotchaRecipebookAbstract::getRecipes function @todo BotchaRecipebook getRecipes Description.
BotchaRecipebookAbstract::getRecipesByStatus function Get the list of recipes by status of spam checking.
BotchaRecipebookAbstract::getRecipeSecret protected function
BotchaRecipebookAbstract::getTitle function
BotchaRecipebookAbstract::handle function Handle form depending on the result of spam check.
BotchaRecipebookAbstract::isApplicable public function
BotchaRecipebookAbstract::isSpam function Spam check. Currently the logic is as follows: if we could find a recipe that failed spam check - then we consider this form submission as spam and decline it.
BotchaRecipebookAbstract::setDescription function
BotchaRecipebookAbstract::setForm function
BotchaRecipebookAbstract::setRecipe function
BotchaRecipebookAbstract::setTitle function
BotchaRecipebookAbstract::unsetForm function
BotchaRecipebookAbstract::unsetRecipe function
BotchaRecipebookAbstract::__construct protected function 1