ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjForumAccess Class Reference

Class ilObjForumAccess. More...

+ Inheritance diagram for ilObjForumAccess:
+ Collaboration diagram for ilObjForumAccess:

Public Member Functions

 _getCommands ()
 get commands this method returns an array of all possible commands/permission combinations example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), ); Comment mjansen: Cannot make this static because parent method is not static ... More...
 
 _preloadData ($obj_ids, $ref_ids)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Public Member Functions

static prepareMessageForLists ($text)
 Prepare message for container view. More...
 
static getLastPostByRefId ($ref_id)
 
static getStatisticsByRefId ($ref_id)
 
static getCachedUserInstance ($usr_id)
 
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Static Protected Attributes

static $userInstanceCache = array()
 

Detailed Description

Class ilObjForumAccess.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilObjForumAccess.php.

Member Function Documentation

◆ _getCommands()

ilObjForumAccess::_getCommands ( )

get commands this method returns an array of all possible commands/permission combinations example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), ); Comment mjansen: Cannot make this static because parent method is not static ...

Returns
array

Reimplemented from ilObjectAccess.

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

34 {
35 $commands = array
36 (
37 array(
38 'permission'=> 'read',
39 'cmd' => 'showThreads',
40 'lang_var' => 'show',
41 'default' => true
42 ),
43 array(
44 'permission'=> 'write',
45 'cmd' => 'edit',
46 'lang_var' => 'settings'
47 ),
48 );
49
50 return $commands;
51 }

Referenced by ilObjForumListGUI\init().

+ Here is the caller graph for this function:

◆ _preloadData()

ilObjForumAccess::_preloadData (   $obj_ids,
  $ref_ids 
)
Parameters
array$obj_ids
array$ref_ids

Reimplemented from ilObjectAccess.

Definition at line 168 of file class.ilObjForumAccess.php.

169 {
170 /*
171 We are only able to preload the top_pk values for the forum ref_ids.
172 Other data like statistics and last posts require permission checks per reference, so there is no added value for using an SQL IN() function in the queries
173 */
174 ilObjForum::preloadForumIdsByRefIds((array)$ref_ids);
175 }

◆ getCachedUserInstance()

static ilObjForumAccess::getCachedUserInstance (   $usr_id)
static
Parameters
int$usr_id
Returns
ilObjUser|boolean

Definition at line 202 of file class.ilObjForumAccess.php.

203 {
204 if(!isset(self::$userInstanceCache[$usr_id]))
205 {
206 self::$userInstanceCache[$usr_id] = ilObjectFactory::getInstanceByObjId($usr_id, false);
207 }
208
209 return self::$userInstanceCache[$usr_id];
210 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id

References ilObjectFactory\getInstanceByObjId().

Referenced by ilForumPost\getUserData(), and ilForumAuthorInformation\initUserInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastPostByRefId()

static ilObjForumAccess::getLastPostByRefId (   $ref_id)
static
Parameters
int$ref_id
Returns
array

Definition at line 182 of file class.ilObjForumAccess.php.

183 {
184 return ilObjForum::lookupLastPostByRefId($ref_id);
185 }
$ref_id
Definition: sahs_server.php:39

References $ref_id.

◆ getStatisticsByRefId()

static ilObjForumAccess::getStatisticsByRefId (   $ref_id)
static
Parameters
int$ref_id
Returns
array

Definition at line 192 of file class.ilObjForumAccess.php.

193 {
194 return ilObjForum::lookupStatisticsByRefId($ref_id);
195 }

References $ref_id.

◆ prepareMessageForLists()

static ilObjForumAccess::prepareMessageForLists (   $text)
static

Prepare message for container view.

Parameters
string$text
Returns
string

Definition at line 150 of file class.ilObjForumAccess.php.

151 {
152 include_once 'Services/Utilities/classes/class.ilStr.php';
153
154 $text = strip_tags($text);
155 $text = preg_replace('/\[(\/)?quote\]/', '', $text);
156 if(ilStr::strLen($text) > 40)
157 {
158 $text = ilStr::subStr($text, 0, 37) . '...';
159 }
160
161 return $text;
162 }
static strLen($a_string)
Definition: class.ilStr.php:79
static subStr($a_str, $a_start, $a_length=NULL)
Definition: class.ilStr.php:15
$text

References $text, ilStr\strLen(), and ilStr\subStr().

+ Here is the call graph for this function:

Field Documentation

◆ $userInstanceCache

ilObjForumAccess::$userInstanceCache = array()
staticprotected

Definition at line 19 of file class.ilObjForumAccess.php.


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