Source for file Filter.php
Documentation is available at Filter.php
* Microsoft's proprietary filter: CSS property
* @note Currently supports the alpha filter. In the future, this will
* probably need an extensible framework
public function validate($value, $config, $context) {
if ($value ===
'none') return $value;
// if we looped this we could support multiple filters
$function_length =
strcspn($value, '(');
$function =
trim(substr($value, 0, $function_length));
if ($function !==
'alpha' &&
$function !==
'progid:DXImageTransform.Microsoft.Alpha'
$cursor =
$function_length +
1;
$parameters_length =
strcspn($value, ')', $cursor);
$parameters =
substr($value, $cursor, $parameters_length);
$params =
explode(',', $parameters);
foreach ($params as $param) {
list
($key, $value) =
explode('=', $param);
if (isset
($lookup[$key])) continue;
if ($key !==
'opacity') continue;
$value =
$this->intValidator->validate($value, $config, $context);
if ($value ===
false) continue;
if ($int >
100) $value =
'100';
if ($int <
0) $value =
'0';
$ret_params[] =
"$key=$value";
$ret_parameters =
implode(',', $ret_params);
$ret_function =
"$function($ret_parameters)";
Documentation generated on Thu, 19 Jun 2008 18:49:12 -0400 by phpDocumentor 1.4.2