+
+ // Some actions won't be applicable to non-local users.
+ $isLocal = !empty($this->user);
+
+ if ($cur->hasRight(Right::SANDBOXUSER) ||
+ $cur->hasRight(Right::SILENCEUSER) ||
+ $cur->hasRight(Right::DELETEUSER)) {
+ $this->out->elementStart('li', 'entity_moderation');
+ // TRANS: Label text on user profile to select a user role.
+ $this->out->element('p', null, _('Moderate'));
+ $this->out->elementStart('ul');
+ if ($cur->hasRight(Right::SANDBOXUSER)) {
+ $this->out->elementStart('li', 'entity_sandbox');
+ if ($this->profile->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');
+ }
+
+ if ($cur->hasRight(Right::SILENCEUSER)) {
+ $this->out->elementStart('li', 'entity_silence');
+ if ($this->profile->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');
+ }
+
+ if ($isLocal && $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');
+ }
+
+ if ($isLocal && $cur->hasRight(Right::GRANTROLE)) {
+ $this->out->elementStart('li', 'entity_role');
+ // TRANS: Label text on user profile to select a user role.
+ $this->out->element('p', null, _('User role'));
+ $this->out->elementStart('ul');
+ // TRANS: Role that can be set for a user profile.
+ $this->roleButton('administrator', _m('role', 'Administrator'));
+ // TRANS: Role that can be set for a user profile.
+ $this->roleButton('moderator', _m('role', 'Moderator'));
+ $this->out->elementEnd('ul');
+ $this->out->elementEnd('li');
+ }