Merge pull request #4348 from yariplus/patch-6

Filter Love for unread controller.
v1.18.x
Barış Soner Uşaklı 9 years ago
commit 61256a54a3

@ -1,14 +1,14 @@
'use strict'; 'use strict';
var async = require('async'), var async = require('async');
var meta = require('../meta');
meta = require('../meta'), var categories = require('../categories');
categories = require('../categories'), var privileges = require('../privileges');
privileges = require('../privileges'), var user = require('../user')
user = require('../user'), var topics = require('../topics');
topics = require('../topics'), var helpers = require('./helpers');
helpers = require('./helpers'); var plugins = require('../plugins');
var unreadController = {}; var unreadController = {};
@ -47,17 +47,18 @@ unreadController.get = function(req, res, next) {
} }
}); });
results.unreadTopics.categories = categories; results.unreadTopics.categories = categories;
next(null, results.unreadTopics);
results.unreadTopics.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[unread:title]]'}]);
results.unreadTopics.title = '[[pages:unread]]';
plugins.fireHook('filter:unread.build', {req: req, res: res, templateData: results.unreadTopics}, next);
} }
], function(err, data) { ], function(err, data) {
if (err) { if (err) {
return next(err); return next(err);
} }
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[unread:title]]'}]); res.render('unread', data.templateData);
data.title = '[[pages:unread]]';
res.render('unread', data);
}); });
}; };
@ -72,4 +73,4 @@ unreadController.unreadTotal = function(req, res, next) {
}); });
}; };
module.exports = unreadController; module.exports = unreadController;

Loading…
Cancel
Save