22 const SEQ_TEMPLATE_DIR =
'./Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails';
37 $this->db = $DIC->database();
38 $ilDB = $DIC->database();
41 $this->layout_id =
$ilDB->nextId(
"page_layout");
43 "layout_id" =>
array(
"integer", $this->layout_id),
44 "active" =>
array(
"integer", 0),
45 "title" =>
array(
"text",
""),
46 "content" =>
array(
"clob",
""),
47 "description" =>
array(
"text",
"")
55 $this->active =
false;
57 $this->layout_id = $a_id;
73 $this->description = $a_description;
83 $this->title = $a_title;
96 $this->style_id = $a_val;
104 return $this->style_id;
112 $this->special_page = $a_val;
120 return $this->special_page;
130 $this->modules = array_intersect($a_values,
$valid);
132 $this->modules =
array();
153 $query =
"UPDATE page_layout SET active=" .
$ilDB->quote($a_setting,
"integer") .
154 " WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
161 public function delete()
165 $query =
"DELETE FROM page_layout WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
176 $mod_scorm = $mod_portfolio = 0;
177 if (in_array(self::MODULE_SCORM, $this->modules)) {
180 if (in_array(self::MODULE_PORTFOLIO, $this->modules)) {
184 $query =
"UPDATE page_layout SET title=" .
$ilDB->quote($this->title,
"text") .
185 ",description =" .
$ilDB->quote($this->description,
"text") .
186 ",active =" .
$ilDB->quote($this->active,
"integer") .
189 ",mod_scorm =" .
$ilDB->quote($mod_scorm,
"integer") .
190 ",mod_portfolio =" .
$ilDB->quote($mod_portfolio,
"integer") .
191 " WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
202 $query =
"SELECT * FROM page_layout WHERE layout_id =" .
$ilDB->quote($this->layout_id,
"integer");
205 $this->title =
$row[
'title'];
208 $this->description=
$row[
'description'];
209 $this->active=
$row[
'active'];
212 if (
$row[
"mod_scorm"]) {
213 $mods[] = self::MODULE_SCORM;
215 if (
$row[
"mod_portfolio"]) {
216 $mods[] = self::MODULE_PORTFOLIO;
228 include_once
"Services/COPage/Layout/classes/class.ilPageLayoutPage.php";
230 return $layout_page->getXMLContent();
245 return "./Services/COPage/Layout/xml/layout2html.xsl";
254 $path =
"////PlaceHolder";
257 foreach (
$res->nodeset as $item) {
258 $height = $item->get_attribute(
"Height");
260 $height = str_ireplace(
"px",
"", $height);
262 $item->set_attribute(
"Height", $height .
"px");
264 $xsl = file_get_contents($this->
getXSLPath());
266 $xml = $dom->dump_mem(0,
"UTF-8");
268 $args =
array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
271 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args, null);
286 $ilDB = $DIC->database();
287 $arr_layouts =
array();
289 $add =
"WHERE (active=1)";
291 $query =
"SELECT * FROM page_layout $add ORDER BY title ";
294 array_push($arr_layouts,
$row);
302 public static function getLayouts($a_active =
false, $a_special_page =
false, $a_module = null)
306 $ilDB = $DIC->database();
307 $arr_layouts =
array();
308 $add =
"WHERE special_page = " .
$ilDB->quote($a_special_page,
"integer");
310 $add.=
" AND (active = 1)";
313 case self::MODULE_SCORM:
314 $add .=
" AND mod_scorm = 1";
317 case self::MODULE_PORTFOLIO:
318 $add .=
" AND mod_portfolio = 1";
321 $query =
"SELECT layout_id FROM page_layout $add ORDER BY title ";
333 public static function activeLayouts($a_special_page =
false, $a_module = null)
335 return self::getLayouts(
true, $a_special_page, $a_module);
346 public static function import($a_filename, $a_filepath)
348 include_once(
"./Services/Export/classes/class.ilImport.php");
362 $lng = $DIC->language();
365 self::MODULE_SCORM =>
$lng->txt(
"style_page_layout_module_scorm"),
366 self::MODULE_PORTFOLIO =>
$lng->txt(
"style_page_layout_module_portfolio")
setStyleId($a_val)
Set style id.
xpath_new_context($dom_document)
domxml_open_mem($str, $mode=0, &$error=null)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
getSpecialPage()
Get special page.
setSpecialPage($a_val)
Set special page.
setDescription($a_description)
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
readObject()
Read page layout.
foreach($_POST as $key=> $value) $res
activate($a_setting=true)
(De-)Activate layout
static getLayouts($a_active=false, $a_special_page=false, $a_module=null)
Get layouts.
static getAvailableModules()
Create styles array
The data for the language used.
update()
Update page layout.
getStyleId()
Get style id.
const DOMXML_LOAD_PARSING
static getLayoutsAsArray($a_active=0)
Static access functions.
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
setModules(array $a_values=null)
Set modules.
getXMLContent()
Get xml content.