34require_once 
"./Services/Object/classes/class.ilObject.php";
 
   49    public function __construct($a_id, $a_call_by_reference = 
true)
 
   53        $this->db = 
$DIC->database();
 
   54        $this->
user = $DIC->user();
 
   56        parent::__construct($a_id, $a_call_by_reference);
 
   66    public function delete()
 
   72        if (!parent::delete()) {
 
   88    public function getHeaderTitleTranslations()
 
   95        $q = 
"SELECT * FROM object_translation WHERE obj_id = " .
 
   96            $ilDB->quote($this->
getId(), 
'integer') . 
" ORDER BY lang_default DESC";
 
  102            $data[
"Fobject"][$num] = array(
"title" => 
$row->title,
 
  104                                          "lang" => 
$row->lang_code
 
  110        $data[
"default_language"] = 0;
 
  120        $query = 
"DELETE FROM object_translation WHERE obj_id= " .
 
  130        $query = 
"INSERT INTO object_translation " .
 
  131             "(obj_id,title,description,lang_code,lang_default) " .
 
  133             "(" . 
$ilDB->quote($this->
getId(), 
'integer') . 
"," .
 
  134             $ilDB->quote($a_title, 
'text') . 
"," .
 
  135             $ilDB->quote($a_desc, 
'text') . 
"," .
 
  136             $ilDB->quote($a_lang, 
'text') . 
"," .
 
  137             $ilDB->quote($a_lang_default, 
'integer') . 
")";
 
  143    public static function _getId()
 
  152        $q = 
"SELECT obj_id FROM object_data WHERE type = " . 
$ilDB->quote(
'adm', 
'text');
 
  159    public static function _getHeaderTitle()
 
  170        $id = ilObjSystemFolder::_getId();
 
  172        $q = 
"SELECT title,description FROM object_translation " .
 
  173            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  174            "AND lang_default = 1";
 
  179        $q = 
"SELECT title,description FROM object_translation " .
 
  180            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  182            $ilDB->quote(
$ilUser->getCurrentLanguage(), 
'text') . 
" " .
 
  183            "AND NOT lang_default = 1";
 
  199        $id = ilObjSystemFolder::_getId();
 
  201        $q = 
"SELECT title,description FROM object_translation " .
 
  202            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  203            "AND lang_default = 1";
 
  208        $q = 
"SELECT title,description FROM object_translation " .
 
  209            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  211            $ilDB->quote(
$ilUser->getPref(
"language"), 
'text') . 
" " .
 
  212            "AND NOT lang_default = 1";
 
An exception for terminatinating execution or to throw for unit testing.
_getHeaderTitleDescription()
__construct($a_id, $a_call_by_reference=true)
Constructor @access public.
removeHeaderTitleTranslations()
addHeaderTitleTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
Class ilObject Basic functions for all objects.
getId()
get object id @access public
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
foreach($_POST as $key=> $value) $res