33 require_once(
"./classes/class.ilSaxParser.php");
62 if ($a_template_id ==
"")
69 $this->template_id = $a_template_id;
71 if ($a_template_id ==
"default")
93 if (is_array($this->styles))
105 return $this->template_id;
111 return $this->template_name;
117 return $this->styles[$a_id];
123 return $this->styles[$a_id][
"name"];
129 return $this->styles[$a_id][
"image_directory"];
134 return $this->styles[$a_id][
"sound_directory"];
141 $skins[] = array(
"id" =>
"default");
142 if ($dp = @opendir(
"./Customizing/global/skin"))
144 while ((
$file = readdir($dp)) !=
false)
147 if (is_dir(
"./Customizing/global/skin/".
$file) &&
$file !=
"." &&
$file !=
".." &&
$file !=
"CVS"
150 if (is_file(
"./Customizing/global/skin/".
$file.
"/template.xml"))
184 xml_set_object($a_xml_parser,$this);
185 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
186 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
199 if (!isset($a_attribs[
"sound_directory"]))
201 $a_attribs[
"sound_directory"] =
"";
204 if (!isset($a_attribs[
"browsers"]))
206 $a_attribs[
"browsers"] =
"";
212 $this->template_name = $a_attribs[
"name"];
216 $this->styles[$a_attribs[
"id"]] =
217 array(
"id" => $a_attribs[
"id"],
218 "name" => $a_attribs[
"name"],
219 "css_file" => $a_attribs[
"id"].
".css",
220 "image_directory" => $a_attribs[
"image_directory"],
221 "sound_directory" => $a_attribs[
"sound_directory"]
224 explode(
",", $a_attribs[
"browsers"]);
225 foreach ($browsers as $val)
227 $this->styles[$a_attribs[
"id"]][
"browsers"][] = trim($val);
244 if ($skin ==
"default")
246 if (is_file(
"./templates/".$skin.
"/template.xml") &&
247 is_file(
"./templates/".$skin.
"/".$style.
".css")
255 if (is_file(
"./Customizing/global/skin/".$skin.
"/template.xml") &&
256 is_file(
"./Customizing/global/skin/".$skin.
"/".$style.
".css")
274 if ($skin ==
"default")
276 if (is_file(
"./templates/".$skin.
"/template.xml"))
283 if (is_file(
"./Customizing/global/skin/".$skin.
"/template.xml"))
301 $a_data = preg_replace(
"/\n/",
"",$a_data);
302 $a_data = preg_replace(
"/\t+/",
"",$a_data);
306 switch($this->current_tag)
338 return isset(self::$current_skin) ? self::$current_skin :
339 $ilias->account->skin;
354 return isset(self::$current_style) ? self::$current_style :
355 $ilias->account->prefs[
'style'];
365 global $styleDefinition;
367 if (is_object($styleDefinition)
368 and $styleDefinition->getTemplateId() != $a_skin)
371 $styleDefinition->startParsing();
374 self::$current_skin = $a_skin;
385 self::$current_style = $a_style;