You are here

public function Notifications_Message::set_sender in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/notifications_message.class.inc \Notifications_Message::set_sender()
  2. 6.3 classes/notifications_message.class.inc \Notifications_Message::set_sender()

Set message sender. Depending on options this will set sender account too.

Optional sender, if chosen will be the user account who produced the event It will be up to the sending method modules what to do with this information.

File

./notifications.message.inc, line 70
Drupal Notifications Framework - Default class file

Class

Notifications_Message
Wrapper for Notifications messages

Code

public function set_sender($account) {
  $sender_option = variable_get('notifications_sender', 0);
  if ($sender_option) {
    $sender = is_numeric($account) ? notifications_load_user($account) : $account;
    if ($sender_option == 2) {
      parent::set_sender($sender);
    }
    else {
      $this->sender = 0;
      $this->sender_name = $sender->name;
    }
  }
}