From 1df33256be6d503e5952091be1f80004a49730e0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 17 Aug 2023 11:18:26 +0200 Subject: add core fileclient script before others Signed-off-by: Robin Appelman --- lib/public/Util.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/public') diff --git a/lib/public/Util.php b/lib/public/Util.php index 1d03c35a9b7..bff8038b3dd 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -169,9 +169,10 @@ class Util { * @param string $application * @param string|null $file * @param string $afterAppId + * @param bool $prepend * @since 4.0.0 */ - public static function addScript(string $application, string $file = null, string $afterAppId = 'core'): void { + public static function addScript(string $application, string $file = null, string $afterAppId = 'core', bool $prepend = false): void { if (!empty($application)) { $path = "$application/js/$file"; } else { @@ -194,7 +195,11 @@ class Util { self::$scriptDeps[$application]->addDep($afterAppId); } - self::$scripts[$application][] = $path; + if ($prepend) { + array_unshift(self::$scripts[$application], $path); + } else { + self::$scripts[$application][] = $path; + } } /** -- cgit v1.2.3