ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
IDAccumulator.php
Go to the documentation of this file.
1<?php
2
10{
11
16 public $ids = array();
17
24 public static function build($config, $context)
25 {
26 $id_accumulator = new HTMLPurifier_IDAccumulator();
27 $id_accumulator->load($config->get('Attr.IDBlacklist'));
28 return $id_accumulator;
29 }
30
36 public function add($id)
37 {
38 if (isset($this->ids[$id])) {
39 return false;
40 }
41 return $this->ids[$id] = true;
42 }
43
49 public function load($array_of_ids)
50 {
51 foreach ($array_of_ids as $id) {
52 $this->ids[$id] = true;
53 }
54 }
55}
56
57// vim: et sw=4 sts=4
Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes.
static build($config, $context)
Builds an IDAccumulator, also initializing the default blacklist.
$ids
Lookup table of IDs we've accumulated.
load($array_of_ids)
Load a list of IDs into the lookup table.
add($id)
Add an ID to the lookup table.