Stud.IP  5.4
object.inc.php File Reference

Namespaces

 studip_core
 

Functions

 object_set_visit_module ($plugin_id)
 
 object_set_visit ($object_id, $plugin_id, $user_id='')
 
 object_get_visit ($object_id, $plugin_id, $mode="last", $open_object_id='', $user_id='', $refresh_cache=false)
 
 get_objects_visits (array $object_ids, $plugin_id, $mode='last', $user_id=null, $additional_plugins=[])
 
 object_get_visit_threshold ()
 
 object_kill_visits ($user_id, $object_ids=false)
 
 object_add_view ($object_id)
 
 object_kill_views ($object_id)
 
 object_return_views ($object_id)
 
 object_type_to_id ($type)
 
 object_id_to_type ($id)
 

Function Documentation

◆ get_objects_visits()

get_objects_visits ( array  $object_ids,
  $plugin_id,
  $mode = 'last',
  $user_id = null,
  $additional_plugins = [] 
)

This function gets the (last) visit time for an array of objects. If no information is found, the last visit of the open-object can bes used

Parameters
array$object_idsThe ids of the objects (i.e. seminar_id, news_id, vote_id)
string$typeThe type of visited objects or module (i.e. news, documents, wiki)
string | null$modeThe return-mode: 'last' for the last visit, other for actual-visit; pass null to get an array of visit date and last visit date
mixed$user_idUser id to gather the data for, pass null for current user
array$additional_pluginsAdditional types to get data for. The returned array is then enlarged by one dimension
Returns
array associate array with the object id as key and the according data as value
Note
This function will respect the visit threshold defined in NEW_INDICATOR_THRESHOLD config.

◆ object_add_view()

object_add_view (   $object_id)

◆ object_get_visit()

object_get_visit (   $object_id,
  $plugin_id,
  $mode = "last",
  $open_object_id = '',
  $user_id = '',
  $refresh_cache = false 
)

This function gets the (last) visit time for an object or module. If no information is found, the last visit of the open-object can bes used

Parameters
stringthe id of the object (i.e. seminar_id, news_id, vote_id)
stringthe type of visited object or module (i.e. news, documents, wiki - see /lib/classes/Modules.class.php for definitions OR sem/inst, if the visit for the whole seminar was saved)
stringthe return-mode: 'last' for the last visit, other for actual-visit
stringthe user who visited the object - if not given, the actual user is used
stringthe id of an open-object (seminar or inst), to gather information for last visit from the visit of the whole open-object
Returns
int the timestamp of the last visit or FALSE

◆ object_get_visit_threshold()

object_get_visit_threshold ( )

This function gets the cutoff value for object visit dates as defined by the NEW_INDICATOR_THRESHOLD setting.

Returns
int the timestamp of the oldest possible visit or 0

◆ object_id_to_type()

object_id_to_type (   $id)

converts a plugin id to old ouv type

Parameters
$idint former used type of visited objects or module (i.e. news, documents, wiki)
Returns
string

◆ object_kill_views()

object_kill_views (   $object_id)

◆ object_kill_visits()

object_kill_visits (   $user_id,
  $object_ids = false 
)

◆ object_return_views()

object_return_views (   $object_id)

◆ object_set_visit()

object_set_visit (   $object_id,
  $plugin_id,
  $user_id = '' 
)

This function saves the actual time as last visitdate for the given object, user and type

Parameters
stringthe id of the object (i.e. seminar_id, news_id, vote_id)
stringthe type of visited object or module (i.e. news, documents, wiki - see /lib/classes/Modules.class.php for definitions)
stringthe user who visited the object - if not given, the actual user is used

◆ object_set_visit_module()

object_set_visit_module (   $plugin_id)

◆ object_type_to_id()

object_type_to_id (   $type)

converts a ouv type to an id

Parameters
$typestring former used type of visited objects or module (i.e. news, documents, wiki)
Returns
?int