From fcdcd3f2832bffcc9f2a28cf485f9859ce2e5227 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Jun 2017 09:57:34 +0200 Subject: Add an event so apps can add hidden fields to the files page Signed-off-by: Joas Schilling --- apps/files/lib/Controller/ViewController.php | 5 ++++- apps/files/templates/index.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index fc59622af89..bfeb2cafcf6 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -41,6 +41,7 @@ use OCP\IUserSession; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use OCP\Files\Folder; use OCP\App\IAppManager; +use Symfony\Component\EventDispatcher\GenericEvent; /** * Class ViewController @@ -199,7 +200,8 @@ class ViewController extends Controller { $contentItems[] = $contentItem; } - $this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts'); + $event = new GenericEvent(null, ['hiddenFields' => []]); + $this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts', $event); $params = []; $params['usedSpacePercent'] = (int)$storageInfo['relative']; @@ -215,6 +217,7 @@ class ViewController extends Controller { $params['fileNotFound'] = $fileNotFound ? 1 : 0; $params['appNavigation'] = $nav; $params['appContents'] = $contentItems; + $params['hiddenFields'] = $event->getArgument('hiddenFields'); $response = new TemplateResponse( $this->appName, diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 1670ccfd138..b49684643bb 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -21,3 +21,7 @@ $value) {?> + +