X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Faccountprofileblock.php;h=59c27776018dac7c2bfddaf27e5557bf120bf0e0;hb=c4fd560b32344933f554fe151cffb04664cf138a;hp=61b65435abff40a7f49f1e1ab3e530456eee7147;hpb=31c1177970124cee31823cab3a11542c23b4126d;p=quix0rs-gnu-social.git diff --git a/lib/accountprofileblock.php b/lib/accountprofileblock.php index 61b65435ab..59c2777601 100644 --- a/lib/accountprofileblock.php +++ b/lib/accountprofileblock.php @@ -34,6 +34,8 @@ if (!defined('STATUSNET')) { exit(1); } +require_once INSTALLDIR.'/lib/peopletags.php'; + /** * Profile block to show for an account * @@ -44,7 +46,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AccountProfileBlock extends ProfileBlock { protected $profile = null; @@ -93,6 +94,22 @@ class AccountProfileBlock extends ProfileBlock return $this->profile->bio; } + function showTags() + { + $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(); + } + } + } + function showActions() { if (Event::handle('StartProfilePageActionsSection', array($this->out, $this->profile))) { @@ -131,9 +148,9 @@ class AccountProfileBlock extends ProfileBlock $this->out->elementStart('li', 'entity_edit'); $this->out->element('a', array('href' => common_local_url('profilesettings'), // TRANS: Link title for link on user profile. - 'title' => _('Edit profile settings')), + 'title' => _('Edit profile settings.')), // TRANS: Link text for link on user profile. - _('Edit')); + _m('BUTTON','Edit')); $this->out->elementEnd('li'); } else { // someone else's page @@ -144,6 +161,9 @@ class AccountProfileBlock extends ProfileBlock if ($cur->isSubscribed($this->profile)) { $usf = new UnsubscribeForm($this->out, $this->profile); $usf->show(); + } else if ($cur->hasPendingSubscription($this->profile)) { + $sf = new CancelSubscriptionForm($this->out, $this->profile); + $sf->show(); } else { $sf = new SubscribeForm($this->out, $this->profile); $sf->show(); @@ -157,9 +177,9 @@ class AccountProfileBlock extends ProfileBlock $this->out->elementStart('li', 'entity_send-a-message'); $this->out->element('a', array('href' => common_local_url('newmessage', array('to' => $this->user->id)), // TRANS: Link title for link on user profile. - 'title' => _('Send a direct message to this user')), + 'title' => _('Send a direct message to this user.')), // TRANS: Link text for link on user profile. - _('Message')); + _m('BUTTON','Message')); $this->out->elementEnd('li'); // nudge @@ -285,6 +305,16 @@ class AccountProfileBlock extends ProfileBlock $this->out->element('a', array('href' => $url, 'class' => 'entity_remote_subscribe'), // TRANS: Link text for link that will subscribe to a remote profile. - _('Subscribe')); + _m('BUTTON','Subscribe')); + } + + function show() + { + $this->out->elementStart('div', 'profile_block account_profile_block section'); + if (Event::handle('StartShowAccountProfileBlock', array($this->out, $this->profile))) { + parent::show(); + Event::handle('EndShowAccountProfileBlock', array($this->out, $this->profile)); + } + $this->out->elementEnd('div'); } }