summaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Event
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-08-02 20:08:54 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-09-23 10:09:57 +0200
commit606b4d5bf3a1c51b3e71a42dfc4add3596464ae9 (patch)
treea5c60be75b9b40163d5ab337f1471053a40262b5 /apps/files/lib/Event
parent48a00b88e18919232430a7f44881594da6d971da (diff)
downloadnextcloud-server-606b4d5bf3a1c51b3e71a42dfc4add3596464ae9.tar.gz
nextcloud-server-606b4d5bf3a1c51b3e71a42dfc4add3596464ae9.zip
Add new LoadAdditionalScriptsEvent
This adds a new event that is in the new style of event dispatching. This should allow more lazy loading and better sepeartion of concerns Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/lib/Event')
-rw-r--r--apps/files/lib/Event/LoadAdditionalScriptsEvent.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/apps/files/lib/Event/LoadAdditionalScriptsEvent.php b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php
new file mode 100644
index 00000000000..bd3d1a8f4e3
--- /dev/null
+++ b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php
@@ -0,0 +1,40 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @author Roeland Jago Douma <roeland@famdouma.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files\Event;
+
+use OCP\EventDispatcher\Event;
+
+class LoadAdditionalScriptsEvent extends Event {
+
+ private $hiddenFields = [];
+
+ public function addHiddenField(string $name, string $value): void {
+ $this->hiddenFields[$name] = $value;
+ }
+
+ public function getHiddenFields(): array {
+ return $this->hiddenFields;
+ }
+}