ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjStyleSheet Class Reference

Class ilObjStyleSheet. More...

+ 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
 setUpToDate ($a_up_to_date=true)
 getUpToDate ()
 setScope ($a_scope)
 getScope ()
 _writeUpToDate ($a_id, $a_up_to_date)
 _lookupUpToDate ($a_id)
 _writeStandard ($a_id, $a_std)
 write standard flag
 _writeScope ($a_id, $a_scope)
 write standard flag
 _lookupStandard ($a_id)
 lookup standard flag
 _writeActive ($a_id, $a_active)
 write active flag
 _lookupActive ($a_id)
 lookup active flag
 _getStandardStyles ($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
 get standard styles
 _getClonableContentStyles ()
 get all clonable styles (active standard styles and individual learning module styles with write permission)
 assignMetaData (&$a_meta_data)
 assign meta data object
getMetaData ()
 get meta data object
 create ($a_from_style=0)
 ilClone ()
 clone style sheet (note: styles have no ref ids and return an object id)
 addParameter ($a_tag, $a_par)
 write style parameter to db
 deleteParameter ($a_id)
 delete style parameter
 deleteStylePar ($a_tag, $a_class, $a_par)
 delete style parameter by tag/class/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)
 update style parameter per id
 replaceStylePar ($a_tag, $a_class, $a_par, $a_val)
 update style parameter per tag/class/parameter
 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 ()
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 read ($a_force_db=false)
 read object data from db into object
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 _lookupObjIdByImportId ($a_import_id)
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _getAllReferences ($a_id)
 get all reference ids of object
 _lookupTitle ($a_id)
 lookup object title
 _lookupDescription ($a_id)
 lookup object description
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _lookupObjId ($a_id)
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _lookupType ($a_id, $a_reference=false)
 lookup object type
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _lookupObjectId ($a_ref_id)
 lookup object id
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 countReferences ()
 count references of object
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public
 createRoleFolder ()
 creates a local role folder
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts.
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone object permissions, put in tree ...
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies.
 cloneMetaData ($target_obj)
 Copy meta data.

Data Fields

 $style
- Data Fields inherited from ilObject
 $ilias
 $lng
 $id
 $ref_id
 $type
 $title
 $untranslatedTitle
 $desc
 $long_desc
 $owner
 $create_date
 $last_update
 $import_id
 $register = false
 $referenced
 $objectList
 $max_title
 $max_desc
 $add_dots
 $obj_data_record
 object_data record

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _getIdsForTitle ($title, $type= '')
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)

Detailed Description

Class ilObjStyleSheet.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Id:
class.ilObjStyleSheet.php 17181 2008-08-19 16:51:07Z akill

Definition at line 35 of file class.ilObjStyleSheet.php.

Member Function Documentation

ilObjStyleSheet::_getClonableContentStyles ( )

get all clonable styles (active standard styles and individual learning module styles with write permission)

Definition at line 239 of file class.ilObjStyleSheet.php.

References ilObject\$id, ilObject\$ref_id, ilObject\_getAllReferences(), ilObjContentObject\_lookupContObjIdByStyleId(), and DB_FETCHMODE_ASSOC.

Referenced by ilObjStyleSheetGUI\createObject().

{
global $ilAccess, $ilDB;
$clonable_styles = array();
$q = "SELECT * FROM style_data, object_data ".
" WHERE object_data.obj_id = style_data.id ";
$style_set = $ilDB->query($q);
while($style_rec = $style_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$clonable = false;
if ($style_rec["standard"] == 1)
{
if ($style_rec["active"] == 1)
{
$clonable = true;
}
}
else
{
include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
$obj_ids = ilObjContentObject::_lookupContObjIdByStyleId($style_rec["id"]);
foreach($obj_ids as $id)
{
foreach($ref as $ref_id)
{
if ($ilAccess->checkAccess("write", "", $ref_id))
{
$clonable = true;
}
}
}
}
if ($clonable)
{
$clonable_styles[$style_rec["id"]] =
$style_rec["title"];
}
}
return $clonable_styles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheet::_getStandardStyles (   $a_exclude_default_style = false,
  $a_include_deactivated = false,
  $a_scope = 0 
)

get standard styles

Definition at line 192 of file class.ilObjStyleSheet.php.

References ilObject\$ilias, $res, ilObject\_lookupTitle(), and DB_FETCHMODE_ASSOC.

Referenced by ilObjContentObjectGUI\properties().

{
global $ilDB, $ilias, $tree;
$default_style = $ilias->getSetting("default_content_style_id");
$and_str = "";
if (!$a_include_deactivated)
{
$and_str = " AND active = 1";
}
$q = "SELECT * FROM style_data ".
" WHERE standard = 1".$and_str;
$res = $ilDB->query($q);
$styles = array();
while($sty = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
if (!$a_exclude_default_style || $default_style != $sty["id"])
{
// check scope
if ($a_scope > 0 && $sty["category"] > 0)
{
if ($tree->isInTree($sty["category"]) &&
$tree->isInTree($a_scope))
{
$path = $tree->getPathId($a_scope);
if (!in_array($sty["category"], $path))
{
continue;
}
}
}
$styles[$sty["id"]] = ilObject::_lookupTitle($sty["id"]);
}
}
return $styles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheet::_lookupActive (   $a_id)

lookup active flag

Definition at line 177 of file class.ilObjStyleSheet.php.

References $res, and DB_FETCHMODE_ASSOC.

Referenced by ilObjStyleSettingsGUI\editContentStylesObject().

{
global $ilDB;
$q = "SELECT * FROM style_data ".
" WHERE id = ".$ilDB->quote($a_id);
$res = $ilDB->query($q);
$sty = $res->fetchRow(DB_FETCHMODE_ASSOC);
return (boolean) $sty["active"];
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_lookupStandard (   $a_id)

lookup standard flag

Definition at line 150 of file class.ilObjStyleSheet.php.

References $res, and DB_FETCHMODE_ASSOC.

Referenced by ilObjContentObjectGUI\properties(), and ilObjContentObjectGUI\saveProperties().

{
global $ilDB;
$q = "SELECT * FROM style_data ".
" WHERE id = ".$ilDB->quote($a_id);
$res = $ilDB->query($q);
$sty = $res->fetchRow(DB_FETCHMODE_ASSOC);
return (boolean) $sty["standard"];
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_lookupUpToDate (   $a_id)

Definition at line 111 of file class.ilObjStyleSheet.php.

References $res, and DB_FETCHMODE_ASSOC.

Referenced by getContentStylePath().

{
global $ilDB;
$q = "SELECT * FROM style_data ".
" WHERE id = ".$ilDB->quote($a_id);
$res = $ilDB->query($q);
$sty = $res->fetchRow(DB_FETCHMODE_ASSOC);
return (boolean) $sty["uptodate"];
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_writeActive (   $a_id,
  $a_active 
)

write active flag

Definition at line 165 of file class.ilObjStyleSheet.php.

Referenced by ilObjStyleSettingsGUI\saveActiveStylesObject().

{
global $ilDB;
$q = "UPDATE style_data SET active = ".$ilDB->quote((int) $a_active).
" WHERE id = ".$ilDB->quote($a_id);
$ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_writeScope (   $a_id,
  $a_scope 
)

write standard flag

Definition at line 138 of file class.ilObjStyleSheet.php.

Referenced by ilObjStyleSettingsGUI\saveScopeObject().

{
global $ilDB;
$q = "UPDATE style_data SET category = ".$ilDB->quote((int) $a_scope).
" WHERE id = ".$ilDB->quote($a_id);
$ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_writeStandard (   $a_id,
  $a_std 
)

write standard flag

Definition at line 126 of file class.ilObjStyleSheet.php.

Referenced by ilObjStyleSheetGUI\copyStyleObject(), ilObjStyleSheetGUI\importStyleObject(), and ilObjStyleSheetGUI\saveObject().

{
global $ilDB;
$q = "UPDATE style_data SET standard = ".$ilDB->quote((int) $a_std).
" WHERE id = ".$ilDB->quote($a_id);
$ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjStyleSheet::_writeUpToDate (   $a_id,
  $a_up_to_date 
)

Definition at line 99 of file class.ilObjStyleSheet.php.

Referenced by writeCSSFile().

{
global $ilDB;
$q = "UPDATE style_data SET uptodate = ".$ilDB->quote((int) $a_up_to_date).
" WHERE id = ".$ilDB->quote($a_id);
$ilDB->query($q);
}

+ Here is the caller graph for this function:

ilObjStyleSheet::addParameter (   $a_tag,
  $a_par 
)

write style parameter to db

Parameters
string$a_tagtag name (tag.class, e.g. "div.Mnemonic")
string$a_partag parameter (e.g. "margin-left")

Definition at line 517 of file class.ilObjStyleSheet.php.

References getAvailableParameters(), ilObject\getId(), read(), and writeCSSFile().

{
global $ilDB;
$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 ".
"(".$ilDB->quote($this->getId()).",".$ilDB->quote($tag[0]).",".
$ilDB->quote($tag[1]).
",".$ilDB->quote($a_par).",".$ilDB->quote($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 286 of file class.ilObjStyleSheet.php.

{
$this->meta_data =& $a_meta_data;
}
ilObjStyleSheet::create (   $a_from_style = 0)

Definition at line 299 of file class.ilObjStyleSheet.php.

References ilObject\create(), DB_FETCHMODE_ASSOC, ilObject\getId(), getScope(), read(), and writeCSSFile().

{
global $ilDB;
if ($a_from_style == 0)
{
$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" => "140%"),
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" => "#FFFFFF"),
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" => "div", "class" => "Standard", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Standard", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "List", "parameter" => "margin-top" ,"value" => "3px"),
array("tag" => "div", "class" => "List", "parameter" => "margin-bottom" ,"value" => "3px"),
array("tag" => "div", "class" => "Headline1", "parameter" => "margin-top" ,"value" => "20px"),
array("tag" => "div", "class" => "Headline1", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Headline1", "parameter" => "font-size" ,"value" => "140%"),
array("tag" => "div", "class" => "Headline2", "parameter" => "margin-top" ,"value" => "20px"),
array("tag" => "div", "class" => "Headline2", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Headline2", "parameter" => "font-size" ,"value" => "130%"),
array("tag" => "div", "class" => "Headline3", "parameter" => "margin-top" ,"value" => "20px"),
array("tag" => "div", "class" => "Headline3", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Headline3", "parameter" => "font-size" ,"value" => "120%"),
array("tag" => "div", "class" => "Example", "parameter" => "padding-left" ,"value" => "20px"),
array("tag" => "div", "class" => "Example", "parameter" => "border-left-width" ,"value" => "3px"),
array("tag" => "div", "class" => "Example", "parameter" => "border-left-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Example", "parameter" => "border-left-color" ,"value" => "blue"),
array("tag" => "div", "class" => "Example", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Example", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Citation", "parameter" => "color" ,"value" => "brown"),
array("tag" => "div", "class" => "Citation", "parameter" => "font-style" ,"value" => "italic"),
array("tag" => "div", "class" => "Citation", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Citation", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "margin-left" ,"value" => "20px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "margin-right" ,"value" => "20px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "border-width" ,"value" => "2px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "border-color" ,"value" => "red"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Mnemonic", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Additional", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "div", "class" => "Additional", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Additional", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Additional", "parameter" => "border-color" ,"value" => "blue"),
array("tag" => "div", "class" => "Additional", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Additional", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Remark", "parameter" => "padding" ,"value" => "10px"),
array("tag" => "div", "class" => "Remark", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Remark", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Remark", "parameter" => "border-color" ,"value" => "#909090"),
array("tag" => "div", "class" => "Remark", "parameter" => "background-color" ,"value" => "#D0D0D0"),
array("tag" => "div", "class" => "Remark", "parameter" => "text-align" ,"value" => "center"),
array("tag" => "div", "class" => "Remark", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Remark", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Block", "parameter" => "padding-left" ,"value" => "10px"),
array("tag" => "div", "class" => "Block", "parameter" => "padding-right" ,"value" => "10px"),
array("tag" => "div", "class" => "Block", "parameter" => "padding-top" ,"value" => "5px"),
array("tag" => "div", "class" => "Block", "parameter" => "padding-bottom" ,"value" => "5px"),
array("tag" => "div", "class" => "Block", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Block", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Block", "parameter" => "border-color" ,"value" => "#A0A0A0"),
array("tag" => "div", "class" => "Block", "parameter" => "background-color" ,"value" => "#FFFFFF"),
array("tag" => "div", "class" => "Block", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Block", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Special", "parameter" => "padding-left" ,"value" => "10px"),
array("tag" => "div", "class" => "Special", "parameter" => "padding-right" ,"value" => "10px"),
array("tag" => "div", "class" => "Special", "parameter" => "padding-top" ,"value" => "5px"),
array("tag" => "div", "class" => "Special", "parameter" => "padding-bottom" ,"value" => "5px"),
array("tag" => "div", "class" => "Special", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Special", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Special", "parameter" => "border-color" ,"value" => "#A0A0A0"),
array("tag" => "div", "class" => "Special", "parameter" => "background-color" ,"value" => "#FFF7F7"),
array("tag" => "div", "class" => "Special", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Special", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "padding-left" ,"value" => "10px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "padding-right" ,"value" => "10px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "padding-top" ,"value" => "5px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "padding-bottom" ,"value" => "5px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "border-width" ,"value" => "1px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "border-style" ,"value" => "solid"),
array("tag" => "div", "class" => "Excursus", "parameter" => "border-color" ,"value" => "#A0A0A0"),
array("tag" => "div", "class" => "Excursus", "parameter" => "background-color" ,"value" => "#F7FFF7"),
array("tag" => "div", "class" => "Excursus", "parameter" => "margin-top" ,"value" => "10px"),
array("tag" => "div", "class" => "Excursus", "parameter" => "margin-bottom" ,"value" => "10px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "margin-left" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "margin-right" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "margin-top" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "margin-bottom" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "padding-left" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "padding-right" ,"value" => "0px"),
array("tag" => "div", "class" => "TableContent", "parameter" => "padding-top" ,"value" => "0px"),
array("tag" => "div", "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")
);
}
else
{
$def = array();
$q = "SELECT * FROM style_parameter WHERE style_id = ".$ilDB->quote($a_from_style);
$par_set = $ilDB->query($q);
while($par_rec = $par_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$def[] = array("tag" => $par_rec["tag"], "class" => $par_rec["class"],
"parameter" => $par_rec["parameter"] ,"value" => $par_rec["value"]);
}
}
// default style settings
foreach ($def as $sty)
{
$q = "INSERT INTO style_parameter (style_id, tag, class, parameter, value) VALUES ".
"(".$ilDB->quote($this->getId()).",".
$ilDB->quote($sty["tag"]).",".
$ilDB->quote($sty["class"]).",".
$ilDB->quote($sty["parameter"]).",".
$ilDB->quote($sty["value"]).")";
$ilDB->query($q);
}
// add style_data record
$q = "INSERT INTO style_data (id, uptodate, category) VALUES ".
"(".$ilDB->quote($this->getId()).", 0,".
$ilDB->quote($this->getScope()).")";
$ilDB->query($q);
$this->read();
$this->writeCSSFile();
}

+ Here is the call graph for this function:

ilObjStyleSheet::createFromXMLFile (   $a_file)

create style from xml file

Definition at line 906 of file class.ilObjStyleSheet.php.

References $style, ilObject\create(), ilObject\getId(), read(), update(), and writeCSSFile().

{
global $ilDB;
include_once("./Services/Style/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 ".
"(".$ilDB->quote($this->getId()).",".
$ilDB->quote($tag["tag"]).",".
$ilDB->quote($tag["class"]).
",".$ilDB->quote($tag["parameter"]).",".
$ilDB->quote($tag["value"]).")";
$this->ilias->db->query($q);
}
}
// add style_data record
$q = "INSERT INTO style_data (id, uptodate) VALUES ".
"(".$ilDB->quote($this->getId()).", 0)";
$ilDB->query($q);
$this->update();
$this->read();
$this->writeCSSFile();
}

+ Here is the call graph for this function:

ilObjStyleSheet::createReference ( )

creates reference for object

public

Returns
integer reference_id of object

Reimplemented from ilObject.

Definition at line 74 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 566 of file class.ilObjStyleSheet.php.

References ilObjContentObject\_deleteStyleAssignments(), ilObject\getId(), and ilUtil\getWebspaceDir().

{
global $ilDB;
// delete object
// 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("./Modules/LearningModule/classes/class.ilObjContentObject.php");
// delete style data record
$q = "DELETE FROM style_data WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($q);
}

+ Here is the call graph for this function:

ilObjStyleSheet::deleteParameter (   $a_id)

delete style parameter

Parameters
int$a_idstyle parameter id

Definition at line 538 of file class.ilObjStyleSheet.php.

{
global $ilDB;
$q = "DELETE FROM style_parameter WHERE id = ".$ilDB->quote($a_id);
$this->ilias->db->query($q);
}
ilObjStyleSheet::deleteStylePar (   $a_tag,
  $a_class,
  $a_par 
)

delete style parameter by tag/class/parameter

Definition at line 550 of file class.ilObjStyleSheet.php.

References ilObject\getId().

{
global $ilDB;
$q = "DELETE FROM style_parameter WHERE ".
" style_id = ".$ilDB->quote($this->getId())." AND ".
" tag = ".$ilDB->quote($a_tag)." AND ".
" class = ".$ilDB->quote($a_class)." AND ".
" parameter = ".$ilDB->quote($a_par);
$this->ilias->db->query($q);
}

+ Here is the call graph for this function:

ilObjStyleSheet::exportXML (   $a_dir)

export style xml file to directory

Definition at line 881 of file class.ilObjStyleSheet.php.

References $file, and getXML().

Referenced by ilContObjectExport\buildExportFileXML().

{
$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:

+ Here is the caller graph for this function:

ilObjStyleSheet::getAvailableParameters ( )

Definition at line 960 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"),
"font-size" => array(),
"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-top-width" => array(),
"border-bottom-width" => array(),
"border-left-width" => array(),
"border-right-width" => 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 943 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",
"div.Standard", "div.List", "div.Headline1", "div.Headline2", "div.Headline3",
"div.Example", "div.Citation", "div.Mnemonic", "div.Additional", "div.Remark",
"div.Block", "div.Special", "div.Excursus",
"div.TableContent",
"table.Media", "td.MediaCaption");
return $tags;
}
ilObjStyleSheet::getContentPrintStyle ( )

get content print style

static

Definition at line 753 of file class.ilObjStyleSheet.php.

Referenced by ilObjWikiGUI\printViewObject(), and ilLMPresentationGUI\showPrintView().

{
return "./Services/COPage/css/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 710 of file class.ilObjStyleSheet.php.

References ilObject\$ilias, $style, ilObject\_exists(), _lookupUpToDate(), ilUtil\getWebspaceDir(), and ilObjStyleSheet().

Referenced by ilWikiPageGUI\__construct(), ilGlossaryTermGUI\confirmDefinitionDeletion(), ilObjGlossaryGUI\confirmDefinitionDeletion(), ilPageObjectGUI\displayMediaFullscreen(), ilObjGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), ilTermDefinitionEditorGUI\executeCommand(), ilObjQuestionPoolGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), ilLMPresentationGUI\exportbibinfo(), ilPaymentObjectGUI\forwardToPageObject(), ilContainerGUI\forwardToPageObject(), ilShopGUI\forwardToPageObject(), ilObjPaymentSettingsGUI\forwardToPageObject(), ilContainerGUI\getContainerPageHTML(), ilShopGUI\getPageHTML(), ilLMPresentationGUI\ilGlossary(), ilLMPresentationGUI\ilMedia(), ilLMPresentationGUI\ilPage(), ilGlossaryTermGUI\listDefinitions(), ilGlossaryPresentationGUI\listDefinitions(), ilLMEditorGUI\main_header(), ilGlossaryPresentationGUI\media(), ilLMPresentationGUI\offlineexport(), ilTestEvaluationGUI\outCorrectSolution(), ilTestOutputGUI\outCorrectSolution(), ilTestOutputGUI\outWorkingForm(), ilObjWikiGUI\printViewObject(), ilPCParagraphGUI\setStyle(), 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 && ilObject::_exists($a_style_id))
{
// check whether file is up to date
{
$style = new ilObjStyleSheet($a_style_id);
$style->writeCSSFile();
}
return ilUtil::getWebspaceDir("output").
"/css/style_".$a_style_id.".css?dummy=$rand";
}
else // todo: work this out
{
return "./Services/COPage/css/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 294 of file class.ilObjStyleSheet.php.

{
return $this->meta_data;
}
ilObjStyleSheet::getRefId ( )

get reference id public

Returns
integer reference id

Reimplemented from ilObject.

Definition at line 63 of file class.ilObjStyleSheet.php.

{
return "";
//$this->ilias->raiseError("Operation ilObjStyleSheet::getRefId() not allowed.",$this->ilias->error_obj->FATAL);
}
ilObjStyleSheet::getScope ( )

Definition at line 94 of file class.ilObjStyleSheet.php.

Referenced by create(), and update().

{
return $this->scope;
}

+ Here is the caller graph for this function:

ilObjStyleSheet::getStyle ( )

todo: bad style! should return array of objects, not multi-dim-arrays

Definition at line 841 of file class.ilObjStyleSheet.php.

References $style.

Referenced by writeCSSFile().

{
return $this->style;
}

+ Here is the caller graph for this function:

ilObjStyleSheet::getUpToDate ( )

Definition at line 84 of file class.ilObjStyleSheet.php.

{
return $this->up_to_date;
}
ilObjStyleSheet::getXML ( )

get xml representation of style object

Definition at line 858 of file class.ilObjStyleSheet.php.

References $style.

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::ilClone ( )

clone style sheet (note: styles have no ref ids and return an object id)

public

Returns
integer new obj id

Definition at line 497 of file class.ilObjStyleSheet.php.

References $log, ilObject\getDescription(), ilObject\getId(), ilObject\getTitle(), ilObject\getType(), and ilObjStyleSheet().

{
global $log;
$new_obj = new ilObjStyleSheet();
$new_obj->setTitle($this->getTitle());
$new_obj->setType($this->getType());
$new_obj->setDescription($this->getDescription());
$new_obj->create($this->getId());
return $new_obj->getId();
}

+ Here is the call graph for this function:

ilObjStyleSheet::ilObjStyleSheet (   $a_id = 0,
  $a_call_by_reference = false 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 46 of file class.ilObjStyleSheet.php.

References ilObject\ilObject().

Referenced by getContentStylePath(), and ilClone().

{
$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:

+ Here is the caller graph for this function:

ilObjStyleSheet::putInTree ( )

Definition at line 69 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 612 of file class.ilObjStyleSheet.php.

References $res, DB_FETCHMODE_ASSOC, ilObject\getId(), setScope(), and setUpToDate().

Referenced by addParameter(), create(), createFromXMLFile(), and update().

{
global $ilDB;
$q = "SELECT * FROM style_parameter WHERE style_id = ".
$ilDB->quote($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;
}
$q = "SELECT * FROM style_data WHERE id = ".$ilDB->quote($this->getId());
$res = $ilDB->query($q);
$sty = $res->fetchRow(DB_FETCHMODE_ASSOC);
$this->setUpToDate((boolean) $sty["uptodate"]);
$this->setScope($sty["category"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheet::replaceStylePar (   $a_tag,
  $a_class,
  $a_par,
  $a_val 
)

update style parameter per tag/class/parameter

Definition at line 801 of file class.ilObjStyleSheet.php.

References ilObject\getId().

{
global $ilDB;
$q = "SELECT * FROM style_parameter WHERE ".
" style_id = ".$ilDB->quote($this->getId())." AND ".
" tag = ".$ilDB->quote($a_tag)." AND ".
" class = ".$ilDB->quote($a_class)." AND ".
" parameter = ".$ilDB->quote($a_par);
$set = $ilDB->query($q);
if ($rec = $set->fetchRow())
{
$q = "UPDATE style_parameter SET ".
" value = ".$ilDB->quote($a_val)." WHERE ".
" style_id = ".$ilDB->quote($this->getId())." AND ".
" tag = ".$ilDB->quote($a_tag)." AND ".
" class = ".$ilDB->quote($a_class)." AND ".
" parameter = ".$ilDB->quote($a_par);
$ilDB->query($q);
}
else
{
$q = "INSERT INTO style_parameter (value, style_id, tag, class, parameter) VALUES ".
" (".$ilDB->quote($a_val).",".
" ".$ilDB->quote($this->getId()).",".
" ".$ilDB->quote($a_tag).",".
" ".$ilDB->quote($a_class).",".
" ".$ilDB->quote($a_par).")";
$ilDB->query($q);
}
}

+ Here is the call graph for this function:

ilObjStyleSheet::setRefId ( )

Definition at line 58 of file class.ilObjStyleSheet.php.

{
$this->ilias->raiseError("Operation ilObjStyleSheet::setRefId() not allowed.",$this->ilias->error_obj->FATAL);
}
ilObjStyleSheet::setScope (   $a_scope)

Definition at line 89 of file class.ilObjStyleSheet.php.

Referenced by read().

{
$this->scope = $a_scope;
}

+ Here is the caller graph for this function:

ilObjStyleSheet::setStyle (   $a_style)

set styles

Definition at line 849 of file class.ilObjStyleSheet.php.

{
$this->style = $a_style;
}
ilObjStyleSheet::setUpToDate (   $a_up_to_date = true)

Definition at line 79 of file class.ilObjStyleSheet.php.

Referenced by read(), and writeCSSFile().

{
$this->up_to_date = $a_up_to_date;
}

+ Here is the caller graph for this function:

ilObjStyleSheet::update ( )

update object in db

public

Returns
boolean true on success

Reimplemented from ilObject.

Definition at line 768 of file class.ilObjStyleSheet.php.

References getScope(), read(), and writeCSSFile().

Referenced by createFromXMLFile().

{
global $ilDB;
$this->read(); // this could be done better
$this->writeCSSFile();
$q = "UPDATE style_data ".
"SET category = ".$ilDB->quote($this->getScope());
$ilDB->query($q);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheet::updateStyleParameter (   $a_id,
  $a_value 
)

update style parameter per id

Parameters
int$a_idstyle parameter id
int$a_idstyle parameter value

Definition at line 787 of file class.ilObjStyleSheet.php.

{
global $ilDB;
$q = "UPDATE style_parameter SET VALUE=".
$ilDB->quote($a_value)." WHERE id = ".
$ilDB->quote($a_id);
$style_set = $this->ilias->db->query($q);
}
ilObjStyleSheet::writeCSSFile (   $a_target_file = "")

write css file to webspace directory

Definition at line 655 of file class.ilObjStyleSheet.php.

References $style, _writeUpToDate(), ilObject\getId(), getStyle(), ilUtil\getWebspaceDir(), and setUpToDate().

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");
$page_background = "";
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");
// save page background
if ($tag[0]["tag"] == "div" && $tag[0]["class"] == "Page"
&& $par["parameter"] == "background-color")
{
$page_background = $par["value"];
}
}
fwrite ($css_file, "}\n");
fwrite ($css_file, "\n");
}
if ($page_background != "")
{
fwrite ($css_file, "td.ilc_Page\n");
fwrite ($css_file, "{\n");
fwrite ($css_file, "\t"."background-color: ".$page_background.";\n");
fwrite ($css_file, "}\n");
}
fclose($css_file);
$this->setUpToDate(true);
$this->_writeUpToDate($this->getId(), true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjStyleSheet::$style

The documentation for this class was generated from the following file: