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                 global $ilias, $ilDB;
 
  224         $r = $ilias->db->query(
"SELECT content FROM page_object WHERE parent_type='stys' AND page_id=".
 
  225                         $ilDB->quote($this->layout_id));
 
  228                 return $row[
'content'];
 
  242                 return "./Services/Style/xml/layout2html.xsl";
 
  251                 $path = 
"////PlaceHolder";
 
  254                 foreach (
$res->nodeset as $item){
 
  255                                 $height = $item->get_attribute(
"Height");
 
  257                                 $height = eregi_replace(
"px",
"",$height);
 
  259                                 $item->set_attribute(
"Height",$height.
"px");
 
  261                 $xsl = file_get_contents($this->
getXSLPath());
 
  263                 $xml = $dom->dump_mem(0, 
"UTF-8");
 
  265                 $args = array( 
'/_xml' => $xml, 
'/_xsl' => $xsl );
 
  268                 $output = 
xslt_process($xh, 
"arg:/_xml", 
"arg:/_xsl", NULL, $args, NULL);
 
  282                 $arr_layouts = array();
 
  284                         $add =
"WHERE (active=1)";
 
  286                 $query = 
"SELECT * FROM page_layout $add ORDER BY title ";
 
  290                         array_push($arr_layouts,
$row);
 
  299         public static function getLayouts($a_active = 
false, $a_special_page = 
false, $a_module = null)
 
  302                 $arr_layouts = array();
 
  303                 $add = 
"WHERE special_page = ".$ilDB->quote($a_special_page, 
"integer");
 
  306                         $add.= 
" AND (active = 1)";
 
  310                         case self::MODULE_SCORM:
 
  311                                 $add .= 
" AND mod_scorm = 1";
 
  314                         case self::MODULE_PORTFOLIO:
 
  315                                 $add .= 
" AND mod_portfolio = 1";
 
  318                 $query = 
"SELECT layout_id FROM page_layout $add ORDER BY title ";
 
  331         public static function activeLayouts($a_special_page = 
false, $a_module = null)
 
  344         static function import($a_filename, $a_filepath)
 
  346                 include_once(
"./Services/Export/classes/class.ilImport.php");
 
  348                 $imp->importEntity($a_filepath, $a_filename,
 
  349                         "pgtp", 
"Services/COPage");
 
  357                         self::MODULE_SCORM => $lng->txt(
"style_page_layout_module_scorm"),
 
  358                         self::MODULE_PORTFOLIO => $lng->txt(
"style_page_layout_module_portfolio")