Fix owner deletion on MLs.
[platal.git] / modules / carnet / feed.inc.php
index 2f1a926..a69e65b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -27,7 +27,7 @@ class CarnetFeedIterator implements PlIterator
     private $notifs;
     private $it;
 
-    public function __construct(PlUser &$owner)
+    public function __construct(PlUser $owner)
     {
         $notifs = Watch::getEvents($owner);
         $infos  = array();
@@ -37,6 +37,7 @@ class CarnetFeedIterator implements PlIterator
                 $date = $op->getDate($user);
                 @$datetext = new Date($date);
                 @$datetext = $datetext->format('%e %B %Y');
+                $profile = $user->profile();
                 $infos[] = array('operation'   => $op,
                                  'title'       => '[' . $op->getTitle(1) . ']  - ' . $user->fullName() . ' le ' . $datetext,
                                  'author'      => $user->fullName(),
@@ -47,8 +48,9 @@ class CarnetFeedIterator implements PlIterator
                                  'hruid'       => $user->login(),
                                  'dead'        => $user->deathdate,
                                  'profile'     => $user->profile()->hrid(),
+                                 'link'        => Platal::globals()->baseurl . '/profile/' . $profile->hrid(),
                                  'user'        => $user,
-                                 'contact'     => $owner->isContact($user));
+                                 'contact'     => $owner->isContact($profile));
             }
         }
         $this->it = PlIteratorUtils::fromArray($infos);
@@ -88,11 +90,11 @@ class CarnetFeed extends PlFeed
                             'carnet/rss.tpl');
     }
 
-    protected function fetch(PlUser &$user)
+    protected function fetch(PlUser $user)
     {
         return new CarnetFeedIterator($user);
     }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>