Public Member Functions

ilObjSystemFolder Class Reference

Class ilObjSystemFolder. More...

Inheritance diagram for ilObjSystemFolder:
Collaboration diagram for ilObjSystemFolder:

Public Member Functions

 ilObjSystemFolder ($a_id, $a_call_by_reference=true)
 Constructor public.
 delete ()
 delete systemfolder and all related data DISABLED public
 getHeaderTitleTranslations ()
 get all translations for header title
 removeHeaderTitleTranslations ()
 addHeaderTitleTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 _getId ()
 _getHeaderTitle ()
 _getHeaderTitleDescription ()

Detailed Description

Class ilObjSystemFolder.

Author:
Stefan Meyer <smeyer@databay.de>
Version:
Id:
class.ilObjSystemFolder.php 13414 2007-03-08 12:41:48Z smeyer

Definition at line 36 of file class.ilObjSystemFolder.php.


Member Function Documentation

ilObjSystemFolder::_getHeaderTitle (  ) 

Definition at line 143 of file class.ilObjSystemFolder.php.

References ilObject::$id, ilObject::$title, and _getId().

Referenced by ilObjSystemFolderGUI::displayBasicSettings(), and ilMainMenuGUI::setTemplateVars().

        {
                global $ilDB;
                
                $id = ilObjSystemFolder::_getId();

                $q = "SELECT title,description FROM object_translation ".
                        "WHERE obj_id = ".$ilDB->quote($id)." ".
                        "AND lang_default = 1";
                $r = $this->ilias->db->query($q);
                $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
                $title = $row->title;

                $q = "SELECT title,description FROM object_translation ".
                        "WHERE obj_id = ".$ilDB->quote($id)." ".
                        "AND lang_code = ".
                        $ilDB->quote($this->ilias->account->getPref("language"))." ".
                        "AND NOT lang_default = 1";
                $r = $this->ilias->db->query($q);
                $row = $r->fetchRow(DB_FETCHMODE_OBJECT);

                if ($row)
                {
                        $title = $row->title;
                }

                return $title;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjSystemFolder::_getHeaderTitleDescription (  ) 

Definition at line 172 of file class.ilObjSystemFolder.php.

References ilObject::$id, _getId(), and ilUtil::shortenText().

        {
                global $ilDB;
                
                $id = ilObjSystemFolder::_getId();

                $q = "SELECT title,description FROM object_translation ".
                        "WHERE obj_id = ".$ilDB->quote($id)." ".
                        "AND lang_default = 1";
                $r = $this->ilias->db->query($q);
                $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
                $description = $row->description;

                $q = "SELECT title,description FROM object_translation ".
                        "WHERE obj_id = ".$ilDB->quote($id)." ".
                        "AND lang_code = ".
                        $ilDB->quote($this->ilias->account->getPref("language"))." ".
                        "AND NOT lang_default = 1";
                $r = $this->ilias->db->query($q);
                $row = $r->fetchRow(DB_FETCHMODE_OBJECT);

                if ($row)
                {
                        $description = ilUtil::shortenText($row->description,MAXLENGTH_OBJ_DESC,true);
                }

                return $description;
        }

Here is the call graph for this function:

ilObjSystemFolder::_getId (  ) 

Definition at line 133 of file class.ilObjSystemFolder.php.

Referenced by _getHeaderTitle(), and _getHeaderTitleDescription().

        {
                $q = "SELECT obj_id FROM object_data ".
                        "WHERE type = 'adm'";
                $r = $this->ilias->db->query($q);
                $row = $r->fetchRow(DB_FETCHMODE_OBJECT);

                return $row->obj_id;
        }

Here is the caller graph for this function:

ilObjSystemFolder::addHeaderTitleTranslation ( a_title,
a_desc,
a_lang,
a_lang_default 
)

Definition at line 116 of file class.ilObjSystemFolder.php.

References ilObject::getId().

        {
                global $ilDB;
                
                $q = "INSERT INTO object_translation ".
                         "(obj_id,title,description,lang_code,lang_default) ".
                         "VALUES ".
                         "(".$ilDB->quote($this->getId()).",".
                         $ilDB->quote($a_title).",".
                         $ilDB->quote($a_desc).",".
                         $ilDB->quote($a_lang).",".
                         $ilDB->quote($a_lang_default).")";
                $this->ilias->db->query($q);

                return true;
        }

Here is the call graph for this function:

ilObjSystemFolder::delete (  ) 

delete systemfolder and all related data DISABLED public

Returns:
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 57 of file class.ilObjSystemFolder.php.

        {
                // DISABLED
                return false;

                // always call parent delete function first!!
                if (!parent::delete())
                {
                        return false;
                }

                // put here systemfolder specific stuff

                // always call parent delete function at the end!!
                return true;
        }

ilObjSystemFolder::getHeaderTitleTranslations (  ) 

get all translations for header title

public

Returns:
array

Definition at line 80 of file class.ilObjSystemFolder.php.

References $data, ilObject::getId(), and ilUtil::shortenText().

        {
                global $ilDB;
                
                $q = "SELECT * FROM object_translation WHERE obj_id = ".
                        $ilDB->quote($this->getId())." ORDER BY lang_default DESC";
                $r = $this->ilias->db->query($q);

                $num = 0;

                while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $data["Fobject"][$num]= array("title"   => $row->title,
                                                                                  "desc"        => ilUtil::shortenText($row->description,MAXLENGTH_OBJ_DESC,true),
                                                                                  "lang"        => $row->lang_code
                                                                                  );
                $num++;
                }

                // first entry is always the default language
                $data["default_language"] = 0;

                return $data ? $data : array();
        }

Here is the call graph for this function:

ilObjSystemFolder::ilObjSystemFolder ( a_id,
a_call_by_reference = true 
)

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

Definition at line 44 of file class.ilObjSystemFolder.php.

References ilObject::ilObject().

        {
                $this->type = "adm";
                $this->ilObject($a_id,$a_call_by_reference);
        }

Here is the call graph for this function:

ilObjSystemFolder::removeHeaderTitleTranslations (  ) 

Definition at line 106 of file class.ilObjSystemFolder.php.

References ilObject::getId().

        {
                global $ilDB;
                
                $q = "DELETE FROM object_translation WHERE obj_id= ".
                        $ilDB->quote($this->getId());
                $this->ilias->db->query($q);
        }

Here is the call graph for this function:


The documentation for this class was generated from the following file: