ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DenyElementDecorator.php
Go to the documentation of this file.
1 <?php
2 
7 {
11  public $def;
15  public $element;
16 
21  public function __construct($def, $element)
22  {
23  $this->def = $def;
24  $this->element = $element;
25  }
26 
34  public function validate($string, $config, $context)
35  {
36  $token = $context->get('CurrentToken', true);
37  if ($token && $token->name == $this->element) {
38  return false;
39  }
40  return $this->def->validate($string, $config, $context);
41  }
42 }
43 
44 // vim: et sw=4 sts=4
$context
Definition: webdav.php:25
Base class for all validating attribute definitions.
Definition: AttrDef.php:13
$config
Definition: bootstrap.php:15
Decorator which enables CSS properties to be disabled for specific elements.
validate($string, $config, $context)
Checks if CurrentToken is set and equal to $this->element.