43 {
44 if(
45 strpos($name, 'isActiveFor') === 0 ||
46 strpos($name, 'setActiveFor') === 0
47 )
48 {
51 $method_parts = explode('_', strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name)));
52 $requested_context = strtolower($method_parts[count($method_parts) - 1]);
53 if(!isset($requested_context, self::$context_map))
54 {
55 throw new BadMethodCallException('Method ' . $name . ' called for a non existing context.');
56 }
57
58 if('set' == $method_parts[0])
59 {
60 $settings->set('activate_captcha_anonym_' . $supported_contexts[$requested_context], (int)$arguments[0]);
61 return;
62 }
63 else
64 {
65 return self::checkFreetype() && (bool)$settings->get(
'activate_captcha_anonym_' . $supported_contexts[$requested_context],
false);
66 }
67 }
68 else
69 {
70 throw new BadMethodCallException('Call to an undefined static method ' . $name . ' in class ' . __CLASS__ . '.');
71 }
72 }
static getSupportedContexts()
static checkFreetype()
Check whether captcha support is active.