fix: notification popup where broken after ralfs changes, nicify this chagnes

This commit is contained in:
Cornelius Weiß 2007-06-01 11:43:08 +00:00
parent 688dd5f46f
commit 90c5388542
2 changed files with 24 additions and 28 deletions

View File

@ -125,26 +125,26 @@ final class notification {
return $this->receivers; return $this->receivers;
} }
} /**
* Small helper function to just send a message
/** *
* Small helper function to just send a message * @abstract To stay php4 compatible for the 1.4 release we don't
* * throw exeptions here. This behaviour will change after 1.4!
* @param array $receivers * @param array $receivers
* @param string $message * @param string $message
* @return Exception * @return string
*/ */
function notify(array $receivers,$message) public static function notify( array $_receivers, $_message ) {
{ $notification = new notification();
$notification = new notification(); $notification->set_receivers( $_receivers );
$notification->set_receivers($receivers); $notification->set_message( $_message );
$notification->set_message($message); try{
try{ $notification->send();
$notification->send(); }
catch(Exception $exception) {
return $exception->getMessage();
}
return null;
} }
catch(Exception $exception) {
error_log("notify(array($user),'$message'".$exception->getMessage()); }
return $exception;
}
return null;
}

View File

@ -68,12 +68,8 @@ class notification_popup implements iface_notification {
// If we are called from class notification account and prefs are objects. // If we are called from class notification account and prefs are objects.
// otherwise we have to fetch this objects for current user. // otherwise we have to fetch this objects for current user.
if (!is_object($_account)) { if (!is_object($_account)) {
$_account = (object) $GLOBALS['egw']->accounts->read($_account); $this->account = (object) $GLOBALS['egw']->accounts->read($_account);
$_account->id =& $_account->account_id; $this->account->id =& $this->account->account_id;
// $account_id = $GLOBALS['egw_info']['user']['account_id'];
// $this->account = $GLOBALS['egw']->accounts->get_account_data($account_id);
// $this->account[$account_id]['id'] = $account_id;
// $this->account = (object)$this->account[$account_id];
} }
else { else {
$this->account = $_account; $this->account = $_account;