-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.js
executable file
·38 lines (30 loc) · 989 Bytes
/
library.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
var controllers = require('./lib/controllers'),
categories = false,
plugin = {};
plugin.init = function(params, callback) {
var router = params.router,
hostMiddleware = params.middleware,
hostControllers = params.controllers;
router.get('/admin/plugins/customfollow', hostMiddleware.admin.buildHeader, controllers.renderAdminPage);
router.get('/api/admin/plugins/customfollow', controllers.renderAdminPage);
plugin.reloadSettings();
callback();
};
plugin.addAdminNavigation = function(header, callback) {
header.plugins.push({
route: '/plugins/customfollow',
icon: 'fa-tint',
name: 'Custom Follow'
});
callback(null, header);
};
plugin.reloadSettings = function(data) {
if (!data || data.plugin === 'customfollow') {
meta.settings.get('customfollow', function(err, settings) {
plugin._settings = _.extend(plugin._settings || {}, settings);
winston.verbose('[plugins/customfollow] Settings reloaded.');
});
}
};
module.exports = plugin;