6 require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
31 $this->style_obj =& $a_style_obj;
44 xml_set_object($a_xml_parser,$this);
45 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
46 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
54 $this->styles = array();
56 $this->style_obj->setStyle($this->styles);
57 $this->style_obj->setCharacteristics($this->chars);
70 $this->current_tag = $a_attribs[
"Tag"];
71 $this->current_class = $a_attribs[
"Class"];
72 $this->current_type = $a_attribs[
"Type"];
73 if ($this->current_class ==
"PageTitle" && $this->current_type ==
"page_title" && $this->current_tag ==
"div")
75 $this->current_tag =
"h1";
77 if ($this->current_class ==
"Headline1" && $this->current_tag ==
"div")
79 $this->current_tag =
"h1";
80 $this->current_type =
"heading1";
82 if ($this->current_class ==
"Headline2" && $this->current_tag ==
"div")
84 $this->current_tag =
"h2";
85 $this->current_type =
"heading2";
87 if ($this->current_class ==
"Headline3" && $this->current_tag ==
"div")
89 $this->current_tag =
"h3";
90 $this->current_type =
"heading3";
92 $this->current_tags = array();
93 $this->chars[] = array(
"type" => $this->current_type,
94 "class" => $this->current_class);
97 case "StyleParameter":
98 $this->current_tags[] = array(
99 "tag" => $this->current_tag,
100 "class" => $this->current_class,
101 "parameter" => $a_attribs[
"Name"],
102 "type" => $this->current_type,
103 "value" => $a_attribs[
"Value"]);
107 $this->style_obj->addColor($a_attribs[
"Name"], $a_attribs[
"Code"]);
110 case "StyleTemplate":
111 $this->cur_template = array(
"type" => $a_attribs[
"Type"],
112 "name" => $a_attribs[
"Name"]);
113 $this->cur_template_classes = array();
116 case "StyleTemplateClass":
117 $this->cur_template_classes[$a_attribs[
"ClassType"]] =
134 $this->style_obj->setTitle($this->cdata);
138 $this->style_obj->setDescription($this->cdata);
142 $this->styles[] = $this->current_tags;
145 case "StyleTemplate":
146 $this->style_obj->addTemplate($this->cur_template[
"type"],
147 $this->cur_template[
"name"], $this->cur_template_classes);
162 $a_data = str_replace(
"<",
"<",$a_data);
163 $a_data = str_replace(
">",
">",$a_data);
166 $a_data = preg_replace(
"/\n/",
"",$a_data);
167 $a_data = preg_replace(
"/\t+/",
"",$a_data);
170 $this->cdata .= $a_data;