summaryrefslogtreecommitdiff
path: root/lib/profilelist.php
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2009-03-07 01:43:55 +0100
committerAdrian Lang <mail@adrianlang.de>2009-03-11 10:38:58 +0100
commit00c14d22ded3868939f4999daa0a3c3e4203c20e (patch)
tree45c36b75fc4795fb083b996f49bc2c982f37335a /lib/profilelist.php
parenta547c5f642c23dd4f1c83b4a1500914c0ef1c861 (diff)
Remove comparison with member variable of null variable, cleaned code a bit.
Diffstat (limited to 'lib/profilelist.php')
-rw-r--r--lib/profilelist.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/profilelist.php b/lib/profilelist.php
index 75053b7a4..898200d2d 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) && ($user->id === $this->user->id);
$this->out->elementStart('div', 'entity_profile vcard');
@@ -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');
}