diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 4f4c722e7..eebfccf8f 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -25,7 +25,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; -use OCP\IInitialStateService; +// use OCP\IInitialStateService; use OCP\L10N\IFactory; use OCP\IRequest; @@ -33,20 +33,20 @@ class PageController extends Controller { protected $appName; - /** @var IInitialStateService */ - private $initialStateService; + // /** @var IInitialStateService */ + // private $initialStateService; /** @var IFactory */ private $languageFactory; public function __construct(string $AppName, IRequest $request, - IInitialStateService $initialStateService, + // IInitialStateService $initialStateService, IFactory $languageFactory) { parent::__construct($AppName, $request); $this->appName = $AppName; - $this->initialStateService = $initialStateService; + // $this->initialStateService = $initialStateService; $this->languageFactory = $languageFactory; } @@ -58,7 +58,8 @@ public function __construct(string $AppName, */ public function index(): TemplateResponse { $locales = $this->languageFactory->findAvailableLocales(); - $this->initialStateService->provideInitialState($this->appName, 'locales', $locales); - return new TemplateResponse('contacts', 'main'); // templates/main.php + // TODO: use initialStateService once min-version is 16! + // $this->initialStateService->provideInitialState($this->appName, 'locales', $locales); + return new TemplateResponse('contacts', 'main', ['locales' => json_encode($locales)]); // templates/main.php } } diff --git a/templates/main.php b/templates/main.php index 9fa58fc69..365cf629f 100644 --- a/templates/main.php +++ b/templates/main.php @@ -2,8 +2,11 @@ if (!\OCP\Util::isIe()) { script('contacts', 'contacts'); style('contacts', 'contacts'); -} else { ?> + + + +