ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 {
27  public function getSupportedVersions($a_entity)
28  {
29  switch ($a_entity)
30  {
31  case "pgtp":
32  return array("4.2.0");
33  }
34  }
35 
42  function getXmlNamespace($a_entity, $a_target_release)
43  {
44  return "http://www.ilias.de/xml/Services/COPage/".$a_entity;
45  }
46 
53  protected function getTypes($a_entity, $a_version)
54  {
55  // pgtp: page layout template
56  if ($a_entity == "pgtp")
57  {
58  switch ($a_version)
59  {
60  case "4.2.0":
61  return array(
62  "Id" => "integer",
63  "Title" => "text",
64  "Description" => "text",
65  "SpecialPage" => "integer",
66  "StyleId" => "integer");
67  }
68  }
69  }
70 
77  function readData($a_entity, $a_version, $a_ids, $a_field = "")
78  {
79  global $ilDB;
80 
81  if (!is_array($a_ids))
82  {
83  $a_ids = array($a_ids);
84  }
85 
86  // mep_data
87  if ($a_entity == "pgtp")
88  {
89  switch ($a_version)
90  {
91  case "4.2.0":
92  $this->getDirectDataFromQuery("SELECT layout_id id, title, description, ".
93  " style_id, special_page ".
94  " FROM page_layout ".
95  "WHERE ".
96  $ilDB->in("layout_id", $a_ids, false, "integer"));
97  break;
98  }
99  }
100  }
101 
105  protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
106  {
107  return false;
108  }
109 
113 
114 
121  function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
122  {
123  switch ($a_entity)
124  {
125  case "pgtp":
126  include_once("./Services/Style/classes/class.ilPageLayout.php");
127  $pt = new ilPageLayout();
128  $pt->setTitle($a_rec["Title"]);
129  $pt->setDescription($a_rec["Description"]);
130  $pt->setSpecialPage($a_rec["SpecialPage"]);
131  $pt->update();
132 
133  $this->current_obj = $pt;
134  $a_mapping->addMapping("Services/COPage", "pgtp", $a_rec["Id"],
135  $pt->getId());
136  $a_mapping->addMapping("Services/COPage", "pg", "stys:".$a_rec["Id"],
137  "stys:".$pt->getId());
138  break;
139  }
140  }
141 }
142 ?>