getStation(); if (!$station->getBackendTypeEnum()->isEnabled()) { throw new StationUnsupportedException(); } $configSections = StationBackendConfiguration::getCustomConfigurationSections(); $tokens = Liquidsoap\ConfigWriter::getDividerString(); $event = new WriteLiquidsoapConfiguration($station, true, false); $this->eventDispatcher->dispatch($event); $config = $event->buildConfiguration(); $areas = []; $tok = strtok($config, $tokens); while ($tok !== false) { $tok = trim($tok); if (in_array($tok, $configSections, true)) { $areas[] = [ 'is_field' => true, 'field_name' => $tok, ]; } else { $areas[] = [ 'is_field' => false, 'markup' => $tok, ]; } $tok = strtok($tokens); } $router = $request->getRouter(); return $request->getView()->renderVuePage( response: $response, component: 'Vue_StationsLiquidsoapConfig', id: 'station-liquidsoap-config', title: __('Edit Liquidsoap Configuration'), props: [ 'settingsUrl' => (string)$router->fromHere('api:stations:liquidsoap-config'), 'restartStatusUrl' => (string)$router->fromHere('api:stations:restart-status'), 'config' => $areas, 'sections' => $configSections, ], ); } }