]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Init UI to show/hide a group of moderation actions.
authorSarven Capadisli <csarven@status.net>
Thu, 26 Nov 2009 18:46:11 +0000 (18:46 +0000)
committerSarven Capadisli <csarven@status.net>
Thu, 26 Nov 2009 18:46:11 +0000 (18:46 +0000)
lib/userprofile.php
plugins/UserFlag/adminprofileflag.php
plugins/UserFlag/icon_badge.gif [new file with mode: 0644]
plugins/UserFlag/userflag.css

index ee205af85df86284feb3286398971bf744547aea..07e5750852eaa77a8e86eafd73e939296dd71eb0 100644 (file)
@@ -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');
                         }
                     }
index 1ac76b506589125b3036c4a50fd1c2b5e09a51c8..20b8086377de218535221f933c27d338c440f461 100644 (file)
@@ -145,10 +145,15 @@ class FlaggedProfileListItem extends ProfileListItem
 
         $this->startActions();
         if (Event::handle('StartProfileListItemActionElements', array($this))) {
+            $this->out->elementStart('li', 'entity_moderation');
+            $this->out->element('p', null, _('Moderate'));
+            $this->out->elementStart('ul');
             $this->showSandboxButton();
             $this->showSilenceButton();
             $this->showDeleteButton();
             $this->showClearButton();
+            $this->out->elementEnd('ul');
+            $this->out->elementEnd('li');
             Event::handle('EndProfileListItemActionElements', array($this));
         }
         $this->endActions();
diff --git a/plugins/UserFlag/icon_badge.gif b/plugins/UserFlag/icon_badge.gif
new file mode 100644 (file)
index 0000000..2dca5b9
Binary files /dev/null and b/plugins/UserFlag/icon_badge.gif differ
index e8ba66da84e58f763eb2539f8310e856cdb7b582..d69c2467f920c8c7ae13ab7a3dd963cd8681999e 100644 (file)
@@ -15,3 +15,41 @@ background:url(icon_silence.gif) 5px 5px no-repeat;
 background:url(icon_skull.gif) 5px 5px no-repeat;
 }
 
+.entity_moderation {
+position:relative;
+}
+.entity_moderation p {
+background:transparent url(icon_badge.gif) 5px 5px no-repeat;
+box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
+-moz-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
+-webkit-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.25);
+border-radius:4px;
+-moz-border-radius:4px;
+-webkit-border-radius:4px;
+font-weight:bold;
+padding-bottom:2px;
+margin-bottom:7px;
+
+color:#002FA7;
+}
+.entity_moderation ul {
+display:none;
+}
+.entity_moderation:hover ul {
+display:block;
+background-color:#FFFFFF;
+min-width:21%;
+width:100%;
+border:1px solid #DDDDDD;
+padding:11px;
+position:absolute;
+top:-1px;
+right:-1px;
+z-index:1;
+box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
+-moz-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.3);
+-webkit-box-shadow:3px 3px 3px rgba(194, 194, 194, 0.25);
+border-radius:7px;
+-moz-border-radius:7px;
+-webkit-border-radius:7px;
+}