diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-08-15 22:04:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 22:04:35 +0300 |
commit | 2f07ce1f349a3fa05f84a47f0e9f17f221e0ef95 (patch) | |
tree | a9e9532c85ab1640c043f4726f5baa6eb546937b | |
parent | cb97e8f15c75cc46e345ebfc79dcad1b9c48bd01 (diff) | |
parent | fbc48db507f811bef3c094e446e89d3f3162e616 (diff) |
Merge pull request #33548 from nextcloud/bugfix/33547/remove-redundant-files-events
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/list.php | 16 |
2 files changed, 3 insertions, 16 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 587f75f3f02..82f56be9f18 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -46,6 +46,7 @@ use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; +use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Folder; use OCP\Files\IRootFolder; @@ -294,6 +295,7 @@ class ViewController extends Controller { ]; } + $this->eventDispatcher->dispatchTyped(new ResourcesLoadAdditionalScriptsEvent()); $event = new LoadAdditionalScriptsEvent(); $this->eventDispatcher->dispatchTyped($event); $this->eventDispatcher->dispatchTyped(new LoadSidebar()); @@ -301,6 +303,7 @@ class ViewController extends Controller { if (class_exists(LoadViewer::class)) { $this->eventDispatcher->dispatchTyped(new LoadViewer()); } + $this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false); $this->initialState->provideInitialState('templates', $this->templateManager->listCreators()); diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php index a4667ad17ad..f43aed21427 100644 --- a/apps/files_sharing/list.php +++ b/apps/files_sharing/list.php @@ -23,18 +23,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -use OCA\Files\Event\LoadAdditionalScriptsEvent; -use OCA\Files\Event\LoadSidebar; -use OCA\Viewer\Event\LoadViewer; -use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; -use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IUserSession; use OCP\Server; $config = Server::get(IConfig::class); $userSession = Server::get(IUserSession::class); -$eventDispatcher = Server::get(IEventDispatcher::class); $showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false); @@ -43,14 +37,4 @@ $tmpl = new OCP\Template('files_sharing', 'list', ''); // gridview not available for ie $tmpl->assign('showgridview', $showgridview); -// fire script events -$eventDispatcher->dispatchTyped(new ResourcesLoadAdditionalScriptsEvent()); -$eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent()); -$eventDispatcher->dispatchTyped(new LoadSidebar()); - -// Load Viewer scripts -if (class_exists(LoadViewer::class)) { - $eventDispatcher->dispatchTyped(new LoadViewer()); -} - $tmpl->printPage(); |