]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profilelistitem.php
Don't trust local HTML either
[quix0rs-gnu-social.git] / lib / profilelistitem.php
index e0b94ac76a67b07985f6f08a5ec7be4d49b4c593..e0e2838f58a3245525405035ad4b3f1eb291130b 100644 (file)
@@ -32,18 +32,26 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 class ProfileListItem extends Widget
 {
     /** Current profile. */
+    protected $target = null;
     var $profile = null;
     /** Action object using us. */
     var $action = null;
 
-    function __construct($profile, $action)
+    // FIXME: Directory plugin sends a User_group here, but should send a Profile and handle User_group specifics itself
+    function __construct($target, HTMLOutputter $action)
     {
         parent::__construct($action);
 
-        $this->profile = $profile;
+        $this->target = $target;
+        $this->profile = $this->target;
         $this->action  = $action;
     }
 
+    function getTarget()
+    {
+        return $this->target;
+    }
+
     function show()
     {
         if (Event::handle('StartProfileListItem', array($this))) {
@@ -64,7 +72,7 @@ class ProfileListItem extends Widget
     function startItem()
     {
         $this->out->elementStart('li', array('class' => 'profile',
-                                             'id' => 'profile-' . $this->profile->id));
+                                             'id' => 'profile-' . $this->getTarget()->getID()));
     }
 
     function showProfile()