summaryrefslogtreecommitdiff
path: root/lib/userprofile.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-15 16:00:29 +0100
committerEvan Prodromou <evan@status.net>2009-11-15 16:00:29 +0100
commitd24ed193e7b19b50f7304790820c945e46ac2c95 (patch)
tree640938ae269f9490cec5a8eca4761fa216886130 /lib/userprofile.php
parentc9475c76a8b4c2bf32d1d3293b03b646e7e7a91e (diff)
add forms for silence, sandbox, delete user
Diffstat (limited to 'lib/userprofile.php')
-rw-r--r--lib/userprofile.php44
1 files changed, 38 insertions, 6 deletions
diff --git a/lib/userprofile.php b/lib/userprofile.php
index 4f9d4984f..4321a2f93 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -283,22 +283,54 @@ 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);
+
// block/unblock
$blocked = $cur->hasBlocked($this->profile);
$this->out->elementStart('li', 'entity_block');
if ($blocked) {
- $ubf = new UnblockForm($this->out, $this->profile,
- array('action' => 'showstream',
- 'nickname' => $this->profile->nickname));
+ $ubf = new UnblockForm($this->out, $this->profile, $r2args);
$ubf->show();
} else {
- $bf = new BlockForm($this->out, $this->profile,
- array('action' => 'showstream',
- 'nickname' => $this->profile->nickname));
+ $bf = new BlockForm($this->out, $this->profile, $r2args);
$bf->show();
}
$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();
+ }
+ $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();
+ }
+ $this->out->elementEnd('li');
+ }
+
+ if ($cur->hasRight(Right::DELETEUSER)) {
+ $this->out->elementStart('li', 'entity_delete');
+ $df = DeleteUserForm($this->out, $this->profile, $r2args);
+ $df->show();
+ $this->out->elementEnd('li');
+ }
}
}