]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/tagprofile.php
Initial move towards microformats2
[quix0rs-gnu-social.git] / actions / tagprofile.php
index 4305f4bc885f45643b13941d4fb79b1463601a2c..a79ebf1d2563822ee9bec9d1b17b3fa01ac770e9 100644 (file)
@@ -41,12 +41,11 @@ class TagprofileAction extends Action
         if (!$id) {
             $this->profile = false;
         } else {
-            $this->profile = Profile::staticGet('id', $id);
+            $this->profile = Profile::getKV('id', $id);
 
             if (!$this->profile) {
                 // TRANS: Client error displayed when referring to non-existing profile ID.
                 $this->clientError(_('No profile with that ID.'));
-                return false;
             }
         }
 
@@ -55,7 +54,6 @@ class TagprofileAction extends Action
             // TRANS: Client error displayed when trying to tag a user that cannot be tagged.
             $this->clientError(_('You cannot tag this user.'));
         }
-        return true;
     }
 
     function handle($args)
@@ -94,7 +92,7 @@ class TagprofileAction extends Action
             $this->elementStart('body');
             $this->element('p', 'error', $error);
             $this->elementEnd('body');
-            $this->elementEnd('html');
+            $this->endHTML();
         } else {
             $this->showPage();
         }
@@ -103,12 +101,12 @@ class TagprofileAction extends Action
     function showContent()
     {
         if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) {
-            $this->elementStart('div', 'entity_profile vcard author');
+            $this->elementStart('div', 'entity_profile h-card p-author');
             // TRANS: Header in list form.
             $this->element('h2', null, _('User profile'));
 
-            $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
-            $this->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE),
+            $avatarUrl = $this->profile->avatarUrl(AVATAR_PROFILE_SIZE);
+            $this->element('img', array('src' => $avatarUrl,
                                         'class' => 'photo avatar entity_depiction',
                                         'width' => AVATAR_PROFILE_SIZE,
                                         'height' => AVATAR_PROFILE_SIZE,
@@ -120,7 +118,7 @@ class TagprofileAction extends Action
                                       'class' => 'entity_nickname nickname'),
                            $this->profile->nickname);
             if ($this->profile->fullname) {
-                $this->element('div', 'fn entity_fn', $this->profile->fullname);
+                $this->element('div', 'p-name entity_fn', $this->profile->fullname);
             }
 
             if ($this->profile->location) {
@@ -130,7 +128,7 @@ class TagprofileAction extends Action
             if ($this->profile->homepage) {
                 $this->element('a', array('href' => $this->profile->homepage,
                                           'rel' => 'me',
-                                          'class' => 'url entity_url'),
+                                          'class' => 'u-url entity_url'),
                                $this->profile->homepage);
             }
 
@@ -238,7 +236,7 @@ class TagprofileAction extends Action
                 }
 
                 $this->elementEnd('body');
-                $this->elementEnd('html');
+                $this->endHTML();
             } else {
                 // TRANS: Success message if lists are saved.
                 $this->error = _('Lists saved.');