2019-02-24 05:28:01 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Administrative dashboard configuration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use App\Acl;
|
|
|
|
|
2020-07-08 07:03:50 +00:00
|
|
|
return function (App\Event\BuildStationMenu $e) {
|
2021-01-11 11:08:06 +00:00
|
|
|
$request = $e->getRequest();
|
2019-02-24 05:28:01 +00:00
|
|
|
$station = $e->getStation();
|
2021-01-11 11:08:06 +00:00
|
|
|
|
|
|
|
$router = $request->getRouter();
|
|
|
|
$backend = $request->getStationBackend();
|
|
|
|
$frontend = $request->getStationFrontend();
|
2019-02-24 05:28:01 +00:00
|
|
|
|
2021-02-03 04:17:57 +00:00
|
|
|
$settings = $e->getSettings();
|
2020-05-27 07:36:30 +00:00
|
|
|
|
2021-01-03 06:23:07 +00:00
|
|
|
$e->merge(
|
|
|
|
[
|
|
|
|
'start_station' => [
|
|
|
|
'label' => __('Start Station'),
|
|
|
|
'title' => __('Ready to start broadcasting? Click to start your station.'),
|
|
|
|
'icon' => 'refresh',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:restart'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'class' => 'api-call text-success',
|
|
|
|
'confirm' => __('Restart broadcasting? This will disconnect any current listeners.'),
|
|
|
|
'visible' => !$station->getHasStarted(),
|
|
|
|
'permission' => Acl::STATION_BROADCASTING,
|
2019-09-30 00:01:15 +00:00
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
'restart_station' => [
|
2021-12-15 13:19:56 +00:00
|
|
|
'label' => __('Restart to Apply Changes'),
|
|
|
|
'title' => __('Click to restart your station and apply configuration changes.'),
|
|
|
|
'icon' => 'refresh',
|
|
|
|
'url' => (string)$router->fromHere('api:stations:restart'),
|
|
|
|
'class' => 'api-call text-warning btn-restart-station '
|
|
|
|
. (!$station->getNeedsRestart() ? 'd-none' : ''),
|
|
|
|
'confirm' => __('Restart broadcasting? This will disconnect any current listeners.'),
|
|
|
|
'visible' => $station->getHasStarted(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_BROADCASTING,
|
|
|
|
],
|
|
|
|
'profile' => [
|
|
|
|
'label' => __('Profile'),
|
|
|
|
'icon' => 'image',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:profile:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'public' => [
|
|
|
|
'label' => __('Public Page'),
|
|
|
|
'icon' => 'public',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->named('public:index', ['station_id' => $station->getShortName()]),
|
2021-01-03 06:23:07 +00:00
|
|
|
'external' => true,
|
|
|
|
'visible' => $station->getEnablePublicPage(),
|
|
|
|
],
|
|
|
|
'ondemand' => [
|
|
|
|
'label' => __('On-Demand Media'),
|
|
|
|
'icon' => 'cloud_download',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->named('public:ondemand', ['station_id' => $station->getShortName()]),
|
2021-01-03 06:23:07 +00:00
|
|
|
'external' => true,
|
|
|
|
'visible' => $station->getEnableOnDemand(),
|
|
|
|
],
|
|
|
|
'files' => [
|
|
|
|
'label' => __('Music Files'),
|
|
|
|
'icon' => 'library_music',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_MEDIA,
|
|
|
|
],
|
|
|
|
'playlists' => [
|
|
|
|
'label' => __('Playlists'),
|
|
|
|
'icon' => 'queue_music',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:playlists:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_MEDIA,
|
|
|
|
],
|
2021-05-25 04:29:07 +00:00
|
|
|
'podcasts' => [
|
|
|
|
'label' => __('Podcasts (Beta)'),
|
|
|
|
'icon' => 'cast',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:podcasts:index'),
|
2021-05-25 04:29:07 +00:00
|
|
|
'permission' => Acl::STATION_PODCASTS,
|
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
'streamers' => [
|
|
|
|
'label' => __('Streamer/DJ Accounts'),
|
|
|
|
'icon' => 'mic',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:streamers:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsStreamers(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_STREAMERS,
|
|
|
|
],
|
|
|
|
'web_dj' => [
|
|
|
|
'label' => __('Web DJ'),
|
|
|
|
'icon' => 'surround_sound',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->named('public:dj', ['station_id' => $station->getShortName()], [], true)
|
2021-01-03 06:23:07 +00:00
|
|
|
->withScheme('https'),
|
|
|
|
'visible' => $station->getEnablePublicPage() && $station->getEnableStreamers(),
|
|
|
|
'external' => true,
|
|
|
|
],
|
|
|
|
'mounts' => [
|
|
|
|
'label' => __('Mount Points'),
|
|
|
|
'icon' => 'wifi_tethering',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:mounts:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $frontend->supportsMounts(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_MOUNTS,
|
|
|
|
],
|
|
|
|
'remotes' => [
|
|
|
|
'label' => __('Remote Relays'),
|
|
|
|
'icon' => 'router',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:remotes:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_REMOTES,
|
|
|
|
],
|
|
|
|
'webhooks' => [
|
|
|
|
'label' => __('Web Hooks'),
|
|
|
|
'icon' => 'code',
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:webhooks:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_WEB_HOOKS,
|
|
|
|
],
|
|
|
|
'reports' => [
|
|
|
|
'label' => __('Reports'),
|
|
|
|
'icon' => 'assignment',
|
|
|
|
'permission' => Acl::STATION_REPORTS,
|
|
|
|
'items' => [
|
|
|
|
'reports_overview' => [
|
|
|
|
'label' => __('Statistics Overview'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:overview'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_listeners' => [
|
|
|
|
'label' => __('Listeners'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:listeners'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_requests' => [
|
|
|
|
'label' => __('Song Requests'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:requests'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'visible' => $station->getEnableRequests(),
|
|
|
|
],
|
|
|
|
'reports_timeline' => [
|
|
|
|
'label' => __('Song Playback Timeline'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:timeline'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_performance' => [
|
|
|
|
'label' => __('Song Listener Impact'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:performance'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_duplicates' => [
|
|
|
|
'label' => __('Duplicate Songs'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index') . '#special:duplicates',
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_unprocessable' => [
|
|
|
|
'label' => __('Unprocessable Files'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:files:index') . '#special:unprocessable',
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'reports_soundexchange' => [
|
|
|
|
'label' => __('SoundExchange Royalties'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:reports:soundexchange'),
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
2019-02-24 05:28:01 +00:00
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
],
|
|
|
|
'utilities' => [
|
|
|
|
'label' => __('Utilities'),
|
|
|
|
'icon' => 'settings',
|
|
|
|
'items' => [
|
|
|
|
'sftp_users' => [
|
|
|
|
'label' => __('SFTP Users'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:sftp_users:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'visible' => App\Service\SftpGo::isSupportedForStation($station),
|
|
|
|
'permission' => Acl::STATION_MEDIA,
|
|
|
|
],
|
|
|
|
'automation' => [
|
|
|
|
'label' => __('Automated Assignment'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:automation:index'),
|
2021-01-19 17:52:45 +00:00
|
|
|
'visible' => $backend->supportsMedia(),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_AUTOMATION,
|
|
|
|
],
|
|
|
|
'ls_config' => [
|
|
|
|
'label' => __('Edit Liquidsoap Configuration'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:util:ls_config'),
|
2021-02-03 04:17:57 +00:00
|
|
|
'visible' => $settings->getEnableAdvancedFeatures()
|
|
|
|
&& $backend instanceof App\Radio\Backend\Liquidsoap,
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_BROADCASTING,
|
|
|
|
],
|
|
|
|
'logs' => [
|
|
|
|
'label' => __('Log Viewer'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:logs:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_LOGS,
|
|
|
|
],
|
|
|
|
'queue' => [
|
|
|
|
'label' => __('Upcoming Song Queue'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('stations:queue:index'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'permission' => Acl::STATION_BROADCASTING,
|
|
|
|
],
|
|
|
|
'restart' => [
|
|
|
|
'label' => __('Restart Broadcasting'),
|
2021-07-19 05:53:45 +00:00
|
|
|
'url' => (string)$router->fromHere('api:stations:restart'),
|
2021-01-03 06:23:07 +00:00
|
|
|
'class' => 'api-call',
|
|
|
|
'confirm' => __('Restart broadcasting? This will disconnect any current listeners.'),
|
|
|
|
'permission' => Acl::STATION_BROADCASTING,
|
|
|
|
],
|
2019-02-24 05:28:01 +00:00
|
|
|
],
|
2019-09-30 00:01:15 +00:00
|
|
|
],
|
2021-01-03 06:23:07 +00:00
|
|
|
]
|
|
|
|
);
|
2019-03-10 08:05:16 +00:00
|
|
|
};
|