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
00036 class ilObjSystemFolder extends ilObject
00037 {
00044 function ilObjSystemFolder($a_id,$a_call_by_reference = true)
00045 {
00046 $this->type = "adm";
00047 $this->ilObject($a_id,$a_call_by_reference);
00048 }
00049
00050
00057 function delete()
00058 {
00059
00060 return false;
00061
00062
00063 if (!parent::delete())
00064 {
00065 return false;
00066 }
00067
00068
00069
00070
00071 return true;
00072 }
00073
00080 function getHeaderTitleTranslations()
00081 {
00082 global $ilDB;
00083
00084 $q = "SELECT * FROM object_translation WHERE obj_id = ".
00085 $ilDB->quote($this->getId())." ORDER BY lang_default DESC";
00086 $r = $this->ilias->db->query($q);
00087
00088 $num = 0;
00089
00090 while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
00091 {
00092 $data["Fobject"][$num]= array("title" => $row->title,
00093 "desc" => ilUtil::shortenText($row->description,MAXLENGTH_OBJ_DESC,true),
00094 "lang" => $row->lang_code
00095 );
00096 $num++;
00097 }
00098
00099
00100 $data["default_language"] = 0;
00101
00102 return $data ? $data : array();
00103 }
00104
00105
00106 function removeHeaderTitleTranslations()
00107 {
00108 global $ilDB;
00109
00110 $q = "DELETE FROM object_translation WHERE obj_id= ".
00111 $ilDB->quote($this->getId());
00112 $this->ilias->db->query($q);
00113 }
00114
00115
00116 function addHeaderTitleTranslation($a_title,$a_desc,$a_lang,$a_lang_default)
00117 {
00118 global $ilDB;
00119
00120 $q = "INSERT INTO object_translation ".
00121 "(obj_id,title,description,lang_code,lang_default) ".
00122 "VALUES ".
00123 "(".$ilDB->quote($this->getId()).",".
00124 $ilDB->quote($a_title).",".
00125 $ilDB->quote($a_desc).",".
00126 $ilDB->quote($a_lang).",".
00127 $ilDB->quote($a_lang_default).")";
00128 $this->ilias->db->query($q);
00129
00130 return true;
00131 }
00132
00133 function _getId()
00134 {
00135 $q = "SELECT obj_id FROM object_data ".
00136 "WHERE type = 'adm'";
00137 $r = $this->ilias->db->query($q);
00138 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
00139
00140 return $row->obj_id;
00141 }
00142
00143 function _getHeaderTitle()
00144 {
00145 global $ilDB;
00146
00147 $id = ilObjSystemFolder::_getId();
00148
00149 $q = "SELECT title,description FROM object_translation ".
00150 "WHERE obj_id = ".$ilDB->quote($id)." ".
00151 "AND lang_default = 1";
00152 $r = $this->ilias->db->query($q);
00153 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
00154 $title = $row->title;
00155
00156 $q = "SELECT title,description FROM object_translation ".
00157 "WHERE obj_id = ".$ilDB->quote($id)." ".
00158 "AND lang_code = ".
00159 $ilDB->quote($this->ilias->account->getPref("language"))." ".
00160 "AND NOT lang_default = 1";
00161 $r = $this->ilias->db->query($q);
00162 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
00163
00164 if ($row)
00165 {
00166 $title = $row->title;
00167 }
00168
00169 return $title;
00170 }
00171
00172 function _getHeaderTitleDescription()
00173 {
00174 global $ilDB;
00175
00176 $id = ilObjSystemFolder::_getId();
00177
00178 $q = "SELECT title,description FROM object_translation ".
00179 "WHERE obj_id = ".$ilDB->quote($id)." ".
00180 "AND lang_default = 1";
00181 $r = $this->ilias->db->query($q);
00182 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
00183 $description = $row->description;
00184
00185 $q = "SELECT title,description FROM object_translation ".
00186 "WHERE obj_id = ".$ilDB->quote($id)." ".
00187 "AND lang_code = ".
00188 $ilDB->quote($this->ilias->account->getPref("language"))." ".
00189 "AND NOT lang_default = 1";
00190 $r = $this->ilias->db->query($q);
00191 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
00192
00193 if ($row)
00194 {
00195 $description = ilUtil::shortenText($row->description,MAXLENGTH_OBJ_DESC,true);
00196 }
00197
00198 return $description;
00199 }
00200
00201 }
00202 ?>