Application.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. class Application extends \OCP\AppFramework\App {
  23. public function __construct() {
  24. parent::__construct('workflowengine');
  25. $this->getContainer()->registerAlias('FlowOperationsController', 'OCA\WorkflowEngine\Controller\FlowOperations');
  26. $this->getContainer()->registerAlias('RequestTimeController', 'OCA\WorkflowEngine\Controller\RequestTime');
  27. }
  28. /**
  29. * Register all hooks and listeners
  30. */
  31. public function registerHooksAndListeners() {
  32. $dispatcher = $this->getContainer()->getServer()->getEventDispatcher();
  33. $dispatcher->addListener(
  34. 'OCP\WorkflowEngine::loadAdditionalSettingScripts',
  35. function() {
  36. if (!function_exists('style')) {
  37. // This is hacky, but we need to load the template class
  38. class_exists('OCP\Template', true);
  39. }
  40. style('workflowengine', [
  41. 'admin',
  42. ]);
  43. script('core', [
  44. 'files/fileinfo',
  45. 'files/client',
  46. 'oc-backbone-webdav',
  47. 'systemtags/systemtags',
  48. 'systemtags/systemtagmodel',
  49. 'systemtags/systemtagscollection',
  50. ]);
  51. vendor_script('jsTimezoneDetect/jstz');
  52. script('workflowengine', [
  53. 'admin',
  54. // Check plugins
  55. 'filemimetypeplugin',
  56. 'filesizeplugin',
  57. 'filesystemtagsplugin',
  58. 'requestremoteaddressplugin',
  59. 'requesttimeplugin',
  60. 'requesturlplugin',
  61. 'requestuseragentplugin',
  62. 'usergroupmembershipplugin',
  63. ]);
  64. },
  65. -100
  66. );
  67. }
  68. }