X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fuserprofile.php;h=07e5750852eaa77a8e86eafd73e939296dd71eb0;hb=f6bf9529805cd58fdd1671dd9b133bde05e8ae87;hp=dedac5bf1bfd2188d8819cc4a38764be1d7c997b;hpb=a723cc979b5f93d6b688c5d19522cb27fa6c17eb;p=quix0rs-gnu-social.git diff --git a/lib/userprofile.php b/lib/userprofile.php index dedac5bf1b..07e5750852 100644 --- a/lib/userprofile.php +++ b/lib/userprofile.php @@ -285,8 +285,11 @@ class UserProfile extends Widget // return-to args, so we don't have to keep re-writing them - $r2args = array('action' => 'showstream', - 'nickname' => $this->profile->nickname); + list($action, $r2args) = $this->out->returnToArgs(); + + // push the action into the list + + $r2args['action'] = $action; // block/unblock @@ -301,34 +304,43 @@ class UserProfile extends Widget } $this->out->elementEnd('li'); - if ($cur->hasRight(Right::SANDBOXUSER)) { - $this->out->elementStart('li', 'entity_sandbox'); - if ($this->user->isSandboxed()) { - $usf = new UnSandboxForm($this->out, $this->profile, $r2args); - $usf->show(); - } else { - $sf = new SandboxForm($this->out, $this->profile, $r2args); - $sf->show(); + if ($cur->hasRight(Right::SANDBOXUSER) || + $cur->hasRight(Right::SILENCEUSER) || + $cur->hasRight(Right::DELETEUSER)) { + $this->out->elementStart('li', 'entity_moderation'); + $this->out->element('p', null, _('Moderate')); + $this->out->elementStart('ul'); + if ($cur->hasRight(Right::SANDBOXUSER)) { + $this->out->elementStart('li', 'entity_sandbox'); + if ($this->user->isSandboxed()) { + $usf = new UnSandboxForm($this->out, $this->profile, $r2args); + $usf->show(); + } else { + $sf = new SandboxForm($this->out, $this->profile, $r2args); + $sf->show(); + } + $this->out->elementEnd('li'); } - $this->out->elementEnd('li'); - } - if ($cur->hasRight(Right::SILENCEUSER)) { - $this->out->elementStart('li', 'entity_silence'); - if ($this->user->isSilenced()) { - $usf = new UnSilenceForm($this->out, $this->profile, $r2args); - $usf->show(); - } else { - $sf = new SilenceForm($this->out, $this->profile, $r2args); - $sf->show(); + if ($cur->hasRight(Right::SILENCEUSER)) { + $this->out->elementStart('li', 'entity_silence'); + if ($this->user->isSilenced()) { + $usf = new UnSilenceForm($this->out, $this->profile, $r2args); + $usf->show(); + } else { + $sf = new SilenceForm($this->out, $this->profile, $r2args); + $sf->show(); + } + $this->out->elementEnd('li'); } - $this->out->elementEnd('li'); - } - if ($cur->hasRight(Right::DELETEUSER)) { - $this->out->elementStart('li', 'entity_delete'); - $df = new DeleteUserForm($this->out, $this->profile, $r2args); - $df->show(); + if ($cur->hasRight(Right::DELETEUSER)) { + $this->out->elementStart('li', 'entity_delete'); + $df = new DeleteUserForm($this->out, $this->profile, $r2args); + $df->show(); + $this->out->elementEnd('li'); + } + $this->out->elementEnd('ul'); $this->out->elementEnd('li'); } }