diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-04-01 15:04:41 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-04-01 15:24:24 +0200 |
commit | e467ea1c6a1c21a514963cf7aef78681f41ce35b (patch) | |
tree | 94bff2fcf9def0a336d3011a399b9b3b364a00f0 /lib/private/legacy | |
parent | b03ffab5f0f39139c71cb2b8c370ca3f3d1ad391 (diff) | |
download | nextcloud-server-feat/cleanup-oc-util.tar.gz nextcloud-server-feat/cleanup-oc-util.zip |
chore(legacy): Remove deprecated OC_Util::addScript and functions depending on itfeat/cleanup-oc-util
Deprecated since 24, currently unused.
Sadly not all related functions were officially marked as deprecated,
but all of them were unused.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Util.php | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 36a121094cc..b2950275e41 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -20,7 +20,6 @@ use OCP\Share\IManager; use Psr\Log\LoggerInterface; class OC_Util { - public static $scripts = []; public static $styles = []; public static $headers = []; @@ -236,60 +235,6 @@ class OC_Util { } /** - * add a javascript file - * - * @deprecated 24.0.0 - Use \OCP\Util::addScript - * - * @param string $application application id - * @param string|null $file filename - * @param bool $prepend prepend the Script to the beginning of the list - * @return void - */ - public static function addScript($application, $file = null, $prepend = false) { - $path = OC_Util::generatePath($application, 'js', $file); - - // core js files need separate handling - if ($application !== 'core' && $file !== null) { - self::addTranslations($application); - } - self::addExternalResource($application, $prepend, $path, 'script'); - } - - /** - * add a javascript file from the vendor sub folder - * - * @param string $application application id - * @param string|null $file filename - * @param bool $prepend prepend the Script to the beginning of the list - * @return void - */ - public static function addVendorScript($application, $file = null, $prepend = false) { - $path = OC_Util::generatePath($application, 'vendor', $file); - self::addExternalResource($application, $prepend, $path, 'script'); - } - - /** - * add a translation JS file - * - * @deprecated 24.0.0 - * - * @param string $application application id - * @param string|null $languageCode language code, defaults to the current language - * @param bool|null $prepend prepend the Script to the beginning of the list - */ - public static function addTranslations($application, $languageCode = null, $prepend = false) { - if (is_null($languageCode)) { - $languageCode = \OC::$server->get(IFactory::class)->findLanguage($application); - } - if (!empty($application)) { - $path = "$application/l10n/$languageCode"; - } else { - $path = "l10n/$languageCode"; - } - self::addExternalResource($application, $prepend, $path, 'script'); - } - - /** * add a css file * * @param string $application application id @@ -333,14 +278,6 @@ class OC_Util { self::$styles[] = $path; } } - } elseif ($type === 'script') { - if (!in_array($path, self::$scripts)) { - if ($prepend === true) { - array_unshift(self::$scripts, $path); - } else { - self::$scripts [] = $path; - } - } } } |