26     public const SEQ_TEMPLATE_DIR = 
'./Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails';
    47         $this->db = $DIC->database();
    48         $ilDB = $DIC->database();
    52             $this->layout_id = 
$ilDB->nextId(
"page_layout");
    53             $ilDB->insert(
"page_layout", array(
    54                 "layout_id" => array(
"integer", $this->layout_id),
    55                 "active" => array(
"integer", 0),
    56                 "title" => array(
"text", 
""),
    57                 "content" => array(
"clob", 
""),
    58                 "description" => array(
"text", 
"")
    66             $this->active = 
false;
    68             $this->layout_id = $a_id;
    70         $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
    85         $this->description = $a_description;
    93     public function setTitle(
string $a_title): void
    95         $this->title = $a_title;
   120             $this->modules = array_intersect($a_values, 
$valid);
   122             $this->modules = array();
   135         bool $a_setting = 
true   139         $query = 
"UPDATE page_layout SET active=" . 
$ilDB->quote($a_setting, 
"integer") .
   140             " WHERE layout_id =" . 
$ilDB->quote($this->layout_id, 
"integer");
   141         $result = 
$ilDB->manipulate($query);
   147     public function delete(): 
void   151         $query = 
"DELETE FROM page_layout WHERE layout_id =" . 
$ilDB->quote($this->layout_id, 
"integer");
   152         $result = 
$ilDB->manipulate($query);
   162         $mod_scorm = $mod_portfolio = $mod_lm = 0;
   163         if (in_array(self::MODULE_SCORM, $this->modules)) {
   166         if (in_array(self::MODULE_PORTFOLIO, $this->modules)) {
   169         if (in_array(self::MODULE_LM, $this->modules)) {
   173         $query = 
"UPDATE page_layout SET title=" . 
$ilDB->quote($this->title, 
"text") .
   174             ",description =" . 
$ilDB->quote($this->description, 
"text") .
   175             ",active =" . 
$ilDB->quote($this->active, 
"integer") .
   176             ",mod_scorm =" . 
$ilDB->quote($mod_scorm, 
"integer") .
   177             ",mod_portfolio =" . 
$ilDB->quote($mod_portfolio, 
"integer") .
   178             ",mod_lm =" . 
$ilDB->quote($mod_lm, 
"integer") .
   179             " WHERE layout_id =" . 
$ilDB->quote($this->layout_id, 
"integer");
   181         $result = 
$ilDB->manipulate($query);
   187         $query = 
"SELECT * FROM page_layout WHERE layout_id =" . 
$ilDB->quote($this->layout_id, 
"integer");
   188         $result = 
$ilDB->query($query);
   189         $row = 
$ilDB->fetchAssoc($result);
   190         $this->title = (string) $row[
'title'];
   191         $this->description = (string) $row[
'description'];
   192         $this->active = (bool) $row[
'active'];
   195         if ($row[
"mod_scorm"]) {
   196             $mods[] = self::MODULE_SCORM;
   198         if ($row[
"mod_portfolio"]) {
   199             $mods[] = self::MODULE_PORTFOLIO;
   201         if ($row[
"mod_lm"]) {
   202             $mods[] = self::MODULE_LM;
   209         $this->xml_content = $content;
   214         if (!is_null($this->xml_content)) {
   218         return $layout_page->getXMLContent();
   224         return $layout_page->copyXmlContent(
true, 0, 0, $self_ass);
   234         return "./Services/COPage/Layout/xml/layout2html.xsl";
   240         $dom = $this->dom_util->docFromString($this->
getXMLContent(), $error);
   241         $path = 
"////PlaceHolder";
   242         $nodes = $this->dom_util->path($dom, 
$path);
   243         foreach ($nodes as $node) {
   244             $height = $node->getAttribute(
"Height");
   246             $height = str_ireplace(
"px", 
"", $height);
   247             $height = $height / 10;
   248             $node->setAttribute(
"Height", $height . 
"px");
   251         $xml = $this->dom_util->dump($dom->documentElement);
   252         $output = $this->
xslt($xml, []);
   260         $xslt = new \XSLTProcessor();
   261         $xsl = file_get_contents($this->
getXSLPath());
   262         $xslt_domdoc = new \DomDocument();
   263         $xslt_domdoc->loadXML($xsl);
   264         $xslt->importStylesheet($xslt_domdoc);
   265         foreach ($params as 
$key => $value) {
   266             $xslt->setParameter(
"", 
$key, (
string) $value);
   268         $xml_domdoc = new \DomDocument();
   269         $xml_domdoc->loadXML($xml);
   271         $result = $xslt->transformToXml($xml_domdoc);
   282         $ilDB = $DIC->database();
   283         $arr_layouts = array();
   285         if ($a_active != 0) {
   286             $add = 
"WHERE (active=1)";
   288         $query = 
"SELECT * FROM page_layout $add ORDER BY title ";
   289         $result = 
$ilDB->query($query);
   292                 $arr_layouts[] = $row;
   299         bool $a_active = 
false,
   304         $ilDB = $DIC->database();
   305         $arr_layouts = array();
   309             $add .= $conc . 
" (active = 1)";
   313             case self::MODULE_SCORM:
   314                 $add .= $conc . 
" mod_scorm = 1";
   317             case self::MODULE_PORTFOLIO:
   318                 $add .= $conc . 
" mod_portfolio = 1";
   321             case self::MODULE_LM:
   322                 $add .= $conc . 
" mod_lm = 1";
   325         $query = 
"SELECT layout_id FROM page_layout $add ORDER BY title ";
   326         $result = 
$ilDB->query($query);
   340         return self::getLayouts(
true, $a_module);
   346     public static function import(
   363         $lng = $DIC->language();
   366             self::MODULE_PORTFOLIO => 
$lng->txt(
"style_page_layout_module_portfolio"),
   367             self::MODULE_LM => 
$lng->txt(
"style_page_layout_module_learning_module")
 
setDescription(string $a_description)
 
ILIAS COPage Dom DomUtil $dom_util
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
setTitle(string $a_title)
 
setModules(array $a_values=[])
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
copyXmlContent(bool $self_ass=true)
 
static getLayoutsAsArray(int $a_active=0)
 
static activeLayouts(int $a_module=0)
Get active layouts. 
 
activate(bool $a_setting=true)
(De-)Activate layout 
 
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists. 
 
static getAvailableModules()
 
setXMLContent(string $content)
 
static getLayouts(bool $a_active=false, int $a_module=0)
 
xslt(string $xml, array $params)
 
update()
Update page layout.