ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjTaxonomyAdministration.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "./Services/Object/classes/class.ilObject.php";
5 
15 {
16  public function __construct($a_id = 0, $a_call_by_reference = true)
17  {
18  global $DIC;
19 
20  $this->tree = $DIC->repositoryTree();
21  $this->db = $DIC->database();
22  $this->type = "taxs";
23  parent::__construct($a_id, $a_call_by_reference);
24  }
25 
26  public function delete()
27  {
28  // DISABLED
29  return false;
30  }
31 
32  protected function getPath($a_ref_id)
33  {
35 
36  $res = array();
37 
38  foreach ($tree->getPathFull($a_ref_id) as $data) {
39  $res[] = $data['title'];
40  }
41 
42  return $res;
43  }
44 
45  public function getRepositoryTaxonomies()
46  {
47  $ilDB = $this->db;
49 
50  $res = array();
51 
52  include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
53 
54  $sql = "SELECT oref.ref_id, od.obj_id, od.type obj_type, od.title obj_title," .
55  " tu.tax_id, od2.title tax_title, cs.value tax_status" .
56  " FROM object_data od" .
57  " JOIN object_reference oref ON (od.obj_id = oref.obj_id)" .
58  " JOIN tax_usage tu ON (tu.obj_id = od.obj_id)" .
59  " JOIN object_data od2 ON (od2.obj_id = tu.tax_id)" .
60  " LEFT JOIN container_settings cs ON (cs.id = od.obj_id AND keyword = " . $ilDB->quote(ilObjectServiceSettingsGUI::TAXONOMIES, "text") . ")" .
61  " WHERE od.type = " . $ilDB->quote("cat", "text") . // categories only currently
62  " AND tu.tax_id > " . $ilDB->quote(0, "integer");
63  $set = $ilDB->query($sql);
64  while ($row = $ilDB->fetchAssoc($set)) {
65  if (!$tree->isDeleted($row["ref_id"])) {
66  $res[$row["tax_id"]][$row["obj_id"]] = array(
67  "tax_id" => $row["tax_id"]
68  ,"tax_title" => $row["tax_title"]
69  ,"tax_status" => (bool) $row["tax_status"]
70  ,"obj_title" => $row["obj_title"]
71  ,"obj_type" => $row["obj_type"]
72  ,"obj_id" => $row["obj_id"]
73  ,"ref_id" => $row["ref_id"]
74  ,"path" => $this->getPath($row["ref_id"])
75  );
76  }
77  }
78 
79  return $res;
80  }
81 }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $ilDB
__construct($a_id=0, $a_call_by_reference=true)