26 public const SEQ_TEMPLATE_DIR =
'./Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails';
45 $this->db = $DIC->database();
46 $ilDB = $DIC->database();
50 $this->layout_id =
$ilDB->nextId(
"page_layout");
51 $ilDB->insert(
"page_layout", array(
52 "layout_id" => array(
"integer", $this->layout_id),
53 "active" => array(
"integer", 0),
54 "title" => array(
"text",
""),
55 "content" => array(
"clob",
""),
56 "description" => array(
"text",
"")
64 $this->active =
false;
66 $this->layout_id = $a_id;
82 $this->description = $a_description;
90 public function setTitle(
string $a_title): void
92 $this->title = $a_title;
117 $this->modules = array_intersect($a_values,
$valid);
119 $this->modules = array();
132 bool $a_setting =
true 136 $query =
"UPDATE page_layout SET active=" .
$ilDB->quote($a_setting,
"integer") .
137 " WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
144 public function delete():
void 148 $query =
"DELETE FROM page_layout WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
159 $mod_scorm = $mod_portfolio = $mod_lm = 0;
160 if (in_array(self::MODULE_SCORM, $this->modules)) {
163 if (in_array(self::MODULE_PORTFOLIO, $this->modules)) {
166 if (in_array(self::MODULE_LM, $this->modules)) {
170 $query =
"UPDATE page_layout SET title=" .
$ilDB->quote($this->title,
"text") .
171 ",description =" .
$ilDB->quote($this->description,
"text") .
172 ",active =" .
$ilDB->quote($this->active,
"integer") .
173 ",mod_scorm =" .
$ilDB->quote($mod_scorm,
"integer") .
174 ",mod_portfolio =" .
$ilDB->quote($mod_portfolio,
"integer") .
175 ",mod_lm =" .
$ilDB->quote($mod_lm,
"integer") .
176 " WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
184 $query =
"SELECT * FROM page_layout WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
186 $row =
$ilDB->fetchAssoc($result);
187 $this->title = (string) $row[
'title'];
188 $this->description = (string) $row[
'description'];
189 $this->active = (bool) $row[
'active'];
192 if ($row[
"mod_scorm"]) {
193 $mods[] = self::MODULE_SCORM;
195 if ($row[
"mod_portfolio"]) {
196 $mods[] = self::MODULE_PORTFOLIO;
198 if ($row[
"mod_lm"]) {
199 $mods[] = self::MODULE_LM;
207 return $layout_page->getXMLContent();
213 return $layout_page->copyXmlContent(
true, 0, 0, $self_ass);
223 return "./Services/COPage/Layout/xml/layout2html.xsl";
232 $path =
"////PlaceHolder";
235 foreach (
$res->nodeset as $item) {
236 $height = $item->get_attribute(
"Height");
238 $height = str_ireplace(
"px",
"", $height);
239 $height = $height / 10;
240 $item->set_attribute(
"Height", $height .
"px");
242 $xsl = file_get_contents($this->
getXSLPath());
244 $xml = $dom->dump_mem(0,
"UTF-8");
246 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
249 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args, null);
260 $ilDB = $DIC->database();
261 $arr_layouts = array();
263 if ($a_active != 0) {
264 $add =
"WHERE (active=1)";
266 $query =
"SELECT * FROM page_layout $add ORDER BY title ";
270 $arr_layouts[] = $row;
277 bool $a_active =
false,
282 $ilDB = $DIC->database();
283 $arr_layouts = array();
287 $add .= $conc .
" (active = 1)";
291 case self::MODULE_SCORM:
292 $add .= $conc .
" mod_scorm = 1";
295 case self::MODULE_PORTFOLIO:
296 $add .= $conc .
" mod_portfolio = 1";
299 case self::MODULE_LM:
300 $add .= $conc .
" mod_lm = 1";
303 $query =
"SELECT layout_id FROM page_layout $add ORDER BY title ";
318 return self::getLayouts(
true, $a_module);
324 public static function import(
341 $lng = $DIC->language();
344 self::MODULE_PORTFOLIO =>
$lng->txt(
"style_page_layout_module_portfolio"),
345 self::MODULE_LM =>
$lng->txt(
"style_page_layout_module_learning_module")
xpath_eval(php4DOMXPath $xpath_context, string $eval_str, $contextnode=null)
setDescription(string $a_description)
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...
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.
xpath_new_context($dom_document)
domxml_open_mem($str, $mode=0, &$error=null)
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()
static getLayouts(bool $a_active=false, int $a_module=0)
update()
Update page layout.
const DOMXML_LOAD_PARSING