19declare(strict_types=1);
49 $this->
lng = $DIC->language();
50 $this->tree =
$DIC->repositoryTree();
53 $access_manager =
$service->domain()->access(0,
$DIC->user()->getId());
54 $access_manager->enableWrite(
true);
56 $this->color_manager =
$service->domain()->color(
57 $a_style_obj->
getId(),
61 $this->style_obj = $a_style_obj;
83 $this->styles = array();
84 parent::startParsing();
85 $this->style_obj->setStyle($this->styles);
86 $this->style_obj->setCharacteristics($this->chars);
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"]] =
152 $this->cdata = $this->trimAndStrip($this->cdata);
155 $this->style_obj->setTitle($this->cdata);
159 $this->style_obj->setDescription($this->cdata);
163 $this->styles[] = $this->current_tags;
166 case "StyleTemplate":
167 $this->style_obj->addTemplate(
168 $this->cur_template[
"type"],
169 $this->cur_template[
"name"],
170 $this->cur_template_classes
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;
198 foreach ($attribs as $k => $v) {
199 $ret[$k] = $this->trimAndStrip((
string) $v);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerEndTag( $a_xml_parser, string $a_name)
ilObjStyleSheet $style_obj
trimAndStripAttribs(array $attribs)
__construct(string $a_xml_file, ilObjStyleSheet $a_style_obj)
handlerCharacterData( $a_xml_parser, string $a_data)
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private
startParsing()
start the parser
array $cur_template_classes
handlerBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
trimAndStrip(string $input)
Content ColorManager $color_manager
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc