summaryrefslogtreecommitdiff
path: root/lib/profilelist.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-03-12 11:56:23 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-03-12 11:56:23 -0400
commitb3a0eea3b66e95becb6c4595ed71c7fe71ed6437 (patch)
tree76666150701f03205bfff77e7d034dfa724f8764 /lib/profilelist.php
parent399669b1fb955d2d8c18098a7b551184d534a94c (diff)
parente185c0395a6cd250ccd7c8e385c54830be73f937 (diff)
Merge branch '0.7.x' into 0.8.x
Conflicts: classes/Notice.php lib/action.php lib/router.php lib/twitter.php
Diffstat (limited to 'lib/profilelist.php')
-rw-r--r--lib/profilelist.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php
index c2040fbc2..766189ab4 100644
--- a/lib/profilelist.php
+++ b/lib/profilelist.php
@@ -89,6 +89,7 @@ class ProfileList extends Widget
'id' => 'profile-' . $this->profile->id));
$user = common_current_user();
+ $is_own = !is_null($user) && isset($this->user) && ($user->id === $this->user->id);
$this->out->elementStart('div', 'entity_profile vcard');
@@ -102,13 +103,13 @@ class ProfileList extends Widget
'alt' =>
($this->profile->fullname) ? $this->profile->fullname :
$this->profile->nickname));
- $hasFN = ($this->profile->fullname) ? 'nickname' : 'fn nickname';
+ $hasFN = ($this->profile->fullname !== '') ? 'nickname' : 'fn nickname';
$this->out->elementStart('span', $hasFN);
$this->out->raw($this->highlight($this->profile->nickname));
$this->out->elementEnd('span');
$this->out->elementEnd('a');
- if ($this->profile->fullname) {
+ if ($this->profile->fullname !== '') {
$this->out->elementStart('dl', 'entity_fn');
$this->out->element('dt', null, 'Full name');
$this->out->elementStart('dd');
@@ -118,7 +119,7 @@ class ProfileList extends Widget
$this->out->elementEnd('dd');
$this->out->elementEnd('dl');
}
- if ($this->profile->location) {
+ if ($this->profile->location !== '') {
$this->out->elementStart('dl', 'entity_location');
$this->out->element('dt', null, _('Location'));
$this->out->elementStart('dd', 'label');
@@ -126,7 +127,7 @@ class ProfileList extends Widget
$this->out->elementEnd('dd');
$this->out->elementEnd('dl');
}
- if ($this->profile->homepage) {
+ if ($this->profile->homepage !== '') {
$this->out->elementStart('dl', 'entity_url');
$this->out->element('dt', null, _('URL'));
$this->out->elementStart('dd');
@@ -137,7 +138,7 @@ class ProfileList extends Widget
$this->out->elementEnd('dd');
$this->out->elementEnd('dl');
}
- if ($this->profile->bio) {
+ if ($this->profile->bio !== '') {
$this->out->elementStart('dl', 'entity_note');
$this->out->element('dt', null, _('Note'));
$this->out->elementStart('dd', 'note');
@@ -154,7 +155,7 @@ class ProfileList extends Widget
$this->out->elementStart('dl', 'entity_tags');
$this->out->elementStart('dt');
- if ($user->id == $this->owner->id) {
+ if ($is_own) {
$this->out->element('a', array('href' => common_local_url('tagother',
array('id' => $this->profile->id))),
_('Tags'));
@@ -183,7 +184,7 @@ class ProfileList extends Widget
$this->out->elementEnd('dl');
}
- if ($user && $user->id == $this->owner->id) {
+ if ($is_own) {
$this->showOwnerControls($this->profile);
}
@@ -193,11 +194,11 @@ class ProfileList extends Widget
$this->out->elementStart('ul');
- if ($user && $user->id != $this->profile->id) {
+ if (!$is_own) {
# XXX: special-case for user looking at own
# subscriptions page
$this->out->elementStart('li', 'entity_subscribe');
- if ($user->isSubscribed($this->profile)) {
+ if (!is_null($user) && $user->isSubscribed($this->profile)) {
$usf = new UnsubscribeForm($this->out, $this->profile);
$usf->show();
} else {
@@ -206,9 +207,6 @@ class ProfileList extends Widget
}
$this->out->elementEnd('li');
$this->out->elementStart('li', 'entity_block');
- if ($user && $user->id == $this->owner->id) {
- $this->showBlockForm();
- }
$this->out->elementEnd('li');
}