Stud.IP
4.2 Revision
|
Static Public Member Functions | |
static | doGarbageCollect () |
static | add ($user_ids, $url, $text, $html_id=null, $avatar=null, $dialog=false) |
static | getMyNotifications ($only_unread=true, $user_id=null, $limit=15) |
static | markAsRead ($notification_id, $user_id=null) |
static | markAllAsRead ($user_id=null) |
static | markAsReadByHTML ($html_id, $user_id=null) |
static | activate ($user_id=null) |
static | deactivate ($user_id=null) |
static | activateAudioFeedback ($user_id=null) |
static | deactivateAudioFeedback ($user_id=null) |
static | isGloballyActivated () |
static | isActivated ($user_id=null) |
static | isAudioActivated ($user_id=null) |
![]() | |
static | tableScheme ($db_table) |
static | expireTableScheme () |
static | find ($id) |
static | exists ($id) |
static | countBySql ($sql=1, $params=array()) |
static | create ($data) |
static | build ($data, $is_new=true) |
static | buildExisting ($data) |
static | import ($data) |
static | findBySQL ($sql, $params=array()) |
static | findOneBySQL ($where, $params=array()) |
static | findThru ($foreign_key_value, $options) |
static | findEachBySQL ($callable, $sql, $params=array()) |
static | findMany ($pks=array(), $order='', $order_params=array()) |
static | findEachMany ($callable, $pks=array(), $order='', $order_params=array()) |
static | findAndMapBySQL ($callable, $where, $params=array()) |
static | findAndMapMany ($callable, $pks=array(), $order='', $order_params=array()) |
static | deleteBySQL ($where, $params=array()) |
static | toObject ($id_or_object) |
static | __callStatic ($name, $arguments) |
Data Fields | |
const | GC_MAX_DAYS = 30 |
const | CACHE_DURATION = 86400 |
Protected Member Functions | |
cbExpireCache ($notification) | |
![]() | |
_getId ($field) | |
_setId ($field, $value) | |
_getAdditionalValueFromRelation ($field) | |
_setAdditionalValueFromRelation ($field, $value) | |
_getAdditionalValue ($field) | |
_setAdditionalValue ($field, $value) | |
parseRelationOptions ($type, $name, $options) | |
storeRelations ($only_these=null) | |
deleteRelations () | |
initializeContent () | |
applyCallbacks ($type) | |
registerCallback ($types, $cb) | |
unregisterCallback ($types, $cb) | |
cbAutoIncrementColumn ($type) | |
cbAutoKeyCreation () | |
cbNotificationMapper ($cb_type) | |
cbAfterInitialize ($cb_type) | |
setSerializedValue ($field, $value) | |
setI18nValue ($field, $value) | |
cbI18N ($type) | |
Static Protected Member Functions | |
static | configure ($config=array()) |
static | getCacheHash ($user_id) |
static | getCache ($user_id) |
static | setCache ($user_id, $items) |
static | expireCache ($user_id) |
![]() | |
static | configure ($config=array()) |
static | config ($key) |
Protected Attributes | |
$unseen = null | |
![]() | |
$content = array() | |
$content_db = array() | |
$is_new = true | |
$is_deleted = false | |
$db_table = '' | |
$db_fields = null | |
$pk = null | |
$default_values = array() | |
$serialized_fields = array() | |
$alias_fields = array() | |
$i18n_fields = array() | |
$additional_fields = array() | |
$relations = array() | |
$has_many = array() | |
$has_one = array() | |
$belongs_to = array() | |
$has_and_belongs_to_many = array() | |
$registered_callbacks = array() | |
$known_slots = array() | |
$notification_map = array() | |
$additional_data = array() | |
$getter_setter_map = array() | |
Additional Inherited Members | |
![]() | |
static | $schemes = null |
![]() | |
static | $config = array() |
static | $reserved_slots = array('value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id') |
|
static |
Activates personal notifications for a given user.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Activates audio plopp for new personal notifications for a given user.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Central function to add a personal notification to the user. This could be anything that needs to catch the attention of the user. The notification will be displayed in realtime to the user and he/she can get to the url.
array | string | $user_ids | : array of user_ids or a single md5-user_id |
string | $url | : URL of the point of interest of the notification |
string | $text | : a displayed text that describes the notification |
null | string | $html_id | : id in the html-document. If user reaches this html-element the notification will be marked as read, so the user does not need to handle the information twice. Optional. Default: null |
Icon | string | $avatar | : either an Icon or a URL of an image for the notification. Best size: 40px x 40px |
|
protected |
|
staticprotected |
|
static |
Deactivates personal notifications for a given user.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Deactivates audio plopp for new personal notifications for a given user.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Garbage collector the personal notifications. Removes all notifications older than 30 days.
|
staticprotected |
Removes the cached entries for a specific user.
String | $user_id | Id of the user |
|
staticprotected |
Returns the cached values for a specific user.
String | $user_id | Id of the user |
|
staticprotected |
Returns the cache hash to use for a specific user.
String | $user_id | Id of the user |
getLiElement | ( | ) |
Returns HTML-represantation of the notification which is a list-element.
getmore_unseen | ( | ) |
Returns (or retrieves) the number of "more unseen" notifications.
|
static |
Returns all notifications fitting to the parameters.
boolean | $only_unread | : true for getting only unread notifications, false for all. |
null | string | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Checks if a given user should see the personal notification. Either the Stud.IP or the user could deactivate personal notification. If neither is the case, this function returns true.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Checks if a given user should hear audio plopp for new personal notification. Either the Stud.IP or the user could deactivate personal notification or audio feedback. If neither is the case, this function returns true.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Checks if personal notifications are activated for the whole Stud.IP. This could be false for performance issues.
|
static |
Marks all notifications as read by the user. It won't appear anymore in the notification-list on top of its site.
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Mark a notification as read by the user. It won't appear anymore in the notification-list on top of its site.
string | $notification_id | : ID of the notification |
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
static |
Mark a notification as read for the user by the given HTML-ID. It won't appear anymore in the notification-list on top of its site.
string | $html_id | : HTML ID attribute of the notification |
string | null | $user_id | : ID of special user the notification should belong to or (default:) null for current user |
|
staticprotected |
Stored the provided item data in cache for a specific user.
String | $user_id | Id of the user |
Array | $items | Raw db data of the items |
setmore_unseen | ( | $unseen | ) |
Sets the value of the "more unseen" notifications (notification with same url but a different id).
int | $unseen | Number of more unseen notifications |
|
protected |
const CACHE_DURATION = 86400 |
const GC_MAX_DAYS = 30 |