addInfoMessage(_kt('Cannot find the notification you requested. Notification may already have been cleared.')); exit(redirect(generateControllerLink('dashboard'))); } $this->notification =& $oKTNotification; return true; } function do_main() { $clear_all = KTUtil::arrayGet($_REQUEST, 'clearAll'); if ($clear_all) { return $this->clearAll(); } // get the notification-handler, instantiate it, call resolveNotification. $oHandler =& $this->notification->getHandler(); $oHandler->notification =& $this->notification; $oHandler->subDispatch($this); exit(0); } function clearAll() { $this->startTransaction(); $aNotifications = KTNotification::getList('user_id = ' . $this->oUser->getId()); foreach ($aNotifications as $oNotification) { $res = $oNotification->delete(); if (PEAR::isError($res)) { $this->rollbackTransaction(); $this->addErrorMessage(_kt('Failed to clear notifications.')); exit(redirect(generateControllerLink('dashboard'))); } } $this->commitTransaction(); $this->addInfoMessage(_kt('Notifications cleared.')); exit(redirect(generateControllerLink('dashboard'))); } } $dispatcher =& new KTNotificationDispatcher(); $dispatcher->dispatch();