File size: 1,761 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | import { translate } from 'i18n-calypso';
/**
* Menu items that support all sites screen.
* @param {Object} options
* @param {boolean} options.showManagePlugins Includes menu items that can manage plugins across all sites.
*/
export default function allSitesMenu( { showManagePlugins = false } = {} ) {
return [
{
icon: 'dashicons-chart-bar',
slug: 'stats',
title: translate( 'Stats' ),
navigationLabel: translate( 'View stats for all sites' ),
type: 'menu-item',
url: '/stats/day',
},
{
icon: 'dashicons-admin-site-alt3',
slug: 'domains',
title: translate( 'Domains' ),
navigationLabel: translate( 'Manage all domains' ),
type: 'menu-item',
url: '/domains/manage',
},
{
icon: 'dashicons-admin-post',
slug: 'edit-php',
title: translate( 'Posts' ),
navigationLabel: translate( 'View posts for all sites' ),
type: 'menu-item',
url: '/posts',
},
{
icon: 'dashicons-admin-page',
slug: 'edit-phppost_typepage',
title: translate( 'Pages' ),
navigationLabel: translate( 'View pages for all sites' ),
type: 'menu-item',
url: '/pages',
},
{
icon: 'dashicons-admin-plugins',
slug: 'plugins',
title: translate( 'Plugins' ),
navigationLabel: translate( 'View plugins for all sites' ),
type: 'menu-item',
url: '/plugins',
...( showManagePlugins && {
children: [
{
parent: 'plugins',
slug: 'all-sites-plugins-add-new',
title: translate( 'Add New' ),
type: 'submenu-item',
url: '/plugins',
},
{
parent: 'plugins',
slug: 'all-sites-plugins-installed-plugins',
title: translate( 'Installed plugins' ),
type: 'submenu-item',
url: '/plugins/manage',
},
],
} ),
},
];
}
|