29 if(function_exists(
'imageftbbox'))
47 strpos($name,
'isActiveFor') === 0 ||
48 strpos($name,
'setActiveFor') === 0
52 $supported_contexts = self::getSupportedContexts();
53 $method_parts = explode(
'_', strtolower(preg_replace(
'/([a-z])([A-Z])/',
'$1_$2', $name)));
54 $requested_context = strtolower($method_parts[count($method_parts) - 1]);
55 if(!isset($requested_context, self::$context_map))
60 if(
'set' == $method_parts[0])
62 $settings->set(
'activate_captcha_anonym_' . $supported_contexts[$requested_context], (
int)$arguments[0]);
67 return self::checkFreetype() && (bool)$settings->get(
'activate_captcha_anonym_' . $supported_contexts[$requested_context],
false);
72 throw new BadMethodCallException(
'Call to an undefined static method ' . $name .
' in class ' . __CLASS__ .
'.');
79 public static function getPreconditionsMessage()
86 $lng->loadLanguageModule(
'cptch');
87 return "<a target='_blank' href='http://php.net/manual/en/image.installation.php'>" . $lng->txt(
'cptch_freetype_support_needed') .
"</a>";
95 if(null !== self::$context_map)
97 return self::$context_map;
100 self::$context_map =
array();
102 $r =
new ReflectionClass(
new self());
103 $constants =
$r->getConstants();
104 foreach($constants as $name => $value)
106 if(strpos($name,
'CONTEXT_') === 0)
108 self::$context_map[strtolower(substr($name, strlen(
'CONTEXT_')))] = $value;
112 return self::$context_map;
const CONTEXT_REGISTRATION
static checkFreetype()
Check whether captcha support is active.
static __callStatic($name, array $arguments=array())
Create styles array
The data for the language used.
static getSupportedContexts()
static getLogger($a_component_id)
Get component logger.