N°7315 - Migrate usages of WebPage::add_linked_xxx() for LoginTwigRenderer class

This commit is contained in:
Molkobain
2024-06-25 15:02:20 +02:00
parent 3c1af200f8
commit a55efdff18

View File

@@ -52,12 +52,13 @@ class LoginTwigContext
/**
* Set the absolute path on disk of the folder containing the twig templates
*
* @param string $sPath absolute path of twig templates directory
* @api
*
*@param string $sAbsPath Absolute path of twig templates directory
*/
public function SetLoaderPath($sPath)
public function SetLoaderPath($sAbsPath)
{
$this->sTwigLoaderPath = $sPath;
$this->sTwigLoaderPath = $sAbsPath;
}
/**
@@ -84,24 +85,27 @@ class LoginTwigContext
}
/**
* Add the URL of a CSS file to link to the login screen
* Add the absolute URL of a CSS file to link to the login screen
*
* @param string $sFile URL of the CSS file to link
* @api
*
* @param string $sFileAbsURL Absolute URL of the CSS file to link
*/
public function AddCSSFile($sFile)
public function AddCSSFile($sFileAbsURL)
{
$this->aCSSFiles[] = $sFile;
$this->aCSSFiles[] = $sFileAbsURL;
}
/**
* Add the URL of a javascript file to link to the login screen
* @param string $sFile URL of the javascript file to link
* Add the absolute URL of a javascript file to link to the login screen
*
* @api
*
* @param string $sFileAbsURL Absolute URL of the javascript file to link
*/
public function AddJsFile($sFile)
public function AddJsFile($sFileAbsURL)
{
$this->aJsFiles[] = $sFile;
$this->aJsFiles[] = $sFileAbsURL;
}
/**
@@ -133,7 +137,7 @@ class LoginTwigContext
}
/**
* @return array
* @return array Absolute URLs of the CSS files
*/
public function GetCSSFiles()
{
@@ -141,7 +145,7 @@ class LoginTwigContext
}
/**
* @return array
* @return array Absolute URLs of the JS files
*/
public function GetJsFiles()
{
@@ -274,12 +278,12 @@ class LoginTwigRenderer
$aCSSFiles = $oFormData->GetCSSFiles();
foreach ($aCSSFiles as $sCSSFile)
{
$oPage->add_linked_stylesheet($sCSSFile);
$oPage->LinkStylesheetFromURI($sCSSFile);
}
$aJsFiles = $oFormData->GetJsFiles();
foreach ($aJsFiles as $sJsFile)
{
$oPage->add_linked_script($sJsFile);
$oPage->LinkScriptFromURI($sJsFile);
}
}