Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 require_once "class.ilObject.php";
00035 require_once "class.ilContainer.php";
00036
00037 class ilObjRootFolder extends ilContainer
00038 {
00045 function ilObjRootFolder($a_id,$a_call_by_reference = true)
00046 {
00047 $this->type = "root";
00048 $this->ilObject($a_id,$a_call_by_reference);
00049 }
00050
00051
00052
00059 function delete()
00060 {
00061
00062
00063 $message = get_class($this)."::delete(): Can't delete root folder!";
00064 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
00065 return false;
00066
00067
00068 if (!parent::delete())
00069 {
00070 return false;
00071 }
00072
00073
00074
00075 return true;;
00076 }
00077
00088 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
00089 {
00090 global $tree;
00091
00092 switch ($a_event)
00093 {
00094 case "link":
00095
00096
00097
00098
00099 break;
00100
00101 case "cut":
00102
00103
00104
00105 break;
00106
00107 case "copy":
00108
00109
00110
00111
00112 break;
00113
00114 case "paste":
00115
00116
00117
00118 break;
00119
00120 case "new":
00121
00122
00123
00124 break;
00125 }
00126
00127
00128 return true;
00129 }
00130
00137 function getTranslations()
00138 {
00139 global $ilDB;
00140
00141 $q = "SELECT * FROM object_translation WHERE obj_id = ".
00142 $ilDB->quote($this->getId())." ORDER BY lang_default DESC";
00143 $r = $this->ilias->db->query($q);
00144
00145 $num = 0;
00146
00147 $data["Fobject"] = array();
00148 while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
00149 {
00150 $data["Fobject"][$num]= array("title" => $row->title,
00151 "desc" => $row->description,
00152 "lang" => $row->lang_code
00153 );
00154 $num++;
00155 }
00156
00157
00158 $data["default_language"] = 0;
00159
00160 return $data ? $data : array();
00161 }
00162
00163
00164 function removeTranslations()
00165 {
00166 global $ilDB;
00167
00168 $q = "DELETE FROM object_translation WHERE obj_id= ".
00169 $ilDB->quote($this->getId());
00170 $this->ilias->db->query($q);
00171 }
00172
00173
00174 function addTranslation($a_title,$a_desc,$a_lang,$a_lang_default)
00175 {
00176 global $ilDB;
00177
00178 if (empty($a_title))
00179 {
00180 $a_title = "NO TITLE";
00181 }
00182
00183 $q = "INSERT INTO object_translation ".
00184 "(obj_id,title,description,lang_code,lang_default) ".
00185 "VALUES ".
00186 "(".$ilDB->quote($this->getId()).",".
00187 $ilDB->quote($a_title).",".
00188 $ilDB->quote($a_desc).",".
00189 $ilDB->quote($a_lang).",".
00190 $ilDB->quote($a_lang_default).")";
00191 $this->ilias->db->query($q);
00192
00193 return true;
00194 }
00195
00196 }
00197 ?>