X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fnoticelist.php;h=3ef6691afa1f1ee06f33fef9e6b3f1f302b0ba00;hb=2d063650effb22c90936a4588f44946c69e1d9a1;hp=c57d6ce199471256726e4fcec6652cb7dd19e4f6;hpb=4b9df58c90e25ea79aeec64c6e96f828fe06d7df;p=quix0rs-gnu-social.git diff --git a/lib/noticelist.php b/lib/noticelist.php index c57d6ce199..3ef6691afa 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -22,6 +22,7 @@ * @category UI * @package Laconica * @author Evan Prodromou + * @author Sarven Capadisli * @copyright 2008 Control Yourself, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://laconi.ca/ @@ -202,11 +203,14 @@ class NoticeListItem extends Widget function showNoticeOptions() { - $this->out->elementStart('div', 'notice-options'); - $this->showFaveForm(); - $this->showReplyLink(); - $this->showDeleteLink(); - $this->out->elementEnd('div'); + $user = common_current_user(); + if ($user) { + $this->out->elementStart('div', 'notice-options'); + $this->showFaveForm(); + $this->showReplyLink(); + $this->showDeleteLink(); + $this->out->elementEnd('div'); + } } /** @@ -273,14 +277,19 @@ class NoticeListItem extends Widget function showAvatar() { - $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE); + if ('shownotice' === $this->out->trimmed('action')) { + $avatar_size = AVATAR_PROFILE_SIZE; + } else { + $avatar_size = AVATAR_STREAM_SIZE; + } + $avatar = $this->profile->getAvatar($avatar_size); $this->out->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : - common_default_avatar(AVATAR_STREAM_SIZE), + common_default_avatar($avatar_size), 'class' => 'avatar photo', - 'width' => AVATAR_STREAM_SIZE, - 'height' => AVATAR_STREAM_SIZE, + 'width' => $avatar_size, + 'height' => $avatar_size, 'alt' => ($this->profile->fullname) ? $this->profile->fullname : @@ -379,7 +388,7 @@ class NoticeListItem extends Widget case 'mail': case 'omb': case 'api': - $this->out->element('dd', 'noticesource', $source_name); + $this->out->element('dd', null, $source_name); break; default: $ns = Notice_source::staticGet($this->notice->source); @@ -390,7 +399,7 @@ class NoticeListItem extends Widget $ns->name); $this->out->elementEnd('dd'); } else { - $this->out->element('dd', 'noticesource', $source_name); + $this->out->element('dd', null, $source_name); } break; } @@ -434,16 +443,21 @@ class NoticeListItem extends Widget function showReplyLink() { - $reply_url = common_local_url('newnotice', - array('replyto' => $this->profile->nickname)); - - $this->out->elementStart('dl', 'notice_reply'); - $this->out->element('dt', null, _('Reply to this notice')); - $this->out->elementStart('dd'); - $this->out->element('a', array('href' => $reply_url, - 'title' => _('Reply to this notice')), _('Reply')); - $this->out->elementEnd('dd'); - $this->out->elementEnd('dl'); + if (common_logged_in()) { + $reply_url = common_local_url('newnotice', + array('replyto' => $this->profile->nickname)); + + $this->out->elementStart('dl', 'notice_reply'); + $this->out->element('dt', null, _('Reply to this notice')); + $this->out->elementStart('dd'); + $this->out->elementStart('a', array('href' => $reply_url, + 'title' => _('Reply to this notice'))); + $this->out->text(_('Reply')); + $this->out->element('span', 'notice_id', $this->notice->id); + $this->out->elementEnd('a'); + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); + } } /**