Style Import Parser.
More...
Style Import Parser.
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 28 of file class.ilStyleImportParser.php.
◆ __construct()
ilStyleImportParser::__construct |
( |
string |
$a_xml_file, |
|
|
ilObjStyleSheet |
$a_style_obj |
|
) |
| |
◆ handlerBeginTag()
ilStyleImportParser::handlerBeginTag |
( |
|
$a_xml_parser, |
|
|
string |
$a_name, |
|
|
array |
$a_attribs |
|
) |
| |
Definition at line 90 of file class.ilStyleImportParser.php.
References trimAndStripAttribs().
98 $this->current_tag = $a_attribs[
"Tag"];
99 $this->current_class = $a_attribs[
"Class"];
100 $this->current_type = $a_attribs[
"Type"];
101 if ($this->current_class ==
"PageTitle" && $this->current_type ==
"page_title" && $this->current_tag ==
"div") {
102 $this->current_tag =
"h1";
104 if ($this->current_class ==
"Headline1" && $this->current_tag ==
"div") {
105 $this->current_tag =
"h1";
106 $this->current_type =
"heading1";
108 if ($this->current_class ==
"Headline2" && $this->current_tag ==
"div") {
109 $this->current_tag =
"h2";
110 $this->current_type =
"heading2";
112 if ($this->current_class ==
"Headline3" && $this->current_tag ==
"div") {
113 $this->current_tag =
"h3";
114 $this->current_type =
"heading3";
116 $this->current_tags = array();
117 $this->chars[] = array(
"type" => $this->current_type,
118 "class" => $this->current_class);
121 case "StyleParameter":
122 $this->current_tags[] = array(
123 "tag" => $this->current_tag,
124 "class" => $this->current_class,
125 "parameter" => $a_attribs[
"Name"],
126 "type" => $this->current_type,
127 "value" => $a_attribs[
"Value"],
128 "custom" => $a_attribs[
"Custom"] ?? null);
132 $this->color_manager->addColor($a_attribs[
"Name"], $a_attribs[
"Code"]);
135 case "StyleTemplate":
136 $this->cur_template = array(
"type" => $a_attribs[
"Type"],
137 "name" => $a_attribs[
"Name"]);
138 $this->cur_template_classes = array();
141 case "StyleTemplateClass":
142 $this->cur_template_classes[$a_attribs[
"ClassType"]] =
trimAndStripAttribs(array $attribs)
◆ handlerCharacterData()
ilStyleImportParser::handlerCharacterData |
( |
|
$a_xml_parser, |
|
|
string |
$a_data |
|
) |
| |
Definition at line 179 of file class.ilStyleImportParser.php.
187 $a_data = str_replace(
"<",
"<", $a_data);
188 $a_data = str_replace(
">",
">", $a_data);
191 $a_data = preg_replace(
"/\n/",
"", $a_data);
192 $a_data = preg_replace(
"/\t+/",
"", $a_data);
193 if (!empty($a_data)) {
194 $this->cdata .= $a_data;
◆ handlerEndTag()
ilStyleImportParser::handlerEndTag |
( |
|
$a_xml_parser, |
|
|
string |
$a_name |
|
) |
| |
Definition at line 150 of file class.ilStyleImportParser.php.
References $current_tags, and trimAndStrip().
157 $this->style_obj->setTitle($this->cdata);
161 $this->style_obj->setDescription($this->cdata);
168 case "StyleTemplate":
169 $this->style_obj->addTemplate(
170 $this->cur_template[
"type"],
171 $this->cur_template[
"name"],
172 $this->cur_template_classes
trimAndStrip(string $input)
◆ setHandlers()
ilStyleImportParser::setHandlers |
( |
|
$a_xml_parser | ) |
|
set event handler should be overwritten by inherited class private
Definition at line 72 of file class.ilStyleImportParser.php.
74 xml_set_object($a_xml_parser, $this);
75 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
76 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
◆ startParsing()
ilStyleImportParser::startParsing |
( |
| ) |
|
start the parser
Definition at line 82 of file class.ilStyleImportParser.php.
84 $this->styles = array();
85 parent::startParsing();
86 $this->style_obj->setStyle($this->styles);
87 $this->style_obj->setCharacteristics($this->chars);
◆ trimAndStrip()
ilStyleImportParser::trimAndStrip |
( |
string |
$input | ) |
|
|
protected |
◆ trimAndStripAttribs()
ilStyleImportParser::trimAndStripAttribs |
( |
array |
$attribs | ) |
|
|
protected |
◆ $cdata
string ilStyleImportParser::$cdata = "" |
|
protected |
◆ $chars
array ilStyleImportParser::$chars = [] |
|
protected |
◆ $color_manager
◆ $cur_template
array ilStyleImportParser::$cur_template |
|
protected |
◆ $cur_template_classes
array ilStyleImportParser::$cur_template_classes |
|
protected |
◆ $current_class
string ilStyleImportParser::$current_class = "" |
|
protected |
◆ $current_tag
string ilStyleImportParser::$current_tag = "" |
|
protected |
◆ $current_tags
array ilStyleImportParser::$current_tags = [] |
|
protected |
◆ $current_type
string ilStyleImportParser::$current_type = "" |
|
protected |
◆ $style_obj
◆ $styles
array ilStyleImportParser::$styles |
|
protected |
◆ $tree
ilTree ilStyleImportParser::$tree |
|
protected |
The documentation for this class was generated from the following file: