From 5f5a107991478824133c6e0d67aeb1a7efb8e213 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 26 Nov 2009 18:46:11 +0000 Subject: [PATCH] Init UI to show/hide a group of moderation actions. --- lib/userprofile.php | 57 +++++++++++++++----------- plugins/UserFlag/adminprofileflag.php | 5 +++ plugins/UserFlag/icon_badge.gif | Bin 0 -> 105 bytes plugins/UserFlag/userflag.css | 38 +++++++++++++++++ 4 files changed, 76 insertions(+), 24 deletions(-) create mode 100644 plugins/UserFlag/icon_badge.gif diff --git a/lib/userprofile.php b/lib/userprofile.php index ee205af85d..07e5750852 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'); } } diff --git a/plugins/UserFlag/adminprofileflag.php b/plugins/UserFlag/adminprofileflag.php index 1ac76b5065..20b8086377 100644 --- a/plugins/UserFlag/adminprofileflag.php +++ b/plugins/UserFlag/adminprofileflag.php @@ -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 index 0000000000000000000000000000000000000000..2dca5b99feb5bf9d5d0a1d190cdee193c58948a6 GIT binary patch literal 105 zcmZ?wbhEHb6krfwSjfom|NsB^DFP6r_)pNeC^fMpHASI3vm`^o-P1RKLGdRGBLf2y zgAM}_fHW~MsfP5;T=tgpKz5;9Wnt^i%hDBIZ4L1|Yp1>}xg@fwfa|*1p&L$&4AubJ C#UrZ# literal 0 HcmV?d00001 diff --git a/plugins/UserFlag/userflag.css b/plugins/UserFlag/userflag.css index e8ba66da84..d69c2467f9 100644 --- a/plugins/UserFlag/userflag.css +++ b/plugins/UserFlag/userflag.css @@ -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; +}