ILIAS  release_4-3 Revision
 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()
28  {
29  return array("4.2.0");
30  }
31 
38  function getXmlNamespace($a_entity, $a_schema_version)
39  {
40  return "http://www.ilias.de/xml/Services/COPage/".$a_entity;
41  }
42 
49  protected function getTypes($a_entity, $a_version)
50  {
51  // pgtp: page layout template
52  if ($a_entity == "pgtp")
53  {
54  switch ($a_version)
55  {
56  case "4.2.0":
57  return array(
58  "Id" => "integer",
59  "Title" => "text",
60  "Description" => "text",
61  "SpecialPage" => "integer",
62  "StyleId" => "integer");
63  }
64  }
65  }
66 
73  function readData($a_entity, $a_version, $a_ids, $a_field = "")
74  {
75  global $ilDB;
76 
77  if (!is_array($a_ids))
78  {
79  $a_ids = array($a_ids);
80  }
81 
82  // mep_data
83  if ($a_entity == "pgtp")
84  {
85  switch ($a_version)
86  {
87  case "4.2.0":
88  $this->getDirectDataFromQuery("SELECT layout_id id, title, description, ".
89  " style_id, special_page ".
90  " FROM page_layout ".
91  "WHERE ".
92  $ilDB->in("layout_id", $a_ids, false, "integer"));
93  break;
94  }
95  }
96  }
97 
101  protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
102  {
103  return false;
104  }
105 
109 
110 
117  function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
118  {
119  switch ($a_entity)
120  {
121  case "pgtp":
122  include_once("./Services/Style/classes/class.ilPageLayout.php");
123  $pt = new ilPageLayout();
124  $pt->setTitle($a_rec["Title"]);
125  $pt->setDescription($a_rec["Description"]);
126  $pt->setSpecialPage($a_rec["SpecialPage"]);
127  $pt->update();
128 
129  $this->current_obj = $pt;
130  $a_mapping->addMapping("Services/COPage", "pgtp", $a_rec["Id"],
131  $pt->getId());
132  $a_mapping->addMapping("Services/COPage", "pg", "stys:".$a_rec["Id"],
133  "stys:".$pt->getId());
134  break;
135  }
136  }
137 }
138 ?>