1<?php 2 3declare(strict_types=1); 4 5/** 6 * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at> 7 * 8 * @author Christoph Wurst <christoph@winzerhof-wurst.at> 9 * @author François Freitag <mail@franek.fr> 10 * 11 * @license GNU AGPL version 3 or any later version 12 * 13 * This program is free software: you can redistribute it and/or modify 14 * it under the terms of the GNU Affero General Public License as 15 * published by the Free Software Foundation, either version 3 of the 16 * License, or (at your option) any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Affero General Public License for more details. 22 * 23 * You should have received a copy of the GNU Affero General Public License 24 * along with this program. If not, see <http://www.gnu.org/licenses/>. 25 * 26 */ 27namespace OCA\WorkflowEngine\Listener; 28 29use OCA\WorkflowEngine\AppInfo\Application; 30use OCP\EventDispatcher\Event; 31use OCP\EventDispatcher\IEventListener; 32use OCP\Template; 33use function class_exists; 34use function function_exists; 35use function script; 36 37class LoadAdditionalSettingsScriptsListener implements IEventListener { 38 public function handle(Event $event): void { 39 if (!function_exists('style')) { 40 // This is hacky, but we need to load the template class 41 class_exists(Template::class, true); 42 } 43 44 script('core', 'dist/systemtags'); 45 46 script(Application::APP_ID, [ 47 'workflowengine', 48 ]); 49 } 50} 51