]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/userprofile.php
people tag UI elements
[quix0rs-gnu-social.git] / lib / userprofile.php
index 0b7efb22fc6bceb6587374f3f6342a87a988784d..66d049e9e52e0bc7278e864ad6fc953b753530d6 100644 (file)
@@ -33,6 +33,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 }
 
 require_once INSTALLDIR.'/lib/widget.php';
+require_once INSTALLDIR.'/lib/peopletags.php';
 
 /**
  * Profile of a user
@@ -188,23 +189,17 @@ class UserProfile extends Widget
 
     function showProfileTags()
     {
-        if (Event::handle('StartProfilePageProfileTags', array($this->out, $this->profile))) {
-            $tags = Profile_tag::getTags($this->profile->id, $this->profile->id);
-
-            if (count($tags) > 0) {
-                $this->out->elementStart('ul', 'tags xoxo entity_tags');
-                foreach ($tags as $tag) {
-                    $this->out->elementStart('li');
-                    // Avoid space by using raw output.
-                    $pt = '<span class="mark_hash">#</span><a rel="tag" href="' .
-                      common_local_url('peopletag', array('tag' => $tag)) .
-                      '">' . $tag . '</a>';
-                    $this->out->raw($pt);
-                    $this->out->elementEnd('li');
-                }
-                $this->out->elementEnd('ul');
+        $cur = common_current_user();
+
+        $self_tags = new SelftagsWidget($this->out, $this->profile, $this->profile);
+        $self_tags->show();
+
+        if ($cur) {
+            // don't show self-tags again
+            if ($cur->id != $this->profile->id && $cur->getProfile()->canTag($this->profile)) {
+                $tags = new PeopletagsWidget($this->out, $cur, $this->profile);
+                $tags->show();
             }
-            Event::handle('EndProfilePageProfileTags', array($this->out, $this->profile));
         }
     }