|
|
|
@ -1,17 +1,23 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var admin = {},
|
|
|
|
|
async = require('async'),
|
|
|
|
|
plugins = require('../plugins'),
|
|
|
|
|
db = require('../database'),
|
|
|
|
|
translator = require('../../public/src/modules/translator');
|
|
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
|
var plugins = require('../plugins');
|
|
|
|
|
var db = require('../database');
|
|
|
|
|
var translator = require('../../public/src/modules/translator');
|
|
|
|
|
var pubsub = require('../pubsub');
|
|
|
|
|
|
|
|
|
|
var admin = {};
|
|
|
|
|
admin.cache = null;
|
|
|
|
|
|
|
|
|
|
pubsub.on('admin:navigation:save', function () {
|
|
|
|
|
admin.cache = null;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
admin.save = function (data, callback) {
|
|
|
|
|
var order = Object.keys(data),
|
|
|
|
|
items = data.map(function (item, idx) {
|
|
|
|
|
var order = Object.keys(data);
|
|
|
|
|
var items = data.map(function (item, idx) {
|
|
|
|
|
var data = {};
|
|
|
|
|
|
|
|
|
|
for (var i in item) {
|
|
|
|
@ -25,6 +31,7 @@ admin.save = function (data, callback) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
admin.cache = null;
|
|
|
|
|
pubsub.publish('admin:navigation:save');
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
db.delete('navigation:enabled', next);
|
|
|
|
|