You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Application.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCA\WorkflowEngine\AppInfo;
  22. use OCP\Template;
  23. use OCA\WorkflowEngine\Controller\RequestTime;
  24. use OCA\WorkflowEngine\Controller\FlowOperations;
  25. class Application extends \OCP\AppFramework\App {
  26. public function __construct() {
  27. parent::__construct('workflowengine');
  28. $this->getContainer()->registerAlias('FlowOperationsController', FlowOperations::class);
  29. $this->getContainer()->registerAlias('RequestTimeController', RequestTime::class);
  30. }
  31. /**
  32. * Register all hooks and listeners
  33. */
  34. public function registerHooksAndListeners() {
  35. $dispatcher = $this->getContainer()->getServer()->getEventDispatcher();
  36. $dispatcher->addListener(
  37. 'OCP\WorkflowEngine::loadAdditionalSettingScripts',
  38. function() {
  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. style('workflowengine', [
  44. 'admin',
  45. ]);
  46. script('core', [
  47. 'files/fileinfo',
  48. 'files/client',
  49. 'systemtags/systemtags',
  50. 'systemtags/systemtagmodel',
  51. 'systemtags/systemtagscollection',
  52. ]);
  53. script('workflowengine', [
  54. 'workflowengine',
  55. ]);
  56. },
  57. -100
  58. );
  59. }
  60. }