ILIAS  release_4-4 Revision
ilObjForum Class Reference

Class ilObjForum. More...

+ Inheritance diagram for ilObjForum:
+ Collaboration diagram for ilObjForum:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 createSettings ()
 
 setThreadSorting ($a_thr_pk, $a_sorting_value)
 
- 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...
 

Static Public Member Functions

static lookupForumIdByObjId ($obj_id)
 
static lookupForumIdByRefId ($ref_id)
 
static mergeForumUserRead ($merge_source_thread_id, $merge_target_thread_id)
 
- 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

 $Forum
 
- 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...
 

Static Protected Attributes

static $obj_id_to_forum_id_cache = array()
 
static $ref_id_to_forum_id_cache = array()
 
static $forum_statistics_cache = array()
 
static $forum_last_post_cache = array()
 

Detailed Description

Class ilObjForum.

Author
Wolfgang Merkens wmerk.nosp@m.ens@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 18 of file class.ilObjForum.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjForum::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integer$a_idreference_id or object_id
boolean$a_call_by_referencetreat the id as reference_id (true) or object_id (false)

Definition at line 59 of file class.ilObjForum.php.

60  {
61  $this->type = 'frm';
62  parent::__construct($a_id, $a_call_by_reference);
63 
64  /*
65  * this constant is used for the information if a single post is marked as new
66  * All threads/posts created before this date are never marked as new
67  * Default is 8 weeks
68  *
69  */
70  $new_deadline = time() - 60 * 60 * 24 * 7 * ($this->ilias->getSetting('frm_store_new') ?
71  $this->ilias->getSetting('frm_store_new') :
72  8);
73  define('NEW_DEADLINE', $new_deadline);
74 
75  // TODO: needs to rewrite scripts that are using Forum outside this class
76  $this->Forum = new ilForum();
77  }
Class Forum core functions for forum.
redirection script todo: (a better solution should control the processing via a xml file) ...

Member Function Documentation

◆ createSettings()

ilObjForum::createSettings ( )

Definition at line 736 of file class.ilObjForum.php.

References $_GET, $ilUser, ilNewsItem\_getDefaultVisibilityForRefId(), ilBlockSetting\_write(), ilObject\getDescription(), ilObject\getId(), ilObject\getTitle(), and ilUtil\now().

Referenced by ilObjForumGUI\cancelObject().

737  {
738  // news settings (public notifications yes/no)
739  include_once("./Services/News/classes/class.ilNewsItem.php");
740  $default_visibility = ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]);
741  if($default_visibility == "public")
742  {
743  ilBlockSetting::_write("news", "public_notifications", 1, 0, $this->getId());
744  }
745 
746  return true;
747  }
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
$_GET["client_id"]
getId()
get object id public
static _getDefaultVisibilityForRefId($a_ref_id)
Get default visibility for reference id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDiskUsage()

ilObjForum::getDiskUsage ( )

Gets the disk usage of the object in bytes.

public

Returns
integer the disk usage in bytes

Definition at line 84 of file class.ilObjForum.php.

References $_SESSION, $data, $ilBench, ilObject\$ilias, $ilLog, $options, $res, $row, ilCopyWizardOptions\_getInstance(), ilForum\_lookupPostMessage(), ilObject\cloneObject(), ilObject\createRoleFolder(), ilDB\fetchAssoc(), ilObject\getDescription(), ilObject\getId(), ilForumProperties\getInstance(), ilObject\getRefId(), ilObject\getTitle(), ilObject\initDefaultRoles(), ilDB\manipulateF(), and ilObject\update().

85  {
86  require_once("./Modules/File/classes/class.ilObjFileAccess.php");
87  return ilObjForumAccess::_lookupDiskUsage($this->id);
88  }
+ Here is the call graph for this function:

◆ lookupForumIdByObjId()

static ilObjForum::lookupForumIdByObjId (   $obj_id)
static
Parameters
int$obj_id
Returns
int

Definition at line 816 of file class.ilObjForum.php.

Referenced by ilObjForumGUI\updateThreadObject().

817  {
818  if(array_key_exists($obj_id, self::$obj_id_to_forum_id_cache))
819  {
820  return (int)self::$obj_id_to_forum_id_cache[$obj_id];
821  }
822 
823  self::preloadForumIdsByObjIds(array($obj_id));
824 
825  return (int)self::$obj_id_to_forum_id_cache[$obj_id];
826  }
+ Here is the caller graph for this function:

◆ lookupForumIdByRefId()

static ilObjForum::lookupForumIdByRefId (   $ref_id)
static
Parameters
int$ref_id
Returns
int

Definition at line 833 of file class.ilObjForum.php.

References $data, $ilSetting, $ilUser, $in, $query, ilObject\$ref_id, $res, $row, ilSetting\_lookupValue(), ilDB\fetchAssoc(), and ilForumProperties\FORUM_OVERVIEW_WITH_NEW_POSTS.

834  {
835  if(array_key_exists($ref_id, self::$ref_id_to_forum_id_cache))
836  {
837  return (int)self::$ref_id_to_forum_id_cache[$ref_id];
838  }
839 
840  self::preloadForumIdsByRefIds(array($ref_id));
841 
842  return (int)self::$ref_id_to_forum_id_cache[$ref_id];
843  }
+ Here is the call graph for this function:

◆ mergeForumUserRead()

static ilObjForum::mergeForumUserRead (   $merge_source_thread_id,
  $merge_target_thread_id 
)
static

Definition at line 1166 of file class.ilObjForum.php.

Referenced by ilForum\mergeThreads().

1167  {
1168  global $ilDB;
1169 
1170  $ilDB->update('frm_user_read',
1171  array('thread_id' => array('integer', $merge_target_thread_id)),
1172  array('thread_id' => array('integer',$merge_source_thread_id)));
1173  }
+ Here is the caller graph for this function:

◆ setThreadSorting()

ilObjForum::setThreadSorting (   $a_thr_pk,
  $a_sorting_value 
)

Definition at line 801 of file class.ilObjForum.php.

802  {
803  global $ilDB;
804 
805  $ilDB->update('frm_threads',
806  array('thread_sorting' => array('integer',$a_sorting_value)),
807  array('thr_pk' => array('integer', $a_thr_pk)));
808  }

Field Documentation

◆ $Forum

ilObjForum::$Forum

Definition at line 25 of file class.ilObjForum.php.

◆ $forum_last_post_cache

ilObjForum::$forum_last_post_cache = array()
staticprotected

Definition at line 51 of file class.ilObjForum.php.

◆ $forum_statistics_cache

ilObjForum::$forum_statistics_cache = array()
staticprotected

Definition at line 45 of file class.ilObjForum.php.

◆ $obj_id_to_forum_id_cache

ilObjForum::$obj_id_to_forum_id_cache = array()
staticprotected

Definition at line 33 of file class.ilObjForum.php.

◆ $ref_id_to_forum_id_cache

ilObjForum::$ref_id_to_forum_id_cache = array()
staticprotected

Definition at line 39 of file class.ilObjForum.php.


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