ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Image.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
14  public $name = 'Image';
15 
19  public function setup($config)
20  {
21  $max = $config->get('HTML.MaxImgLength');
22  $img = $this->addElement(
23  'img',
24  'Inline',
25  'Empty',
26  'Common',
27  array(
28  'alt*' => 'Text',
29  // According to the spec, it's Length, but percents can
30  // be abused, so we allow only Pixels.
31  'height' => 'Pixels#' . $max,
32  'width' => 'Pixels#' . $max,
33  'longdesc' => 'URI',
34  'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded
35  )
36  );
37  if ($max === null || $config->get('HTML.Trusted')) {
38  $img->attr['height'] =
39  $img->attr['width'] = 'Length';
40  }
41 
42  // kind of strange, but splitting things up would be inefficient
43  $img->attr_transform_pre[] =
44  $img->attr_transform_post[] =
46  }
47 }
48 
49 // vim: et sw=4 sts=4
addElement($element, $type, $contents, $attr_includes=array(), $attr=array())
Convenience function that sets up a new element.
Definition: HTMLModule.php:144
Represents an XHTML 1.1 module, with information on elements, tags and attributes.
Definition: HTMLModule.php:18
XHTML 1.1 Image Module provides basic image embedding.
Definition: Image.php:8
Transform that supplies default values for the src and alt attributes in img tags, as well as prevents the img tag from being removed because of a missing alt tag.
Definition: ImgRequired.php:11
Validates a URI as defined by RFC 3986.
Definition: URI.php:7