loading navigation, complete

v1.18.x
psychobunny 10 years ago
parent 3be5242aa1
commit 6cea047518

@ -16,12 +16,14 @@
helpers.displayMenuItem = function(data, index) { helpers.displayMenuItem = function(data, index) {
var properties = data.navigation[index].properties; var properties = data.navigation[index].properties;
if (properties) {
if (properties.loggedIn && !data.loggedIn || if (properties.loggedIn && !data.loggedIn ||
properties.adminOnly && !data.isAdmin || properties.adminOnly && !data.isAdmin ||
properties.installed && properties.installed.search && !data.searchEnabled || properties.installed && properties.installed.search && !data.searchEnabled ||
properties.hideIfPrivate && data.privateUserInfo) { properties.hideIfPrivate && data.privateUserInfo) {
return false; return false;
} }
}
return true; return true;
}; };

@ -2,11 +2,18 @@
var navigation = {}, var navigation = {},
plugins = require('../plugins'); plugins = require('../plugins'),
db = require('../database');
navigation.load = function(callback) { navigation.get = function(callback) {
callback(false, []); db.getSortedSetRange('navigation:enabled', 0, -1, function(err, data) {
data = data.map(function(item) {
return JSON.parse(item);
});
callback(err, data);
})
}; };

Loading…
Cancel
Save