Rendered action lists now follow permissions properly
This commit is contained in:
parent
f1079beaa6
commit
be2697507e
@ -31,8 +31,8 @@ jQuery(document).ready(function($) {
|
||||
|
||||
// Hide the advanced settings
|
||||
$('#AdvancedActionSettings').children('div').hide();
|
||||
$('#AdvancedActionSettings').click(function(){
|
||||
$(this).children('div').slideToggle();
|
||||
$('#AdvancedActionSettings span').click(function(){
|
||||
$(this).siblings().slideToggle();
|
||||
});
|
||||
|
||||
// If someone types in the class manually, deselect icons and select if needed
|
||||
|
@ -80,6 +80,7 @@ class ReactionModel extends Gdn_Model {
|
||||
$ReactionSet[$Index]->Tooltip = $Action->Tooltip;
|
||||
$ReactionSet[$Index]->CssClass = $Action->CssClass;
|
||||
$ReactionSet[$Index]->AwardValue = $Action->AwardValue;
|
||||
$ReactionSet[$Index]->Permission = $Action->Permission;
|
||||
|
||||
$Reactions = $this->SQL
|
||||
->Select('InsertUserID as UserID, DateInserted')
|
||||
|
@ -127,7 +127,7 @@ class YagaHooks implements Gdn_IPlugin {
|
||||
*/
|
||||
protected function _RenderCurrentReactions($ID, $Type) {
|
||||
// check to see if allowed to view reactions
|
||||
if(!Gdn::Session()->CheckPermission('Plugins.Reactions.View')) {
|
||||
if(!Gdn::Session()->CheckPermission('Yaga.Reactions.View')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ class YagaHooks implements Gdn_IPlugin {
|
||||
$Sender->AddJsFile('reactions.js', 'yaga');
|
||||
$Sender->AddCssFile('reactions.css', 'yaga');
|
||||
// check to see if allowed to add reactions
|
||||
if(!Gdn::Session()->CheckPermission('Plugins.Reactions.Add')) {
|
||||
if(!Gdn::Session()->CheckPermission('Yaga.Reactions.Add')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ class YagaHooks implements Gdn_IPlugin {
|
||||
}
|
||||
|
||||
// check to see if allowed to add reactions
|
||||
if(!Gdn::Session()->CheckPermission('Plugins.Reactions.Add')) {
|
||||
if(!Gdn::Session()->CheckPermission('Yaga.Reactions.Add')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -229,11 +229,13 @@ class YagaHooks implements Gdn_IPlugin {
|
||||
$Reactions = $this->_ReactionModel->GetReactions($ID, $Type);
|
||||
$ActionsString = '';
|
||||
foreach($Reactions as $Action) {
|
||||
$ActionsString .= Anchor(
|
||||
Wrap(' ', 'span', array('class' => 'ReactSprite React-' . $Action->ActionID . ' ' . $Action->CssClass)) .
|
||||
WrapIf(count($Action->UserIDs), 'span', array('class' => 'Count')) .
|
||||
Wrap($Action->Name, 'span', array('class' => 'ReactLabel')), 'react/' . $Type . '/' . $ID . '/' . $Action->ActionID, 'Hijack ReactButton'
|
||||
);
|
||||
if(CheckPermission($Action->Permission)) {
|
||||
$ActionsString .= Anchor(
|
||||
Wrap(' ', 'span', array('class' => 'ReactSprite React-' . $Action->ActionID . ' ' . $Action->CssClass)) .
|
||||
WrapIf(count($Action->UserIDs), 'span', array('class' => 'Count')) .
|
||||
Wrap($Action->Name, 'span', array('class' => 'ReactLabel')), 'react/' . $Type . '/' . $ID . '/' . $Action->ActionID, 'Hijack ReactButton'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$AllActionsString = Wrap($ActionsString, 'span', array('class' => 'ReactMenu'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user