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;
}
}
/**
* 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 string $message
* @return string
*/
public static function notify( array $_receivers, $_message ) {
$notification = new notification();
$notification->set_receivers( $_receivers );
$notification->set_message( $_message );
try{
$notification->send();
}
catch(Exception $exception) {
return $exception->getMessage();
}
return null;
}
/**
* Small helper function to just send a message
*
* @param array $receivers
* @param string $message
* @return Exception
*/
function notify(array $receivers,$message)
{
$notification = new notification();
$notification->set_receivers($receivers);
$notification->set_message($message);
try{
$notification->send();
}
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.
// otherwise we have to fetch this objects for current user.
if (!is_object($_account)) {
$_account = (object) $GLOBALS['egw']->accounts->read($_account);
$_account->id =& $_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];
$this->account = (object) $GLOBALS['egw']->accounts->read($_account);
$this->account->id =& $this->account->account_id;
}
else {
$this->account = $_account;