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 89 of file class.ilStyleImportParser.php.
References null, and trimAndStripAttribs().
Referenced by setHandlers().
97 $this->current_tag = $a_attribs[
"Tag"];
98 $this->current_class = $a_attribs[
"Class"];
99 $this->current_type = $a_attribs[
"Type"];
100 if ($this->current_class ==
"PageTitle" && $this->current_type ==
"page_title" && $this->current_tag ==
"div") {
101 $this->current_tag =
"h1";
103 if ($this->current_class ==
"Headline1" && $this->current_tag ==
"div") {
104 $this->current_tag =
"h1";
105 $this->current_type =
"heading1";
107 if ($this->current_class ==
"Headline2" && $this->current_tag ==
"div") {
108 $this->current_tag =
"h2";
109 $this->current_type =
"heading2";
111 if ($this->current_class ==
"Headline3" && $this->current_tag ==
"div") {
112 $this->current_tag =
"h3";
113 $this->current_type =
"heading3";
115 $this->current_tags = array();
116 $this->chars[] = array(
"type" => $this->current_type,
117 "class" => $this->current_class);
120 case "StyleParameter":
121 $this->current_tags[] = array(
122 "tag" => $this->current_tag,
123 "class" => $this->current_class,
124 "parameter" => $a_attribs[
"Name"],
125 "type" => $this->current_type,
126 "value" => $a_attribs[
"Value"],
127 "custom" => $a_attribs[
"Custom"] ??
null);
131 $this->color_manager->addColor($a_attribs[
"Name"], $a_attribs[
"Code"]);
134 case "StyleTemplate":
135 $this->cur_template = array(
"type" => $a_attribs[
"Type"],
136 "name" => $a_attribs[
"Name"]);
137 $this->cur_template_classes = array();
140 case "StyleTemplateClass":
141 $this->cur_template_classes[$a_attribs[
"ClassType"]] =
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
trimAndStripAttribs(array $attribs)
◆ handlerCharacterData()
ilStyleImportParser::handlerCharacterData |
( |
|
$a_xml_parser, |
|
|
string |
$a_data |
|
) |
| |
Definition at line 176 of file class.ilStyleImportParser.php.
Referenced by setHandlers().
184 $a_data = str_replace(
"<",
"<", $a_data);
185 $a_data = str_replace(
">",
">", $a_data);
188 $a_data = preg_replace(
"/\n/",
"", $a_data);
189 $a_data = preg_replace(
"/\t+/",
"", $a_data);
190 if (!empty($a_data)) {
191 $this->cdata .= $a_data;
◆ handlerEndTag()
ilStyleImportParser::handlerEndTag |
( |
|
$a_xml_parser, |
|
|
string |
$a_name |
|
) |
| |
Definition at line 148 of file class.ilStyleImportParser.php.
References $current_tags, and trimAndStrip().
Referenced by setHandlers().
155 $this->style_obj->setTitle($this->cdata);
159 $this->style_obj->setDescription($this->cdata);
166 case "StyleTemplate":
167 $this->style_obj->addTemplate(
168 $this->cur_template[
"type"],
169 $this->cur_template[
"name"],
170 $this->cur_template_classes
trimAndStrip(string $input)
◆ setHandlers()
ilStyleImportParser::setHandlers |
( |
|
$a_xml_parser | ) |
|
◆ startParsing()
ilStyleImportParser::startParsing |
( |
| ) |
|
start the parser
Definition at line 81 of file class.ilStyleImportParser.php.
83 $this->styles = array();
84 parent::startParsing();
85 $this->style_obj->setStyle($this->styles);
86 $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: