1
0
Mirror von https://github.com/nextcloud/server.git synchronisiert 2024-08-29 05:55:50 +02:00

Add an event so apps can add hidden fields to the files page

Signed-off-by: Joas Schilling <coding@schilljs.com>
Dieser Commit ist enthalten in:
Joas Schilling 2017-06-12 09:57:34 +02:00 committet von Lukas Reschke
Ursprung b0171a7584
Commit fcdcd3f283
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B9F6980CF6E759B1
2 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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,

Datei anzeigen

@ -21,3 +21,7 @@
<input type="hidden" name="defaultFileSortingDirection" id="defaultFileSortingDirection" value="<?php p($_['defaultFileSortingDirection']) ?>" />
<input type="hidden" name="showHiddenFiles" id="showHiddenFiles" value="<?php p($_['showHiddenFiles']); ?>" />
<?php endif;
foreach ($_['hiddenFields'] as $name => $value) {?>
<input type="hidden" name="<?php p($name) ?>" id="<?php p($name) ?>" value="<?php p($value) ?>" />
<?php }