17 const SEQ_TEMPLATE_DIR =
'./Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails';
33 $this->layout_id = $ilDB->nextId(
"page_layout");
34 $ilDB->insert(
"page_layout", array(
35 "layout_id" => array(
"integer", $this->layout_id),
36 "active" => array(
"integer", 0),
37 "title" => array(
"text",
""),
38 "content" => array(
"clob",
""),
39 "description" => array(
"text",
"")
47 $this->active =
false;
50 $this->layout_id = $a_id;
63 $this->description = $a_description;
71 $this->title = $a_title;
83 $this->style_id = $a_val;
91 return $this->style_id;
99 $this->special_page = $a_val;
107 return $this->special_page;
118 $this->modules = array_intersect($a_values,
$valid);
122 $this->modules = array();
141 global $ilias, $ilDB;
143 $query =
"UPDATE page_layout SET active=".$ilDB->quote($a_setting,
"integer").
144 " WHERE layout_id =".$ilDB->quote($this->layout_id,
"integer");
151 public function delete()
153 global $ilias, $ilDB;
155 $query =
"DELETE FROM page_layout WHERE layout_id =".$ilDB->quote($this->layout_id,
"integer");
164 global $ilias, $ilDB;
166 $mod_scorm = $mod_portfolio = 0;
167 if(in_array(self::MODULE_SCORM, $this->modules))
171 if(in_array(self::MODULE_PORTFOLIO, $this->modules))
176 $query =
"UPDATE page_layout SET title=".$ilDB->quote($this->title,
"text").
177 ",description =".$ilDB->quote($this->description,
"text").
178 ",active =".$ilDB->quote($this->active,
"integer").
179 ",style_id =".$ilDB->quote($this->
getStyleId(),
"integer").
180 ",special_page =".$ilDB->quote((
int) $this->
getSpecialPage(),
"integer").
181 ",mod_scorm =".$ilDB->quote($mod_scorm,
"integer").
182 ",mod_portfolio =".$ilDB->quote($mod_portfolio,
"integer").
183 " WHERE layout_id =".$ilDB->quote($this->layout_id,
"integer");
193 global $ilias, $ilDB;
194 $query =
"SELECT * FROM page_layout WHERE layout_id =".$ilDB->quote($this->layout_id,
"integer");
197 $this->title =
$row[
'title'];
200 $this->description=
$row[
'description'];
201 $this->active=
$row[
'active'];
204 if(
$row[
"mod_scorm"])
208 if(
$row[
"mod_portfolio"])
222 include_once
"Services/Style/classes/class.ilPageLayoutPage.php";
224 return $layout_page->getXMLContent();
238 return "./Services/Style/xml/layout2html.xsl";
247 $path =
"////PlaceHolder";
250 foreach (
$res->nodeset as $item){
251 $height = $item->get_attribute(
"Height");
253 $height = eregi_replace(
"px",
"",$height);
255 $item->set_attribute(
"Height",$height.
"px");
257 $xsl = file_get_contents($this->
getXSLPath());
259 $xml = $dom->dump_mem(0,
"UTF-8");
261 $args = array(
'/_xml' => $xml,
'/_xsl' => $xsl );
264 $output =
xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", NULL, $args, NULL);
278 $arr_layouts = array();
280 $add =
"WHERE (active=1)";
282 $query =
"SELECT * FROM page_layout $add ORDER BY title ";
286 array_push($arr_layouts,
$row);
295 public static function getLayouts($a_active =
false, $a_special_page =
false, $a_module = null)
298 $arr_layouts = array();
299 $add =
"WHERE special_page = ".$ilDB->quote($a_special_page,
"integer");
302 $add.=
" AND (active = 1)";
306 case self::MODULE_SCORM:
307 $add .=
" AND mod_scorm = 1";
310 case self::MODULE_PORTFOLIO:
311 $add .=
" AND mod_portfolio = 1";
314 $query =
"SELECT layout_id FROM page_layout $add ORDER BY title ";
327 public static function activeLayouts($a_special_page =
false, $a_module = null)
340 static function import($a_filename, $a_filepath)
342 include_once(
"./Services/Export/classes/class.ilImport.php");
344 $imp->importEntity($a_filepath, $a_filename,
345 "pgtp",
"Services/COPage");
353 self::MODULE_SCORM => $lng->txt(
"style_page_layout_module_scorm"),
354 self::MODULE_PORTFOLIO => $lng->txt(
"style_page_layout_module_portfolio")