]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/userprofile.php
add forms for silence, sandbox, delete user
[quix0rs-gnu-social.git] / lib / userprofile.php
index 4f9d4984f4e9ef69f8a2e6b0095228b4bebb2efd..4321a2f93977cc3d4a990f2de5d954f34ad78879 100644 (file)
@@ -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');
+                        }
                     }
                 }