2020-07-13 08:27:52 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2013-04-03 17:50:29 +02:00
|
|
|
|
|
|
|
namespace OCA\Notes\Controller;
|
|
|
|
|
2015-01-26 14:21:50 +01:00
|
|
|
use OCP\AppFramework\Controller;
|
2015-02-11 13:04:28 +01:00
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
2015-04-26 20:27:01 +02:00
|
|
|
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
2015-01-26 14:21:50 +01:00
|
|
|
use OCP\IRequest;
|
2013-08-17 17:05:09 +02:00
|
|
|
|
2013-04-03 17:50:29 +02:00
|
|
|
class PageController extends Controller {
|
2020-04-12 19:26:57 +02:00
|
|
|
public function __construct(string $AppName, IRequest $request) {
|
2019-05-25 08:15:05 +02:00
|
|
|
parent::__construct($AppName, $request);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @NoAdminRequired
|
|
|
|
* @NoCSRFRequired
|
|
|
|
*
|
|
|
|
* @return TemplateResponse
|
|
|
|
*/
|
2020-04-12 19:26:57 +02:00
|
|
|
public function index() : TemplateResponse {
|
2020-07-12 22:44:55 +02:00
|
|
|
$devMode = !is_file(dirname(__FILE__).'/../../js/notes-main.js');
|
2019-05-25 08:15:05 +02:00
|
|
|
$response = new TemplateResponse(
|
|
|
|
$this->appName,
|
2019-11-16 22:53:12 +01:00
|
|
|
$devMode ? 'dev-mode' : 'main',
|
2019-05-25 08:15:05 +02:00
|
|
|
[ ]
|
|
|
|
);
|
|
|
|
|
|
|
|
$csp = new ContentSecurityPolicy();
|
|
|
|
$csp->addAllowedImageDomain('*');
|
|
|
|
$response->setContentSecurityPolicy($csp);
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
2018-07-01 21:10:30 +02:00
|
|
|
}
|