コード例 #1
0
 static function item_deleted($item)
 {
     notification::send_item_deleted($item);
     if (notification::is_watching($item)) {
         notification::remove_watch($item);
     }
 }
コード例 #2
0
 static function item_deleted($item)
 {
     try {
         notification::send_item_deleted($item);
         if (notification::is_watching($item)) {
             notification::remove_watch($item);
         }
     } catch (Exception $e) {
         Kohana_Log::add("error", "@todo notification_event::item_deleted() failed");
         Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
     }
 }
コード例 #3
0
ファイル: notification.php プロジェクト: xafr/gallery3
 function watch($id)
 {
     access::verify_csrf();
     $item = ORM::factory("item", $id);
     access::required("view", $item);
     if (notification::is_watching($item)) {
         notification::remove_watch($item);
         message::success(sprintf(t("You are no longer watching %s"), $item->title));
     } else {
         notification::add_watch($item);
         message::success(sprintf(t("You are now watching %s"), $item->title));
     }
     url::redirect($item->url(array(), true));
 }
コード例 #4
0
 function watch($id)
 {
     access::verify_csrf();
     $item = ORM::factory("item", $id);
     access::required("view", $item);
     $watching = notification::is_watching($item);
     if (!$watching) {
         notification::add_watch($item);
         message::success(sprintf(t("Watch Enabled on %s!"), $item->title));
     } else {
         notification::remove_watch($item);
         message::success(sprintf(t("Watch Removed on %s!"), $item->title));
     }
     url::redirect($item->url());
 }