6 require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
36 $this->lng = $DIC->language();
37 $this->tree = $DIC->repositoryTree();
38 $lng = $DIC->language();
39 $tree = $DIC->repositoryTree();
41 $this->style_obj = $a_style_obj;
43 parent::__construct($a_xml_file);
54 xml_set_object($a_xml_parser, $this);
55 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
56 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
64 $this->styles = array();
65 parent::startParsing();
66 $this->style_obj->setStyle($this->styles);
67 $this->style_obj->setCharacteristics($this->chars);
78 $this->current_tag = $a_attribs[
"Tag"];
79 $this->current_class = $a_attribs[
"Class"];
80 $this->current_type = $a_attribs[
"Type"];
81 if ($this->current_class ==
"PageTitle" && $this->current_type ==
"page_title" && $this->current_tag ==
"div") {
82 $this->current_tag =
"h1";
84 if ($this->current_class ==
"Headline1" && $this->current_tag ==
"div") {
85 $this->current_tag =
"h1";
86 $this->current_type =
"heading1";
88 if ($this->current_class ==
"Headline2" && $this->current_tag ==
"div") {
89 $this->current_tag =
"h2";
90 $this->current_type =
"heading2";
92 if ($this->current_class ==
"Headline3" && $this->current_tag ==
"div") {
93 $this->current_tag =
"h3";
94 $this->current_type =
"heading3";
96 $this->current_tags = array();
97 $this->chars[] = array(
"type" => $this->current_type,
98 "class" => $this->current_class);
101 case "StyleParameter":
102 $this->current_tags[] = array(
103 "tag" => $this->current_tag,
104 "class" => $this->current_class,
105 "parameter" => $a_attribs[
"Name"],
106 "type" => $this->current_type,
107 "value" => $a_attribs[
"Value"],
108 "custom" => $a_attribs[
"Custom"]);
112 $this->style_obj->addColor($a_attribs[
"Name"], $a_attribs[
"Code"]);
115 case "StyleTemplate":
116 $this->cur_template = array(
"type" => $a_attribs[
"Type"],
117 "name" => $a_attribs[
"Name"]);
118 $this->cur_template_classes = array();
121 case "StyleTemplateClass":
122 $this->cur_template_classes[$a_attribs[
"ClassType"]] =
138 $this->style_obj->setTitle($this->cdata);
142 $this->style_obj->setDescription($this->cdata);
146 $this->styles[] = $this->current_tags;
149 case "StyleTemplate":
150 $this->style_obj->addTemplate(
151 $this->cur_template[
"type"],
152 $this->cur_template[
"name"],
153 $this->cur_template_classes
169 $a_data = str_replace(
"<",
"<", $a_data);
170 $a_data = str_replace(
">",
">", $a_data);
173 $a_data = preg_replace(
"/\n/",
"", $a_data);
174 $a_data = preg_replace(
"/\t+/",
"", $a_data);
175 if (!empty($a_data)) {
176 $this->cdata .= $a_data;
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
startParsing()
start the parser
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
__construct($a_xml_file, &$a_style_obj)
Constructor.
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
handlerEndTag($a_xml_parser, $a_name)
handler for end of element