diff --git a/sources/Application/TwigBase/Controller/Controller.php b/sources/Application/TwigBase/Controller/Controller.php index 43d85f270..ff12a0ff8 100644 --- a/sources/Application/TwigBase/Controller/Controller.php +++ b/sources/Application/TwigBase/Controller/Controller.php @@ -771,12 +771,6 @@ abstract class Controller extends AbstractController private function AddLinkedScriptToPage($sLinkedScript) { - // iTop 3.1 and older compatibility, if not an URI we don't know if its relative to app root or module root - if (strpos($sLinkedScript, "://") === false) { - $this->m_oPage->add_linked_script($sLinkedScript); - return; - } - $this->m_oPage->LinkScriptFromURI($sLinkedScript); } diff --git a/sources/Application/WebPage/WebPage.php b/sources/Application/WebPage/WebPage.php index d6c884c35..af64b34c0 100644 --- a/sources/Application/WebPage/WebPage.php +++ b/sources/Application/WebPage/WebPage.php @@ -233,7 +233,6 @@ class WebPage implements Page $this->InitializeInitScripts(); $this->InitializeReadyScripts(); $this->InitializeLinkedScripts(); - $this->InitializeCompatibilityLinkedScripts(); $this->InitializeDictEntries(); $this->InitializeStyles(); $this->InitializeLinkedStylesheets(); @@ -897,37 +896,6 @@ class WebPage implements Page $this->EmptyLinkedScripts(); } - /** - * Add a script (as an include, i.e. link) to the header of the page.
- * Handles duplicates : calling twice with the same script will add the script only once - * - * @param string $sLinkedScriptAbsUrl - * - * @return void - * @uses WebPage::$a_linked_scripts - * @since 3.2.0 N°6935 $sLinkedScriptAbsUrl MUST be an absolute URL - * @deprecated 3.2.0 N°7315 Use {@see static::LinkScriptFromXXX()} instead - */ - public function add_linked_script($sLinkedScriptAbsUrl) - { - DeprecatedCallsLog::NotifyDeprecatedPhpMethod(); - - // Ensure there is actually a URI - if (utils::IsNullOrEmptyString(trim($sLinkedScriptAbsUrl))) { - return; - } - - // Check if URI is absolute ("://" do allow any protocol), otherwise warn that it's a deprecated behavior - if (false === stripos($sLinkedScriptAbsUrl, "://")) { - IssueLog::Debug("Linked script added to page with a non absolute URL, it may lead to it not being loaded and causing javascript errors. See alternatives WebPage::LinkScriptFromXXX", null, [ - "linked_script_url" => $sLinkedScriptAbsUrl, - "request_uri" => $_SERVER['REQUEST_URI'] ?? '' /* CLI */, - ]); - } - - $this->a_linked_scripts[$sLinkedScriptAbsUrl] = $sLinkedScriptAbsUrl; - } - /** * Use to include JS files from the iTop package (e.g. `/js/*`) * @@ -992,27 +960,6 @@ class WebPage implements Page $this->LinkResourceFromURI($sFileAbsURI, static::ENUM_RESOURCE_TYPE_JS); } - /** - * Initialize compatibility linked scripts for the page - * - * @see static::COMPATIBILITY_DEPRECATED_LINKED_SCRIPTS_REL_PATH - * @throws \ConfigException - * @throws \CoreException - * @since 3.0.0 - */ - protected function InitializeCompatibilityLinkedScripts(): void - { - $bIncludeDeprecatedFiles = utils::GetConfig()->Get('compatibility.include_deprecated_js_files'); - if ($bIncludeDeprecatedFiles) { - $this->AddCompatibilityFiles(static::ENUM_COMPATIBILITY_FILE_TYPE_JS, static::ENUM_COMPATIBILITY_MODE_DEPRECATED_FILES); - } - - $bIncludeMovedFiles = utils::GetConfig()->Get('compatibility.include_moved_js_files'); - if ($bIncludeMovedFiles) { - $this->AddCompatibilityFiles(static::ENUM_COMPATIBILITY_FILE_TYPE_JS, static::ENUM_COMPATIBILITY_MODE_MOVED_FILES); - } - } - /** * Empty both dict. entries and dict. entries prefixes for the page *