ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilContentStyleSettings Class Reference

Content style settings. More...

+ Collaboration diagram for ilContentStyleSettings:

Public Member Functions

 __construct ()
 Constructor. More...
 
 addStyle ($a_style_id)
 Add style to style folder. More...
 
 removeStyle ($a_id)
 remove Style from style list More...
 
 update ()
 update object data More...
 
 read ()
 read style folder data More...
 
 getStyles ()
 get style ids More...
 

Data Fields

 $styles = array()
 

Detailed Description

Content style settings.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilContentStyleSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilContentStyleSettings::__construct ( )

Constructor.

Definition at line 19 of file class.ilContentStyleSettings.php.

20 {
21 $this->read();
22 }

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ addStyle()

ilContentStyleSettings::addStyle (   $a_style_id)

Add style to style folder.

Parameters
int$a_style_idstyle id

Definition at line 29 of file class.ilContentStyleSettings.php.

30 {
31 $this->styles[$a_style_id] =
32 array("id" => $a_style_id,
33 "title" => ilObject::_lookupTitle($a_style_id));
34 }
static _lookupTitle($a_id)
lookup object title

References ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ getStyles()

ilContentStyleSettings::getStyles ( )

get style ids

Returns
array ids

Definition at line 100 of file class.ilContentStyleSettings.php.

References $styles.

◆ read()

ilContentStyleSettings::read ( )

read style folder data

Definition at line 73 of file class.ilContentStyleSettings.php.

74 {
75 global $ilDB;
76
77 // get styles of style folder
78 $q = "SELECT * FROM style_folder_styles JOIN style_data ON (style_id = style_data.id)";
79
80 $style_set = $ilDB->query($q);
81 $this->styles = array();
82 while ($style_rec = $ilDB->fetchAssoc($style_set))
83 {
84 $this->styles[$style_rec["style_id"]] =
85 array("id" => $style_rec["style_id"],
86 "title" => ilObject::_lookupTitle($style_rec["style_id"]),
87 "category" => $style_rec["category"]);
88 }
89
90 $this->styles =
91 ilUtil::sortArray($this->styles, "title", "asc", false, true);
92 }
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $ilDB

References $ilDB, ilObject\_lookupTitle(), and ilUtil\sortArray().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeStyle()

ilContentStyleSettings::removeStyle (   $a_id)

remove Style from style list

Definition at line 40 of file class.ilContentStyleSettings.php.

41 {
42 unset($this->styles[$a_id]);
43 }

◆ update()

ilContentStyleSettings::update ( )

update object data

Returns
boolean

Definition at line 51 of file class.ilContentStyleSettings.php.

52 {
53 global $ilDB;
54
55 // save styles of style folder
56 // note: there are no different style folders in ILIAS, only the one in the settings
57 $q = "DELETE FROM style_folder_styles";
58 $ilDB->manipulate($q);
59 foreach($this->styles as $style)
60 {
61 $q = "INSERT INTO style_folder_styles (folder_id, style_id) VALUES".
62 "(".$ilDB->quote((int) 0, "integer").", ".
63 $ilDB->quote((int) $style["id"], "integer").")";
64 $ilDB->manipulate($q);
65 }
66
67 return true;
68 }
$style
Definition: example_012.php:70

References $ilDB, and $style.

Field Documentation

◆ $styles

ilContentStyleSettings::$styles = array()

Definition at line 14 of file class.ilContentStyleSettings.php.

Referenced by getStyles().


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