2020-03-28 17:40:53 +01:00
|
|
|
<?php
|
|
|
|
|
2020-03-29 13:47:07 +02:00
|
|
|
/**
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-03-28 17:40:53 +01:00
|
|
|
namespace OCA\SideMenu\Appinfo;
|
|
|
|
|
|
|
|
use OC\Security\CSP\ContentSecurityPolicy;
|
|
|
|
use OCP\Util;
|
|
|
|
|
|
|
|
$config = \OC::$server->getConfig();
|
|
|
|
$cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
|
2020-04-17 13:57:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
Util::addScript('side_menu', 'sideMenu');
|
|
|
|
Util::addStyle('side_menu', 'sideMenu');
|
|
|
|
|
2020-04-09 09:55:45 +02:00
|
|
|
$stylesheet = \OC::$server->getURLGenerator()->linkToRoute(
|
|
|
|
'side_menu.Css.stylesheet',
|
|
|
|
[
|
|
|
|
'v' => $config->getAppValue('side_menu', 'cache', '0'),
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2020-04-17 13:57:23 +02:00
|
|
|
$script = \OC::$server->getURLGenerator()->linkToRoute(
|
|
|
|
'side_menu.Js.script',
|
|
|
|
[
|
|
|
|
'v' => $config->getAppValue('side_menu', 'cache', '0'),
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2020-04-09 09:55:45 +02:00
|
|
|
Util::addHeader(
|
|
|
|
'link',
|
|
|
|
[
|
|
|
|
'href' => $stylesheet,
|
|
|
|
'rel' => 'stylesheet'
|
2020-04-15 12:17:17 +02:00
|
|
|
],
|
|
|
|
''
|
2020-04-09 09:55:45 +02:00
|
|
|
);
|
2020-03-28 17:40:53 +01:00
|
|
|
|
2020-04-17 13:57:23 +02:00
|
|
|
Util::addHeader(
|
|
|
|
'script',
|
|
|
|
[
|
|
|
|
'src' => $script,
|
|
|
|
'nonce' => $cspnm->getNonce(),
|
|
|
|
],
|
|
|
|
''
|
|
|
|
);
|