mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Change deprecated calls
This commit is contained in:
@@ -773,7 +773,7 @@ abstract class Controller extends AbstractController
|
||||
{
|
||||
// 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);
|
||||
$this->m_oPage->LinkScriptFromAppRoot(utils::LocalPath($sLinkedScript, APPROOT));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1280,18 +1280,19 @@ JS;
|
||||
protected function AddCompatibilityFiles(string $sFileType, string $sMode): void
|
||||
{
|
||||
$sConstantName = 'COMPATIBILITY_'.strtoupper($sMode).'_LINKED_'. ($sFileType === static::ENUM_COMPATIBILITY_FILE_TYPE_CSS ? 'STYLESHEETS' : 'SCRIPTS') .'_REL_PATH';
|
||||
$sMethodName = 'add_linked_'.($sFileType === static::ENUM_COMPATIBILITY_FILE_TYPE_CSS ? 'stylesheet' : 'script');
|
||||
$sMethodName = 'Link'.($sFileType === static::ENUM_COMPATIBILITY_FILE_TYPE_CSS ? 'Resource' : 'Script').'FromAppRoot';
|
||||
|
||||
|
||||
// Add ancestors files
|
||||
foreach (array_reverse(class_parents(static::class)) as $sParentClass) {
|
||||
foreach (constant($sParentClass.'::'.$sConstantName) as $sFile) {
|
||||
$this->$sMethodName(utils::GetAbsoluteUrlAppRoot().$sFile);
|
||||
$this->$sMethodName($sFile);
|
||||
}
|
||||
}
|
||||
|
||||
// Add current class files
|
||||
foreach (constant('static::'.$sConstantName) as $sFile) {
|
||||
$this->$sMethodName(utils::GetAbsoluteUrlAppRoot().$sFile);
|
||||
$this->$sMethodName($sFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user