Skip to content

Node.js based forum software built for the modern web

moved rewards/conditions/conditoinals out of core into rewards-essentials

psychobunny54c5034ce07c
diff --git a/src/rewards/admin.js b/src/rewards/admin.js
index 1f13ba7854..dd1acf6180 100644
--- a/src/rewards/admin.js
+++ b/src/rewards/admin.js
@@ -5,30 +5,6 @@ var rewards = {},
plugins = require('../plugins'),
db = require('../database');
-var defaults = {
- conditionals: [
- {
- "name": ">",
- "conditional": "greaterthan"
- },
- {
- "name": ">=",
- "conditional": "greaterorequalthan"
- },
- {
- "name": "<",
- "conditional": "lesserthan"
- },
- {
- "name": "<=",
- "conditional": "lesserorequalthan"
- },
- {
- "name": "string:",
- "conditional": "string"
- }
- ]
-};
rewards.save = function(data, callback) {
function save(data, next) {
@@ -75,68 +51,13 @@ rewards.get = function(callback) {
async.parallel({
active: getActiveRewards,
conditions: function(next) {
- plugins.fireHook('filter:rewards.conditions', [
- {
- "name": "Reputation",
- "condition": "core:user.reputation"
- },
- {
- "name": "Post Count",
- "condition": "core:user.postcount"
- },
- {
- "name": "Last Logged in Time",
- "condition": "core:user.lastonline"
- }
- ], next);
+ plugins.fireHook('filter:rewards.conditions', [], next);
},
conditionals: function(next) {
- plugins.fireHook('filter:rewards.conditionals', defaults.conditionals, next);
+ plugins.fireHook('filter:rewards.conditionals', [], next);
},
rewards: function(next) {
- plugins.fireHook('filter:rewards.rewards', [
- {
- "rid": "core:add-to-group",
- "name": "Add to Group",
- "inputs": [
- {
- "type": "select",
- "name": "groupname",
- "label": "Group Name:",
- "values": [
- {
- "name": "Group 1",
- "value": "group1"
- },
- {
- "name": "Group 2",
- "value": "group2"
- },
- {
- "name": "Group 3",
- "value": "group3"
- }
- ],
- }
- ]
- },
- {
- "rid": "core:alert-user",
- "name": "Send alert message",
- "inputs": [
- {
- "type": "text",
- "name": "title",
- "label": "Title:"
- },
- {
- "type": "text",
- "name": "message",
- "label": "Message:"
- }
- ]
- }
- ], next);
+ plugins.fireHook('filter:rewards.rewards', [], next);
}
}, callback);
};