Inheritance diagram for ilObjStyleSheet:
Collaboration diagram for ilObjStyleSheet:Public Member Functions | |
| ilObjStyleSheet ($a_id=0, $a_call_by_reference=false) | |
| Constructor public. | |
| setRefId () | |
| getRefId () | |
| get reference id public | |
| putInTree () | |
| createReference () | |
| creates reference for object | |
| assignMetaData (&$a_meta_data) | |
| assign meta data object | |
| & | getMetaData () |
| get meta data object | |
| create () | |
| create | |
| addParameter ($a_tag, $a_par) | |
| write style parameter to db | |
| deleteParameter ($a_id) | |
| delete style parameter | |
| delete () | |
| delete style object | |
| read () | |
| read style properties | |
| writeCSSFile ($a_target_file="") | |
| write css file to webspace directory | |
| getContentStylePath ($a_style_id) | |
| get content style path | |
| getContentPrintStyle () | |
| get content print style | |
| getSyntaxStylePath () | |
| get syntax style path | |
| update () | |
| update object in db | |
| updateStyleParameter ($a_id, $a_value) | |
| getStyle () | |
| todo: bad style! should return array of objects, not multi-dim-arrays | |
| setStyle ($a_style) | |
| set styles | |
| getXML () | |
| get xml representation of style object | |
| exportXML ($a_dir) | |
| export style xml file to directory | |
| createFromXMLFile ($a_file) | |
| create style from xml file | |
| getAvailableTags () | |
| get all available tags in an array | |
| getAvailableParameters () | |
Data Fields | |
| $style | |
Definition at line 36 of file class.ilObjStyleSheet.php.
| ilObjStyleSheet::addParameter | ( | $ | a_tag, | |
| $ | a_par | |||
| ) |
write style parameter to db
| string | $a_tag tag name (tag.class, e.g. "p.Mnemonic") | |
| string | $a_par tag parameter (e.g. "margin-left") |
Definition at line 232 of file class.ilObjStyleSheet.php.
References $q, getAvailableParameters(), read(), and writeCSSFile().
{
$avail_params = $this->getAvailableParameters();
$tag = explode(".", $a_tag);
$value = $avail_params[$a_par][0];
$q = "INSERT INTO style_parameter (style_id, tag, class, parameter, value) VALUES ".
"('".$this->getId()."','".$tag[0]."','".$tag[1].
"','".$a_par."','".$value."')";
$this->ilias->db->query($q);
$this->read();
$this->writeCSSFile();
}
Here is the call graph for this function:| ilObjStyleSheet::assignMetaData | ( | &$ | a_meta_data | ) |
assign meta data object
Definition at line 83 of file class.ilObjStyleSheet.php.
{
$this->meta_data =& $a_meta_data;
}
| ilObjStyleSheet::create | ( | ) |
create
note: title, description and type should be set when this function is called
public
Reimplemented from ilObject.
Definition at line 96 of file class.ilObjStyleSheet.php.
References $q, read(), and writeCSSFile().
Referenced by createFromXMLFile().
{
parent::create();
$def = array(
array("tag" => "div", "class" => "PageTitle", "parameter" => "margin-top" ,"value" => "5px"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "margin-bottom" ,"value" => "20px"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "font-size" ,"value" => "23px"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "font-weight" ,"value" => "bold"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "padding-bottom" ,"value" => "3px"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "border-bottom-width" ,"value" => "1px"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "border-bottom-style" ,"value" => "solid"),
array("tag" => "div", "class" => "PageTitle", "parameter" => "border-color" ,"value" => "#000000"),
array("tag" => "span", "class" => "Strong", "parameter" => "font-weight" ,"value" => "bold"),
array("tag" => "span", "class" => "Emph", "parameter" => "font-style" ,"value" => "italic"),
array("tag" => "span", "class" => "Comment", "parameter" => "color" ,"value" => "green"),
array("tag" => "span", "class" => "Quotation", "parameter" => "color" ,"value" => "brown"),
array("tag" => "span", "class" => "Quotation", "parameter" => "font-style" ,"value" => "italic"),
array("tag" => "a", "class" => "FootnoteLink", "parameter" => "color" ,"value" => "blue"),
array("tag" => "a", "class" => "FootnoteLink", "parameter" => "font-weight" ,"value" => "normal"),
array("tag" => "a", "class" => "FootnoteLink:hover", "parameter" => "color" ,"value" => "#000000"),
array("tag" => "div", "class" => "Footnote", "parameter" => "margin-top" ,"value" => "5px"),
array("tag" => "div", "class" => "Footnote", "parameter" => "margin-bottom" ,"value" => "5px"),
array("tag" => "div", "class" => "Footnote", "parameter" => "font-style" ,"value" => "italic"),
array("tag" => "a", "class" => "IntLink", "parameter" => "color" ,"value" => "blue"),
array("tag" => "a", "class" => "IntLink:visited", "parameter" => "color" ,"value" => "blue"),
array("tag" => "a", "class" => "IntLink", "parameter" => "font-weight" ,"value" => "normal"),
array("tag" => "a", "class" => "IntLink", "parameter" => "text-decoration" ,"value" => "underline"),
array("tag" => "a", "class" => "IntLink:hover", "parameter" => "color" ,"value" => "#000000"),
array("tag" => "a", "class" => "ExtLink", "parameter" => "color" ,"value" => "blue"),
array("tag" => "a", "class" => "ExtLink:visited", "parameter" => "color" ,"value" => "blue"),
array("tag" => "a", "class" => "ExtLink", "parameter" => "font-weight" ,"value" => "normal"),
array("tag" => "a", "class" => "ExtLink", "parameter" => "text-decoration" ,"value" => "underline"),
array("tag" => "a", "class" => "ExtLink:hover", "parameter" => "color" ,"value" => "#000000"),
array("tag" => "div", "class" => "LMNavigation", "parameter" => "background-color" ,"value" => "#EEEEEE"),
array("tag" => "div", "class" => "LMNavigation", "parameter" => "border-style" ,"value" => "outset"),
array("tag" => "div", "class" => "LMNavigation", "parameter" => "border-color" ,"value" => "#EEEEEE"),
array("tag" => "div", "class" => "LMNavigation", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Page", "parameter" => "background-color" ,"value" => "#EEEEEE"),
array("tag" => "div", "class" => "Page", "parameter" => "padding" ,"value" => "0px"),
array("tag" => "div", "class" => "Page", "parameter" => "margin" ,"value" => "0px"),
array("tag" => "td", "class" => "Cell1", "parameter" => "background-color" ,"value" => "#FFCCCC"),
array("tag" => "td", "class" => "Cell2", "parameter" => "background-color" ,"value" => "#CCCCFF"),
array("tag" => "td", "class" => "Cell3", "parameter" => "background-color" ,"value" => "#CCFFCC"),
array("tag" => "td", "class" => "Cell4", "parameter" => "background-color" ,"value" => "#FFFFCC"),
array("tag" => "p", "class" => "Standard", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "p", "class" => "Standard", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "p", "class" => "List", "parameter" => "margin-top" ,"value" => "3px"),
array("tag" => "p", "class" => "List", "parameter" => "margin-bottom" ,"value" => "3px"),
array("tag" => "p", "class" => "Headline1", "parameter" => "margin-top" ,"value" => "15px"),
array("tag" => "p", "class" => "Headline1", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "p", "class" => "Headline1", "parameter" => "font-size" ,"value" => "22px"),
array("tag" => "p", "class" => "Headline1", "parameter" => "font-weight" ,"value" => "bold"),
array("tag" => "p", "class" => "Headline2", "parameter" => "margin-top" ,"value" => "15px"),
array("tag" => "p", "class" => "Headline2", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "p", "class" => "Headline2", "parameter" => "font-size" ,"value" => "18px"),
array("tag" => "p", "class" => "Headline2", "parameter" => "font-weight" ,"value" => "bold"),
array("tag" => "p", "class" => "Headline3", "parameter" => "margin-top" ,"value" => "15px"),
array("tag" => "p", "class" => "Headline3", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "p", "class" => "Headline3", "parameter" => "font-size" ,"value" => "14px"),
array("tag" => "p", "class" => "Headline3", "parameter" => "font-weight" ,"value" => "bold"),
array("tag" => "p", "class" => "Example", "parameter" => "padding-left" ,"value" => "20px"),
array("tag" => "p", "class" => "Example", "parameter" => "border-left" ,"value" => "3px"),
array("tag" => "p", "class" => "Example", "parameter" => "border-left-style" ,"value" => "solid"),
array("tag" => "p", "class" => "Example", "parameter" => "border-left-color" ,"value" => "blue"),
array("tag" => "p", "class" => "Citation", "parameter" => "color" ,"value" => "brown"),
array("tag" => "p", "class" => "Citation", "parameter" => "font-style" ,"value" => "italic"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "margin-left" ,"value" => "20px"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "margin-right" ,"value" => "20px"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "color" ,"value" => "red"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "border" ,"value" => "1px"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "p", "class" => "Mnemonic", "parameter" => "border-color" ,"value" => "red"),
array("tag" => "p", "class" => "Additional", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "p", "class" => "Additional", "parameter" => "border" ,"value" => "1px"),
array("tag" => "p", "class" => "Additional", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "p", "class" => "Additional", "parameter" => "border-color" ,"value" => "blue"),
array("tag" => "p", "class" => "Remark", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "p", "class" => "Remark", "parameter" => "border" ,"value" => "1px"),
array("tag" => "p", "class" => "Remark", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "p", "class" => "Remark", "parameter" => "border-color" ,"value" => "#909090"),
array("tag" => "p", "class" => "Remark", "parameter" => "background-color" ,"value" => "#D0D0D0"),
array("tag" => "p", "class" => "Remark", "parameter" => "text-align" ,"value" => "right"),
array("tag" => "p", "class" => "TableContent", "parameter" => "margin-left" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "margin-right" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "margin-top" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "margin-bottom" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "padding-left" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "padding-right" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "padding-top" ,"value" => "0px"),
array("tag" => "p", "class" => "TableContent", "parameter" => "padding-bottom" ,"value" => "0px"),
array("tag" => "table", "class" => "Media", "parameter" => "background-color" ,"value" => "#F5F5F5"),
array("tag" => "table", "class" => "Media", "parameter" => "padding" ,"value" => "0px"),
array("tag" => "table", "class" => "Media", "parameter" => "margin" ,"value" => "10px"),
array("tag" => "td", "class" => "MediaCaption", "parameter" => "padding" ,"value" => "5px")
);
// default style settings
foreach ($def as $sty)
{
$q = "INSERT INTO style_parameter (style_id, tag, class, parameter, value) VALUES ".
"('".$this->getId()."','".$sty["tag"]."','".$sty["class"].
"','".$sty["parameter"]."','".$sty["value"]."')";
$this->ilias->db->query($q);
}
$this->read();
$this->writeCSSFile();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjStyleSheet::createFromXMLFile | ( | $ | a_file | ) |
create style from xml file
Definition at line 522 of file class.ilObjStyleSheet.php.
References $q, $style, create(), read(), update(), and writeCSSFile().
{
parent::create();
include_once("classes/class.ilStyleImportParser.php");
$importParser = new ilStyleImportParser($a_file, $this);
$importParser->startParsing();
// store style parameter
foreach ($this->style as $style)
{
foreach($style as $tag)
{
$q = "INSERT INTO style_parameter (style_id, tag, class, parameter, value) VALUES ".
"('".$this->getId()."','".$tag["tag"]."','".$tag["class"].
"','".$tag["parameter"]."','".$tag["value"]."')";
$this->ilias->db->query($q);
}
}
$this->update();
$this->read();
$this->writeCSSFile();
}
Here is the call graph for this function:| ilObjStyleSheet::createReference | ( | ) |
creates reference for object
public
Reimplemented from ilObject.
Definition at line 75 of file class.ilObjStyleSheet.php.
{
$this->ilias->raiseError("Operation ilObjStyleSheet::createReference() not allowed.",$this->ilias->error_obj->FATAL);
}
| ilObjStyleSheet::delete | ( | ) |
delete style object
Reimplemented from ilObject.
Definition at line 260 of file class.ilObjStyleSheet.php.
References $q, ilObjContentObject::_deleteStyleAssignments(), ilObject::getId(), and ilUtil::getWebspaceDir().
{
global $ilDB;
// delete object
parent::delete();
// check whether this style is global default
$def_style = $this->ilias->getSetting("default_content_style_id");
if ($def_style == $this->getId())
{
$this->ilias->deleteSetting("default_content_style_id");
}
// check whether this style is global fixed
$fixed_style = $this->ilias->getSetting("fixed_content_style_id");
if ($fixed_style == $this->getId())
{
$this->ilias->deleteSetting("fixed_content_style_id");
}
// delete style parameter
$q = "DELETE FROM style_parameter WHERE style_id = ".$ilDB->quote($this->getId());
$ilDB->query($q);
// delete style file
$css_file_name = ilUtil::getWebspaceDir()."/css/style_".$this->getId().".css";
if (is_file($css_file_name))
{
unlink($css_file_name);
}
// delete entries in learning modules
include_once("content/classes/class.ilObjContentObject.php");
ilObjContentObject::_deleteStyleAssignments($this->getId());
}
Here is the call graph for this function:| ilObjStyleSheet::deleteParameter | ( | $ | a_id | ) |
delete style parameter
| int | $a_id style parameter id |
Definition at line 250 of file class.ilObjStyleSheet.php.
References $q.
| ilObjStyleSheet::exportXML | ( | $ | a_dir | ) |
export style xml file to directory
Definition at line 497 of file class.ilObjStyleSheet.php.
References $file, and getXML().
{
$file = $a_dir."/style.xml";
// open file
if (!($fp = @fopen($file,"w")))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
// set file permissions
chmod($file, 0770);
// write xml data into the file
fwrite($fp, $this->getXML());
// close file
fclose($fp);
}
Here is the call graph for this function:| ilObjStyleSheet::getAvailableParameters | ( | ) |
Definition at line 564 of file class.ilObjStyleSheet.php.
Referenced by addParameter().
{
$pars = array(
"font-family" => array(),
"font-style" => array("italic", "oblique", "normal"),
"font-variant" => array("small-caps", "normal"),
"font-weight" => array("bold", "normal", "bolder", "lighter"),
"font-stretch" => array("wider", "narrower", "condensed", "semi-condensed",
"extra-condensed", "ultra-condensed", "expanded", "semi-expanded",
"extra-expanded", "ultra-expanded", "normal"),
"word-spacing" => array(),
"letter-spacing" => array(),
"text-decoration" => array("underline", "overline", "line-through", "blink", "none"),
"text-transform" => array("capitalize", "uppercase", "lowercase", "none"),
"color" => array(),
"text-indent" => array(),
"line-height" => array(),
"vertical-align" => array("top", "middle", "bottom", "baseline", "sub", "super",
"text-top", "text-bottom"),
"text-align" => array("left", "center", "right", "justify"),
"white-space" => array("normal", "pre", "nowrap"),
"margin" => array(),
"margin-top" => array(),
"margin-bottom" => array(),
"margin-left" => array(),
"margin-right" => array(),
"padding" => array(),
"padding-top" => array(),
"padding-bottom" => array(),
"padding-left" => array(),
"padding-right" => array(),
"border-width" => array(),
"border-width-top" => array(),
"border-width-bottom" => array(),
"border-width-left" => array(),
"border-width-right" => array(),
"border-color" => array(),
"border-top-color" => array(),
"border-bottom-color" => array(),
"border-left-color" => array(),
"border-right-color" => array(),
"border-style" => array("none", "hidden", "dotted", "dashed", "solid", "double",
"groove", "ridge", "inset", "outset"),
"border-top-style" => array("none", "hidden", "dotted", "dashed", "solid", "double",
"groove", "ridge", "inset", "outset"),
"border-bottom-style" => array("none", "hidden", "dotted", "dashed", "solid", "double",
"groove", "ridge", "inset", "outset"),
"border-left-style" => array("none", "hidden", "dotted", "dashed", "solid", "double",
"groove", "ridge", "inset", "outset"),
"border-right-style" => array("none", "hidden", "dotted", "dashed", "solid", "double",
"groove", "ridge", "inset", "outset"),
"background-color" => array(),
"background-image" => array(),
"background-repeat" => array("repeat", "repeat-x", "repeat-y", "no-repeat"),
"background-attachment" => array("fixed", "scroll"),
"background-position" => array("top", "center", "middle", "bottom", "left", "right"),
"cursor" => array("auto", "default", "crosshair", "pointer", "move",
"n-resize", "ne-resize", "e-resize", "se-resize", "s-resize", "sw-resize",
"w-resize", "nw-resize", "text", "wait", "help"),
"clear" => array ("non","left","right","both")
);
return $pars;
}
Here is the caller graph for this function:| ilObjStyleSheet::getAvailableTags | ( | ) |
get all available tags in an array
Definition at line 548 of file class.ilObjStyleSheet.php.
{
$tags = array("a.FootnoteLink", "a.FootnoteLink:hover", "a.IntLink", "a.IntLink:hover",
"a.IntLink:visited", "a.IntLink:active",
"a.ExtLink", "a.ExtLink:hover", "a.ExtLink:visited", "a.ExtLink:active",
"div.Footnote", "div.LMNavigation", "div.Page", "div.PageTitle", "span.Comment",
"span.Emph", "span.Quotation", "span.Strong",
"td.Cell1", "td.Cell2", "td.Cell3", "td.Cell4",
"p.Standard", "p.List", "p.Headline1", "p.Headline2", "p.Headline3",
"p.Example", "p.Citation", "p.Mnemonic", "p.Additional", "p.Remark",
"p.TableContent",
"table.Media", "td.MediaCaption");
return $tags;
}
| ilObjStyleSheet::getContentPrintStyle | ( | ) |
get content print style
static
Definition at line 412 of file class.ilObjStyleSheet.php.
Referenced by ilLMPresentationGUI::showPrintView().
{
if (defined("ILIAS_MODULE"))
{
return "../content/print_content.css";
}
else
{
return "./content/print_content.css";
}
}
Here is the caller graph for this function:| ilObjStyleSheet::getContentStylePath | ( | $ | a_style_id | ) |
get content style path
static (to avoid full reading)
Definition at line 370 of file class.ilObjStyleSheet.php.
References ilObject::$ilias, and ilUtil::getWebspaceDir().
Referenced by ilObjGlossaryGUI::confirmDefinitionDeletion(), ilGlossaryTermGUI::confirmDefinitionDeletion(), ilPCParagraphGUI::edit(), ilTermDefinitionEditorGUI::executeCommand(), ilLMPresentationGUI::exportbibinfo(), ilLMPresentationGUI::ilGlossary(), ilLMPresentationGUI::ilMedia(), ilObjQuestionPoolGUI::ilObjQuestionPoolGUI(), ilLMPresentationGUI::ilPage(), ilPCParagraphGUI::insert(), ilGlossaryTermGUI::listDefinitions(), ilGlossaryPresentationGUI::listDefinitions(), ilLMEditorGUI::main_header(), ilGlossaryPresentationGUI::media(), ilLMPresentationGUI::offlineexport(), ilObjTestGUI::outEvaluationForm(), ilObjTestGUI::outWorkingForm(), ilObjDlBookGUI::showAbstract(), ilObjDlBookGUI::showCitation(), ilLMPresentationGUI::showDownloadList(), ilObjMediaPoolGUI::showMedia(), ilLMPresentationGUI::showNoPublicAccess(), ilLMPresentationGUI::showPreconditionsOfPage(), ilLMPresentationGUI::showPrintView(), ilLMPresentationGUI::showPrintViewSelection(), and ilLMPresentationGUI::showTableOfContents().
{
global $ilias;
$rand = rand(1,999999);
// check global fixed content style
$fixed_style = $ilias->getSetting("fixed_content_style_id");
if ($fixed_style > 0)
{
$a_style_id = $fixed_style;
}
// check global default style
if ($a_style_id <= 0)
{
$a_style_id = $ilias->getSetting("default_content_style_id");
}
if ($a_style_id > 0)
{
return ilUtil::getWebspaceDir("output").
"/css/style_".$a_style_id.".css?dummy=$rand";
}
else // todo: work this out
{
if (defined("ILIAS_MODULE"))
{
return "../content/content.css";
}
else
{
return "./content/content.css";
}
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilObjStyleSheet::getMetaData | ( | ) |
get meta data object
Definition at line 91 of file class.ilObjStyleSheet.php.
{
return $this->meta_data;
}
| ilObjStyleSheet::getRefId | ( | ) |
get reference id public
Reimplemented from ilObject.
Definition at line 64 of file class.ilObjStyleSheet.php.
{
return "";
//$this->ilias->raiseError("Operation ilObjStyleSheet::getRefId() not allowed.",$this->ilias->error_obj->FATAL);
}
| ilObjStyleSheet::getStyle | ( | ) |
todo: bad style! should return array of objects, not multi-dim-arrays
Definition at line 457 of file class.ilObjStyleSheet.php.
Referenced by writeCSSFile().
{
return $this->style;
}
Here is the caller graph for this function:| ilObjStyleSheet::getSyntaxStylePath | ( | ) |
get syntax style path
static
Definition at line 429 of file class.ilObjStyleSheet.php.
Referenced by ilObjGlossaryGUI::confirmDefinitionDeletion(), ilGlossaryTermGUI::confirmDefinitionDeletion(), ilTermDefinitionEditorGUI::executeCommand(), ilLMPresentationGUI::exportbibinfo(), ilLMPresentationGUI::ilGlossary(), ilObjQuestionPoolGUI::ilObjQuestionPoolGUI(), ilLMPresentationGUI::ilPage(), ilGlossaryTermGUI::listDefinitions(), ilGlossaryPresentationGUI::listDefinitions(), ilLMEditorGUI::main_header(), ilLMPresentationGUI::offlineexport(), ilObjTestGUI::outEvaluationForm(), ilObjTestGUI::outWorkingForm(), ilObjDlBookGUI::showAbstract(), ilObjDlBookGUI::showCitation(), and ilLMPresentationGUI::showPrintView().
{
if (defined("ILIAS_MODULE"))
{
return "../content/syntaxhighlight.css";
}
else
{
return "./content/syntaxhighlight.css";
}
}
Here is the caller graph for this function:| ilObjStyleSheet::getXML | ( | ) |
get xml representation of style object
Definition at line 474 of file class.ilObjStyleSheet.php.
Referenced by exportXML().
{
$xml.= "<StyleSheet>";
$xml.= "<Title>".$this->getTitle()."</Title>";
$xml.= "<Description>".$this->getDescription()."</Description>";
foreach($this->style as $style)
{
$xml.= "<Style Tag=\"".$style[0]["tag"]."\" Class=\"".$style[0]["class"]."\">";
foreach($style as $tag)
{
$xml.="<StyleParameter Name=\"".$tag["parameter"]."\" Value=\"".$tag["value"]."\"/>";
}
$xml.= "</Style>";
}
$xml.= "</StyleSheet>";
return $xml;
}
Here is the caller graph for this function:| ilObjStyleSheet::ilObjStyleSheet | ( | $ | a_id = 0, |
|
| $ | a_call_by_reference = false | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 47 of file class.ilObjStyleSheet.php.
References ilObject::ilObject().
{
$this->type = "sty";
$this->style = array();
if($a_call_by_reference)
{
$this->ilias->raiseError("Can't instantiate style object via reference id.",$this->ilias->error_obj->FATAL);
}
parent::ilObject($a_id, false);
}
Here is the call graph for this function:| ilObjStyleSheet::putInTree | ( | ) |
Definition at line 70 of file class.ilObjStyleSheet.php.
{
$this->ilias->raiseError("Operation ilObjStyleSheet::putInTree() not allowed.",$this->ilias->error_obj->FATAL);
}
| ilObjStyleSheet::read | ( | ) |
read style properties
Definition at line 302 of file class.ilObjStyleSheet.php.
References $q.
Referenced by addParameter(), create(), createFromXMLFile(), and update().
{
parent::read();
$q = "SELECT * FROM style_parameter WHERE style_id = '".$this->getId()."' ORDER BY tag, class ";
$style_set = $this->ilias->db->query($q);
$ctag = "";
$cclass = "";
$this->style = array();
while($style_rec = $style_set->fetchRow(DB_FETCHMODE_ASSOC))
{
if ($style_rec["tag"] != $ctag || $style_rec["class"] != $cclass)
{
// add current tag array to style array
if(is_array($tag))
{
$this->style[] = $tag;
}
$tag = array();
}
$ctag = $style_rec["tag"];
$cclass = $style_rec["class"];
$tag[] = $style_rec;
}
if(is_array($tag))
{
$this->style[] = $tag;
}
}
Here is the caller graph for this function:| ilObjStyleSheet::setRefId | ( | ) |
Definition at line 59 of file class.ilObjStyleSheet.php.
{
$this->ilias->raiseError("Operation ilObjStyleSheet::setRefId() not allowed.",$this->ilias->error_obj->FATAL);
}
| ilObjStyleSheet::setStyle | ( | $ | a_style | ) |
| ilObjStyleSheet::update | ( | ) |
update object in db
public
Reimplemented from ilObject.
Definition at line 441 of file class.ilObjStyleSheet.php.
References read(), and writeCSSFile().
Referenced by createFromXMLFile().
{
parent::update();
$this->read(); // this could be done better
$this->writeCSSFile();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjStyleSheet::updateStyleParameter | ( | $ | a_id, | |
| $ | a_value | |||
| ) |
Definition at line 448 of file class.ilObjStyleSheet.php.
References $q.
| ilObjStyleSheet::writeCSSFile | ( | $ | a_target_file = "" |
) |
write css file to webspace directory
Definition at line 335 of file class.ilObjStyleSheet.php.
References $style, ilObject::getId(), getStyle(), and ilUtil::getWebspaceDir().
Referenced by addParameter(), create(), createFromXMLFile(), and update().
{
$style = $this->getStyle();
if ($a_target_file == "")
{
$css_file_name = ilUtil::getWebspaceDir()."/css/style_".$this->getId().".css";
}
else
{
$css_file_name = $a_target_file;
}
$css_file = fopen($css_file_name, "w");
foreach ($style as $tag)
{
fwrite ($css_file, $tag[0]["tag"].".ilc_".$tag[0]["class"]."\n");
fwrite ($css_file, "{\n");
foreach($tag as $par)
{
fwrite ($css_file, "\t".$par["parameter"].": ".$par["value"].";\n");
}
fwrite ($css_file, "}\n");
fwrite ($css_file, "\n");
}
fclose($css_file);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjStyleSheet::$style |
Definition at line 38 of file class.ilObjStyleSheet.php.
Referenced by createFromXMLFile(), getXML(), and writeCSSFile().
1.7.1