FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Notifications_Controller Class Reference
Inheritance diagram for Notifications_Controller:
Controller

Public Member Functions

 __construct ()
 Only enable if notification enabled.
 member ($member_id=NULL)
 Notification setting for member.
 members ($message_id=NULL)
 Activates notifications for members.
 subnet ($subnet_id=NULL, $message_id=NULL)
 Notification setting to subnet.
 cloud ($cloud_id=NULL, $message_id=NULL)
 Notification setting to cloud.
 device ($device_id=NULL)
 Notification setting for device admins.
 devices ($message_id=NULL)
 Notification setting for devices admins.
- Public Member Functions inherited from Controller
 is_user_in_group ($aro_group_id, $aro_id)
 Checks if user is in ARO group.
 acl_check_view ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may view all $axo_value object in $axo_section else return false.
 acl_check_edit ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may edit all $axo_value object in $axo_section else return false.
 acl_check_new ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may add all $axo_value object in $axo_section else return false.
 acl_check_delete ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may delete all $axo_value object in $axo_section else return false.
 build_menu ()
 Build menu.
 url ()
 Return URL for controller and method.
 redirect ($uri=NULL, $id=NULL, $glue= '/')
 Redirects to uri according to attribute noredirect.

Static Public Member Functions

static notify (Message_Model $message, $members, $user_id=NULL, $comment=NULL, $activate_redir=TRUE, $activate_email=TRUE, $activate_sms=TRUE, $truncate_redir=FALSE, $remove_redir=FALSE, $notify_former_members=FALSE, $notify_interrupted_members=FALSE, $notification_type=self::TYPE_MEMBER, $ignore_member_notif_settings=FALSE)
 Activate notification of message for the given memebers and given restrictions.
static notify_from_form (Message_Model $message, $user_id, $comment, $to_redirect, $to_notify_by_email, $to_notify_by_sms, $notification_type=self::TYPE_MEMBER)
 Transform the result of notification form that is used in many controllers (Message_Controller::activate, Notifications_Controller::members, ...) to the form that is acceptable by notify method and make notification by using notify menthod of this class.
- Static Public Member Functions inherited from Controller
static & instance ()
 Singleton instance of Controller.
static error ($message_type, $content=NULL)
 Function shows error of given message number.
static warning ($message_type, $content=NULL)
 Function shows warning of given message number.

Public Attributes

const ACTIVATE = 1
 activate notification
const KEEP = 2
 keep current settings
const DEACTIVATE = 3
 deactivate notification
const TYPE_MEMBER = 1
 Notification is applicated on members (all its users)
const TYPE_USER = 2
 Notification is applicated on users.
- Public Attributes inherited from Controller
const ICON_ERROR = 1
const ICON_GOOD = 2
const ICON_HELP = 3
const ICON_INFO = 4
const ICON_WARNING = 5
 $arr
 $settings = NULL
 $popup = 0
 $dialog = 0
 $noredirect = FALSE
 $user_has_voip = 0
 $ip_address_span = ''
 $unread_user_mails = 0
 $count_of_unclosed_logged_errors = 0
 $devices_down_count = 0
 $user_favourites_pages = NULL
 $axo_doc_access = FALSE

Additional Inherited Members

- Protected Member Functions inherited from Controller
 is_preprocesor_enabled ()
 This methods defines whether the preprocessor of MY_Controller is loaded or not.
- Protected Attributes inherited from Controller
 $member_id
 $user_id
 $member_account_id = 1
 $session

Member Function Documentation

Notifications_Controller::cloud (   $cloud_id = NULL,
  $message_id = NULL 
)

Notification setting to cloud.

Author
Michal Kliment
Parameters
integer$cloud_id
Notifications_Controller::device (   $device_id = NULL)

Notification setting for device admins.

Author
David Raška
Parameters
integer$device_id
Notifications_Controller::devices (   $message_id = NULL)

Notification setting for devices admins.

Author
David Raška
Parameters
integer$message_id
Notifications_Controller::member (   $member_id = NULL)

Notification setting for member.

Author
Michal Kliment
Parameters
integer$member_id
Notifications_Controller::members (   $message_id = NULL)

Activates notifications for members.

Author
Michal Kliment
Parameters
integer$message_id
static Notifications_Controller::notify ( Message_Model  $message,
  $members,
  $user_id = NULL,
  $comment = NULL,
  $activate_redir = TRUE,
  $activate_email = TRUE,
  $activate_sms = TRUE,
  $truncate_redir = FALSE,
  $remove_redir = FALSE,
  $notify_former_members = FALSE,
  $notify_interrupted_members = FALSE,
  $notification_type = self::TYPE_MEMBER,
  $ignore_member_notif_settings = FALSE 
)
static

Activate notification of message for the given memebers and given restrictions.

This method checks internally if redir/e-mail/sms are enabled.

Author
Ondrej Fibich
Parameters
Message_Model$messageMessage that should be notified
array$membersArray of members object (Database_Result or Member_model or some associative array) that contains properties: member_id, whitelisted
integer$user_idWho notify or on empty association main user [optional]
string$commentComment for the message [optional]
boolean$activate_redirShould be redirection activated [optional]
boolean$activate_emailShould be E-mail activated [optional]
boolean$activate_smsShould be SMS activated [optional]
boolean$truncate_redirShould be all redirection of this type removed before adding [optional]
boolean$remove_redirThis option my be set to TRUE only for removing of redirection for some members. Commonly it is used with previous bool params setted to FALSE for deactivation. [optional]
boolean$notify_former_membersCan be former members notified? [optional]
boolean$notify_interrupted_membersCan be interrupted members notified? [optional]
integer$notification_typeDefines type of notification:
  • notification to members (members arrays contains member IDs) [default]
  • notification to users (members arrays contains user IDs)
boolean$ignore_member_notif_settingsShould be member notification setting ignored?
Returns
array stats of count of added (keys redirection, email, sms)
Exceptions
ExceptionOn any error with translated message
static Notifications_Controller::notify_from_form ( Message_Model  $message,
  $user_id,
  $comment,
  $to_redirect,
  $to_notify_by_email,
  $to_notify_by_sms,
  $notification_type = self::TYPE_MEMBER 
)
static

Transform the result of notification form that is used in many controllers (Message_Controller::activate, Notifications_Controller::members, ...) to the form that is acceptable by notify method and make notification by using notify menthod of this class.

This method checks internally if redir/e-mail/sms are enabled.

Author
Ondrej Fibich
See Also
Notifications_Controller::notify
Parameters
Message_Model$messageMessage that should be notified
integer$user_idWho notify or on empty association main user
string$commentComment for the message
array$to_redirectArray with affected member IDs or user IDs as key and each value is one of the KEEP, ACTIVATE and DEACTIVATE constants
array$to_notify_by_emailArray with affected member IDs or user IDs as key and each value is one of the KEEP, ACTIVATE constants
array$to_notify_by_smsArray with affected member IDs or user IDs as key and each value is one of the KEEP, ACTIVATE constants
integer$notification_typeDefines type of notification:
  • notification to members (all previous arrays contains member IDs) [default]
  • notification to users (all previous arrays contains user IDs)
Returns
array stats of count of added (keys redirection, email, sms)
Exceptions
ExceptionOn any error with translated message
Notifications_Controller::subnet (   $subnet_id = NULL,
  $message_id = NULL 
)

Notification setting to subnet.

Author
Michal Kliment
Parameters
integer$subnet_id

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