ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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. More...
 
 delete ()
 delete systemfolder and all related data DISABLED public More...
 
 getHeaderTitleTranslations ()
 get all translations for header title More...
 
 removeHeaderTitleTranslations ()
 
 addHeaderTitleTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)
 
 _getId ()
 
 _getHeaderTitle ()
 
 _getHeaderTitleDescription ()
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Detailed Description

Class ilObjSystemFolder.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

◆ _getHeaderTitle()

ilObjSystemFolder::_getHeaderTitle ( )

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

References ilObject\$id, $ilUser, $r, $row, ilObject\$title, _getId(), and DB_FETCHMODE_OBJECT.

Referenced by ilContainerGUI\fileManagerLaunchObject(), and ilMainMenuGUI\getLanguageSelection().

144  {
145  global $ilDB, $ilUser;
146 
148 
149  $q = "SELECT title,description FROM object_translation ".
150  "WHERE obj_id = ".$ilDB->quote($id,'integer')." ".
151  "AND lang_default = 1";
152  $r = $this->ilias->db->query($q);
153  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
154  $title = $row->title;
155 
156  $q = "SELECT title,description FROM object_translation ".
157  "WHERE obj_id = ".$ilDB->quote($id,'integer')." ".
158  "AND lang_code = ".
159  $ilDB->quote($ilUser->getCurrentLanguage(),'text')." ".
160  "AND NOT lang_default = 1";
161  $r = $this->ilias->db->query($q);
162  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
163 
164  if ($row)
165  {
166  $title = $row->title;
167  }
168 
169  return $title;
170  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilUser
Definition: imgupload.php:15
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getHeaderTitleDescription()

ilObjSystemFolder::_getHeaderTitleDescription ( )

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

References ilObject\$id, $r, $row, _getId(), DB_FETCHMODE_OBJECT, ilObject\DESC_LENGTH, and ilUtil\shortenText().

173  {
174  global $ilDB;
175 
177 
178  $q = "SELECT title,description FROM object_translation ".
179  "WHERE obj_id = ".$ilDB->quote($id,'integer')." ".
180  "AND lang_default = 1";
181  $r = $this->ilias->db->query($q);
182  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
183  $description = $row->description;
184 
185  $q = "SELECT title,description FROM object_translation ".
186  "WHERE obj_id = ".$ilDB->quote($id,'integer')." ".
187  "AND lang_code = ".
188  $ilDB->quote($this->ilias->account->getPref("language"),'text')." ".
189  "AND NOT lang_default = 1";
190  $r = $this->ilias->db->query($q);
191  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
192 
193  if ($row)
194  {
195  $description = ilUtil::shortenText($row->description,ilObject::DESC_LENGTH,true);
196  }
197 
198  return $description;
199  }
const DESC_LENGTH
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
redirection script todo: (a better solution should control the processing via a xml file) ...
$r
+ Here is the call graph for this function:

◆ _getId()

ilObjSystemFolder::_getId ( )

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

References $r, $row, and DB_FETCHMODE_OBJECT.

Referenced by _getHeaderTitle(), and _getHeaderTitleDescription().

134  {
135  $q = "SELECT obj_id FROM object_data ".
136  "WHERE type = 'adm'";
137  $r = $this->ilias->db->query($q);
138  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
139 
140  return $row->obj_id;
141  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
redirection script todo: (a better solution should control the processing via a xml file) ...
$r
+ Here is the caller graph for this function:

◆ addHeaderTitleTranslation()

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

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

References $query, $res, and ilObject\getId().

117  {
118  global $ilDB;
119 
120  $query = "INSERT INTO object_translation ".
121  "(obj_id,title,description,lang_code,lang_default) ".
122  "VALUES ".
123  "(".$ilDB->quote($this->getId(),'integer').",".
124  $ilDB->quote($a_title,'text').",".
125  $ilDB->quote($a_desc,'text').",".
126  $ilDB->quote($a_lang,'text').",".
127  $ilDB->quote($a_lang_default,'integer').")";
128  $res = $ilDB->manipulate($query);
129 
130  return true;
131  }
getId()
get object id public
+ Here is the call graph for this function:

◆ delete()

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

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

58  {
59  // DISABLED
60  return false;
61 
62  // always call parent delete function first!!
63  if (!parent::delete())
64  {
65  return false;
66  }
67 
68  // put here systemfolder specific stuff
69 
70  // always call parent delete function at the end!!
71  return true;
72  }

◆ getHeaderTitleTranslations()

ilObjSystemFolder::getHeaderTitleTranslations ( )

get all translations for header title

public

Returns
array

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

References $data, $r, $row, DB_FETCHMODE_OBJECT, ilObject\DESC_LENGTH, ilObject\getId(), and ilUtil\shortenText().

81  {
82  global $ilDB;
83 
84  $q = "SELECT * FROM object_translation WHERE obj_id = ".
85  $ilDB->quote($this->getId(),'integer')." ORDER BY lang_default DESC";
86  $r = $this->ilias->db->query($q);
87 
88  $num = 0;
89 
90  while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
91  {
92  $data["Fobject"][$num]= array("title" => $row->title,
93  "desc" => ilUtil::shortenText($row->description,ilObject::DESC_LENGTH,true),
94  "lang" => $row->lang_code
95  );
96  $num++;
97  }
98 
99  // first entry is always the default language
100  $data["default_language"] = 0;
101 
102  return $data ? $data : array();
103  }
const DESC_LENGTH
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
$r
+ Here is the call graph for this function:

◆ ilObjSystemFolder()

ilObjSystemFolder::ilObjSystemFolder (   $a_id,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

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

References ilObject\ilObject().

45  {
46  $this->type = "adm";
47  $this->ilObject($a_id,$a_call_by_reference);
48  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ removeHeaderTitleTranslations()

ilObjSystemFolder::removeHeaderTitleTranslations ( )

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

References $query, $res, and ilObject\getId().

107  {
108  global $ilDB;
109 
110  $query = "DELETE FROM object_translation WHERE obj_id= ".
111  $ilDB->quote($this->getId(),'integer');
112  $res = $ilDB->manipulate($query);
113  }
getId()
get object id public
+ Here is the call graph for this function:

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