◆ __construct()
ILIAS\Style\StyleManager::__construct |
( |
| ) |
|
Definition at line 31 of file StyleManager.php.
References $DIC.
35 $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
36 $this->db = $DIC->database();
◆ deleteStyleUsages()
ILIAS\Style\StyleManager::deleteStyleUsages |
( |
\ilPageObject |
$page, |
|
|
int |
$a_old_nr = 0 |
|
) |
| |
◆ saveStyleUsage()
ILIAS\Style\StyleManager::saveStyleUsage |
( |
\ilPageObject |
$page, |
|
|
\DOMDocument |
$a_domdoc, |
|
|
int |
$a_old_nr = 0 |
|
) |
| |
Save all style class/template usages.
Definition at line 42 of file StyleManager.php.
References $id, $path, ILIAS\Style\StyleManager\deleteStyleUsages(), ilPageObject\getId(), ilPageObject\getLanguage(), ilPageObject\getParentType(), and ilStr\subStr().
51 $path =
"//Paragraph | //Section | //MediaAlias | //FileItem" .
52 " | //Table | //TableData | //Tabs | //List";
54 $nodes = $this->dom_util->path($a_domdoc,
$path);
55 foreach ($nodes as $node) {
56 switch ($node->localName) {
58 $sname = $node->getAttribute(
"Characteristic");
59 $stype =
"text_block";
64 $sname = $node->getAttribute(
"Characteristic");
70 $sname = $node->getAttribute(
"Class");
71 $stype =
"media_cont";
76 $sname = $node->getAttribute(
"Class");
82 $sname = $node->getAttribute(
"Template");
84 $sname = $node->getAttribute(
"Class");
94 $sname = $node->getAttribute(
"Class");
95 $stype =
"table_cell";
100 $sname = $node->getAttribute(
"Template");
102 if ($node->getAttribute(
"Type") ==
"HorizontalAccordion") {
103 $stype =
"haccordion";
105 if ($node->getAttribute(
"Type") ==
"VerticalAccordion") {
106 $stype =
"vaccordion";
113 $sname = $node->getAttribute(
"Class");
114 if ($node->getAttribute(
"Type") ==
"Ordered") {
122 if ($sname !=
"" && $stype !=
"") {
123 $usages[$sname .
":" . $stype .
":" . $template] = array(
"sname" => $sname,
125 "template" => $template
132 foreach ($usages as $u) {
133 $id = $this->db->nextId(
'page_style_usage');
134 $this->db->manipulate(
"INSERT INTO page_style_usage " .
135 "(id, page_id, page_type, page_lang, page_nr, template, stype, sname) VALUES (" .
136 $this->db->quote(
$id,
"integer") .
"," .
137 $this->db->quote($page->getId(),
"integer") .
"," .
138 $this->db->quote($page->getParentType(),
"text") .
"," .
139 $this->db->quote($page->getLanguage(),
"text") .
"," .
140 $this->db->quote($a_old_nr,
"integer") .
"," .
141 $this->db->quote($u[
"template"],
"integer") .
"," .
142 $this->db->quote($u[
"stype"],
"text") .
"," .
143 $this->db->quote(\
ilStr::subStr($u[
"sname"], 0, 30),
"text") .
deleteStyleUsages(\ilPageObject $page, int $a_old_nr=0)
Delete style usages.
static subStr(string $a_str, int $a_start, ?int $a_length=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
◆ $db
◆ $dom_util
ILIAS COPage Dom DomUtil ILIAS\Style\StyleManager::$dom_util |
|
protected |
The documentation for this class was generated from the following file: