CMS  Version 3.9
captcha_manager.inc
Go to the documentation of this file.
1 <?php
14 {
15  static $providers = array();
16 
17  function CaptchaManager()
18  {
19  ComponentManager::fireEvent("RegisterCaptchaProvider");
20  }
21 
23  {
24  $provider = Settings::getValue("captcha", "captcha_provider");
25  if (!$provider) return;
26 
27  $renderer = new $provider($form);
28  }
29 
31  {
33  }
34 
35  static function setDefaults()
36  {
37  Settings::setDefaultValue("captcha", "captcha_provider", "", String, "Select the Captcha provider to use on your site", "CAPTCHA Provider");
38  }
39 
41  {
43  }
44 
45  static function settingsExtension($form)
46  {
47  $mgr = new CaptchaManager();
48  $providerSelect = new SelectFieldRenderer($form, "captcha_provider", "Captcha Provider", CaptchaManager::$providers);
49  $providerSelect->defaultBlank = true;
50  }
51 }
52 ?>
$form
$name
Definition: upload.inc:54
Provides a central management class for event handlers and common functionality for the captcha compo...
static registerSettingsFormExtension()
static settingsExtension($form)
static setDefaults()
static registerCaptchaProvider($name, $class)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
Definition: settings.inc:174
static registerExtension($component, $handler)
$renderer