|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00006 class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule 00007 { 00008 00009 public $name = 'List'; 00010 00011 // According to the abstract schema, the List content set is a fully formed 00012 // one or more expr, but it invariably occurs in an optional declaration 00013 // so we're not going to do that subtlety. It might cause trouble 00014 // if a user defines "List" and expects that multiple lists are 00015 // allowed to be specified, but then again, that's not very intuitive. 00016 // Furthermore, the actual XML Schema may disagree. Regardless, 00017 // we don't have support for such nested expressions without using 00018 // the incredibly inefficient and draconic Custom ChildDef. 00019 00020 public $content_sets = array('Flow' => 'List'); 00021 00022 public function setup($config) { 00023 $ol = $this->addElement('ol', 'List', 'Required: li', 'Common'); 00024 $ol->wrap = "li"; 00025 $ul = $this->addElement('ul', 'List', 'Required: li', 'Common'); 00026 $ul->wrap = "li"; 00027 $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); 00028 00029 $this->addElement('li', false, 'Flow', 'Common'); 00030 00031 $this->addElement('dd', false, 'Flow', 'Common'); 00032 $this->addElement('dt', false, 'Inline', 'Common'); 00033 } 00034 00035 } 00036 00037 // vim: et sw=4 sts=4