loading navigation, complete

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

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

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

Loading…
Cancel
Save