Beispiel #1
0
 private function _deleteIdAction($path)
 {
     $in_id = array_shift($path);
     if (empty($in_id)) {
         $this->_error("ID was not provided.");
     }
     if (null == ($event = DAO_WorkerEvent::get($in_id))) {
         $this->_error("ID is not valid.");
     }
     DAO_WorkerEvent::delete($event->id);
     $out_xml = new SimpleXMLElement('<success></success>');
     $this->_render($out_xml->asXML());
 }
Beispiel #2
0
 /**
  * Open an event, mark it read, and redirect to its URL.
  * Used by Home->Notifications view.
  *
  */
 function redirectReadAction()
 {
     $worker = PortSensorApplication::getActiveWorker();
     $request = DevblocksPlatform::getHttpRequest();
     $stack = $request->path;
     array_shift($stack);
     // home
     array_shift($stack);
     // redirectReadAction
     @($id = array_shift($stack));
     // id
     if (null != ($event = DAO_WorkerEvent::get($id))) {
         // Mark as read before we redirect
         DAO_WorkerEvent::update($id, array(DAO_WorkerEvent::IS_READ => 1));
         DAO_WorkerEvent::clearCountCache($worker->id);
         session_write_close();
         header("Location: " . $event->url);
     }
     exit;
 }