LStemplate: rollback from array class constant to class variables to restore PHP < 7

This commit is contained in:
Benjamin Renard 2023-01-03 15:32:03 +01:00
parent a3fc7bacfa
commit d80c15acc1

View file

@ -123,7 +123,7 @@ class LStemplate extends LSlog_staticLoggerClass {
* Deprecated templates files * Deprecated templates files
* @var array<string> * @var array<string>
*/ */
private const deprecated_template_files = array ( private static $deprecated_template_files = array (
'accueil.tpl', 'blank.tpl', 'empty.tpl', 'accueil.tpl', 'blank.tpl', 'empty.tpl',
'top.tpl', 'bottom.tpl', 'top.tpl', 'bottom.tpl',
); );
@ -334,7 +334,7 @@ class LStemplate extends LSlog_staticLoggerClass {
* @return string The path of the Smarty template file * @return string The path of the Smarty template file
**/ **/
public static function getTemplatePath($template, $with_nocache=false) { public static function getTemplatePath($template, $with_nocache=false) {
if (in_array($template, self :: deprecated_template_files)) if (in_array($template, self :: $deprecated_template_files))
self :: log_fatal( self :: log_fatal(
getFData( getFData(
_("LStemplate : Request template '%{tpl}' is now deprecated. Please refer to upgrade documentation to adapt your templates."), _("LStemplate : Request template '%{tpl}' is now deprecated. Please refer to upgrade documentation to adapt your templates."),