diff --git a/install/data/navigation.json b/install/data/navigation.json index cdc05e51e7..ffd670a0e5 100644 --- a/install/data/navigation.json +++ b/install/data/navigation.json @@ -3,6 +3,7 @@ "id": "unread-count", "route": "/unread", "title": "[[global:header.unread]]", + "enabled": true, "iconClass": "fa-inbox", "textClass": "visible-xs-inline", "text": "[[global:header.unread]]", @@ -13,6 +14,7 @@ { "route": "/recent", "title": "[[global:header.recent]]", + "enabled": true, "iconClass": "fa-clock-o", "textClass": "visible-xs-inline", "text": "[[global:]]" @@ -20,6 +22,7 @@ { "route": "/tags", "title": "[[global:header.tags]]", + "enabled": true, "iconClass": "fa-tags", "textClass": "visible-xs-inline", "text": "[[global:header.tags]]" @@ -27,6 +30,7 @@ { "route": "/popular", "title": "[[global:header.popular]]", + "enabled": true, "iconClass": "fa-fire", "textClass": "visible-xs-inline", "text": "[[global:header.popular]]" @@ -34,6 +38,7 @@ { "route": "/users", "title": "[[global:header.users]]", + "enabled": true, "iconClass": "fa-user", "textClass": "visible-xs-inline", "text": "[[global:header.users]]", @@ -45,6 +50,7 @@ { "route": "/groups", "title": "[[global:header.groups]]", + "enabled": true, "iconClass": "fa-group", "textClass": "visible-xs-inline", "text": "[[global:header.groups]]" @@ -53,6 +59,7 @@ "route": "/admin", "target": "_top", "title": "[[global:header.admin]]", + "enabled": true, "iconClass": "fa-cogs", "textClass": "visible-xs-inline", "text": "[[global:header.admin]]", @@ -63,6 +70,7 @@ { "route": "/search", "title": "[[global:header.search]]", + "enabled": true, "iconClass": "fa-search", "textClass": "visible-xs-inline", "text": "[[global:header.search]]", diff --git a/src/navigation/index.js b/src/navigation/index.js index 5411a8f052..b7ae3b2932 100644 --- a/src/navigation/index.js +++ b/src/navigation/index.js @@ -8,9 +8,14 @@ var navigation = {}, navigation.get = function(callback) { db.getSortedSetRange('navigation:enabled', 0, -1, function(err, data) { - data = data.map(function(item) { - return JSON.parse(item); - }); + + data = data + .filter(function(item) { + return item.enabled; + }) + .map(function(item) { + return JSON.parse(item); + }); callback(err, data); }) diff --git a/src/upgrade.js b/src/upgrade.js index 7a9047d57c..01ab47d01b 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -21,7 +21,7 @@ var db = require('./database'), schemaDate, thisSchemaDate, // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema - latestSchema = Date.UTC(2015, 1, 25); + latestSchema = Date.UTC(2015, 1, 25, 1); Upgrade.check = function(callback) { db.get('schemaDate', function(err, value) { @@ -943,7 +943,7 @@ Upgrade.upgrade = function(callback) { } }, function(next) { - thisSchemaDate = Date.UTC(2015, 1, 25); + thisSchemaDate = Date.UTC(2015, 1, 25, 1); if (schemaDate < thisSchemaDate) { updatesMade = true; winston.info('[2015/02/25] Upgrading menu items to dynamic navigation system');