You are here

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

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

Get a list of available BOTCHA form objects.

Parameters

boolean $reset:

Return value

BotchaForm

2 calls to Botcha::getForms()
Botcha::getAdminForm in controller/botcha.controller.inc
BotchaTestCase::setUp in ./botcha.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

File

controller/botcha.controller.inc, line 270
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;
}