diff --git a/modules/torrents/client/config/torrents.client.menus.js b/modules/torrents/client/config/torrents.client.menus.js index dd61a700..f13712a0 100644 --- a/modules/torrents/client/config/torrents.client.menus.js +++ b/modules/torrents/client/config/torrents.client.menus.js @@ -5,9 +5,12 @@ .module('torrents') .run(menuConfig); - menuConfig.$inject = ['menuService']; + menuConfig.$inject = ['menuService', 'MeanTorrentConfig']; + + function menuConfig(menuService, MeanTorrentConfig) { + var torrentTypeConfig = MeanTorrentConfig.meanTorrentConfig.torrentType; + console.log(torrentTypeConfig); - function menuConfig(menuService) { menuService.addMenuItem('topbar', { title: 'MENU_TORRENTS', state: 'torrents', @@ -17,31 +20,42 @@ }); // Add the dropdown list item - menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.MOVIE', - state: 'torrents.movie', - roles: ['*'] - }); - menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.TVSERIAL', - state: 'torrents.tvserial', - roles: ['*'] - }); - menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.MUSIC', - state: 'torrents.music', - roles: ['*'] - }); - menuService.addSubMenuItem('topbar', 'torrents', { - title: 'MENU_TORRENTS_SUB.OTHER', - state: 'torrents.other', - roles: ['*'] - }); - menuService.addMenuItem('topbar', { - title: 'MENU_UPLOAD', - state: 'torrents.uploads', - roles: ['*'], - position: 3 + angular.forEach(torrentTypeConfig.value, function (cfg) { + menuService.addSubMenuItem('topbar', 'torrents', { + title: cfg.title, + state: cfg.state, + divider: cfg.divider, + roles: ['*'], + position: cfg.position + }); }); + // + // + //menuService.addSubMenuItem('topbar', 'torrents', { + // title: 'MENU_TORRENTS_SUB.MOVIE', + // state: 'torrents.movie', + // roles: ['*'] + //}); + //menuService.addSubMenuItem('topbar', 'torrents', { + // title: 'MENU_TORRENTS_SUB.TVSERIAL', + // state: 'torrents.tvserial', + // roles: ['*'] + //}); + //menuService.addSubMenuItem('topbar', 'torrents', { + // title: 'MENU_TORRENTS_SUB.MUSIC', + // state: 'torrents.music', + // roles: ['*'] + //}); + //menuService.addSubMenuItem('topbar', 'torrents', { + // title: 'MENU_TORRENTS_SUB.OTHER', + // state: 'torrents.other', + // roles: ['*'] + //}); + //menuService.addMenuItem('topbar', { + // title: 'MENU_UPLOAD', + // state: 'torrents.uploads', + // roles: ['*'], + // position: 3 + //}); } }());