v1.18.x
barisusakli 10 years ago
parent 2c033bf286
commit dc0229fc73

@ -86,14 +86,19 @@ define('admin/settings', ['uploader', 'sounds'], function(uploader, sounds) {
$('button[data-action="email.test"]').off('click').on('click', function() {
socket.emit('admin.email.test', function(err) {
app.alert({
alert_id: 'test_email_sent',
type: !err ? 'info' : 'danger',
title: 'Test Email Sent',
message: err ? err.message : '',
timeout: 2500
});
if (err) {
return app.alertError(err.message);
}
app.alertSuccess('Test Email Sent');
});
return false;
});
$('#clear-sitemap-cache').off('click').on('click', function() {
socket.emit('admin.settings.clearSitemapCache', function() {
app.alertSuccess('Sitemap Cache Cleared!');
});
return false;
});
if (typeof callback === 'function') {

@ -107,6 +107,11 @@ var path = require('path'),
sitemap.obj.toXML(callback);
});
},
clearCache: function() {
if (sitemap.obj) {
sitemap.obj.clearCache();
}
}
};

@ -175,6 +175,11 @@ SocketAdmin.settings.set = function(socket, data, callback) {
meta.settings.set(data.hash, data.values, callback);
};
SocketAdmin.settings.clearSitemapCache = function(socket, data, callback) {
require('../sitemap').clearCache();
callback();
};
SocketAdmin.email.test = function(socket, data, callback) {
if (plugins.hasListeners('action:email.send')) {
emailer.send('test', socket.uid, {

@ -26,8 +26,12 @@
</label>
</div>
<label>Number of Topic to Display in Sitemap</label>
<input class="form-control" type="text" placeholder="" data-field="sitemapTopics" />
<div class="form-group">
<label>Number of Topic to Display in Sitemap</label>
<input class="form-control" type="text" placeholder="" data-field="sitemapTopics" />
</div>
<button id="clear-sitemap-cache" class="btn btn-warning">Clear Sitemap Cache</button>
</form>
</div>

Loading…
Cancel
Save