You are here

public static function Botcha::getForms in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha.controller.inc \Botcha::getForms()

Get a list of available BOTCHA form objects.

Parameters

boolean $reset:

Return value

BotchaForm

3 calls to Botcha::getForms()
Botcha::getAdminForm in controller/botcha.controller.inc
Get admin form.
BotchaAdminTestCase::setUp in ./botcha.test
Sets up a Drupal site for running functional and integration tests.
BotchaTestCase::setUp in ./botcha.test
Sets up a Drupal site for running functional and integration tests.

File

controller/botcha.controller.inc, line 266
Contains Botcha class.

Class

Botcha
Singleton realization of botcha application.

Code

public static function getForms($reset = FALSE) {
  $forms = array();
  $fs = array_keys(BotchaFormModel::getForms());
  foreach ($fs as $form_id) {
    $form_session =& $_SESSION[self::BOTCHA_SESSION_FORMS][$form_id];
    if (empty($form_session) || $reset) {
      Botcha::setForm(Botcha::getForm($form_id, FALSE));
    }
    $forms[$form_id] = unserialize($form_session);
  }
  return $forms;
}