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.

list.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author John Molakvoæ <skjnldsv@protonmail.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Vincent Petry <vincent@nextcloud.com>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. use OCA\Files\Event\LoadAdditionalScriptsEvent;
  27. use OCA\Files\Event\LoadSidebar;
  28. use OCA\Viewer\Event\LoadViewer;
  29. use OCP\EventDispatcher\GenericEvent;
  30. $config = \OC::$server->getConfig();
  31. $userSession = \OC::$server->getUserSession();
  32. $legacyEventDispatcher = \OC::$server->getEventDispatcher();
  33. /** @var \OCP\EventDispatcher\IEventDispatcher $eventDispatcher */
  34. $eventDispatcher = \OC::$server->get(OCP\EventDispatcher\IEventDispatcher::class);
  35. $showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false);
  36. $tmpl = new OCP\Template('files_sharing', 'list', '');
  37. // gridview not available for ie
  38. $tmpl->assign('showgridview', $showgridview);
  39. // fire script events
  40. $legacyEventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
  41. $eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent());
  42. $eventDispatcher->dispatchTyped(new LoadSidebar());
  43. // Load Viewer scripts
  44. if (class_exists(LoadViewer::class)) {
  45. $eventDispatcher->dispatchTyped(new LoadViewer());
  46. }
  47. $tmpl->printPage();