summaryrefslogtreecommitdiff
path: root/lib/userprofile.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-26 18:46:11 +0000
committerSarven Capadisli <csarven@status.net>2009-11-26 18:46:11 +0000
commit5f5a107991478824133c6e0d67aeb1a7efb8e213 (patch)
treef47a7b686b37a4fc389191e936fc1475d87682cc /lib/userprofile.php
parentb4ad7d1a237ba5af75a0cf5bc00cc223ff3b7e26 (diff)
Init UI to show/hide a group of moderation actions.
Diffstat (limited to 'lib/userprofile.php')
-rw-r--r--lib/userprofile.php57
1 files changed, 33 insertions, 24 deletions
diff --git a/lib/userprofile.php b/lib/userprofile.php
index ee205af85..07e575085 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -304,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');
}
}