ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilCOPageDataSet.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/DataSet/classes/class.ilDataSet.php");
5 
20 {
21  protected $master_lang_only = false;
22 
28  function setMasterLanguageOnly($a_val)
29  {
30  $this->master_lang_only = $a_val;
31  }
32 
39  {
41  }
42 
49  public function getSupportedVersions()
50  {
51  return array("4.2.0");
52  }
53 
60  function getXmlNamespace($a_entity, $a_schema_version)
61  {
62  return "http://www.ilias.de/xml/Services/COPage/".$a_entity;
63  }
64 
71  protected function getTypes($a_entity, $a_version)
72  {
73  // pgtp: page layout template
74  if ($a_entity == "pgtp")
75  {
76  switch ($a_version)
77  {
78  case "4.2.0":
79  return array(
80  "Id" => "integer",
81  "Title" => "text",
82  "Description" => "text",
83  "SpecialPage" => "integer",
84  "StyleId" => "integer");
85  }
86  }
87  }
88 
95  function readData($a_entity, $a_version, $a_ids, $a_field = "")
96  {
97  global $ilDB;
98 
99  if (!is_array($a_ids))
100  {
101  $a_ids = array($a_ids);
102  }
103 
104  // mep_data
105  if ($a_entity == "pgtp")
106  {
107  switch ($a_version)
108  {
109  case "4.2.0":
110  $this->getDirectDataFromQuery("SELECT layout_id id, title, description, ".
111  " style_id, special_page ".
112  " FROM page_layout ".
113  "WHERE ".
114  $ilDB->in("layout_id", $a_ids, false, "integer"));
115  break;
116  }
117  }
118  }
119 
123  protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
124  {
125  return false;
126  }
127 
131 
132 
139  function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
140  {
141  switch ($a_entity)
142  {
143  case "pgtp":
144  include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
145  $pt = new ilPageLayout();
146  $pt->setTitle($a_rec["Title"]);
147  $pt->setDescription($a_rec["Description"]);
148  $pt->setSpecialPage($a_rec["SpecialPage"]);
149  $pt->update();
150 
151  $this->current_obj = $pt;
152  $a_mapping->addMapping("Services/COPage", "pgtp", $a_rec["Id"],
153  $pt->getId());
154  $a_mapping->addMapping("Services/COPage", "pg", "stys:".$a_rec["Id"],
155  "stys:".$pt->getId());
156  break;
157  }
158  }
159 }
160 ?>
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getTypes($a_entity, $a_version)
Get field types for entity.
COPage Data set class.
Class ilPageLayout.
getMasterLanguageOnly()
Get master language only.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getSupportedVersions()
Get supported versions.
Create styles array
The data for the language used.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
global $ilDB
A dataset contains in data in a common structure that can be shared and transformed for different pur...
setMasterLanguageOnly($a_val)
Set master language only.