Define base URL in page templates by using public_root_url parameter

This commit is contained in:
Benjamin Renard 2020-05-02 18:12:43 +02:00
parent 50ea12a81c
commit 23d5161bfe
8 changed files with 14 additions and 0 deletions

View file

@ -130,6 +130,13 @@ class LStemplate {
self :: registerFunction("css", "LStemplate_smarty_css");
self :: registerFunction("uniqid", "LStemplate_smarty_uniqid");
// Define public root URL
$public_root_url = LSconfig :: get('public_root_url', '/', 'string');
// Remove trailing slash
if (substr($public_root_url, -1) == '/')
$public_root_url = substr($public_root_url, 0, -1);
self :: assign('public_root_url', $public_root_url);
// Trigger started event
self :: fireEvent('started');

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset={$LSencoding}">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="icon" type="image/png" href="images/default/favicon.png" />
<link rel="stylesheet" type="text/css" href="{css name='base.css'}" title="Normal" />
<link rel="stylesheet" type="text/css" href="{css name='base_print.css'}" media='print' title="Normal" />

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset={$LSencoding}">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="icon" type="image/png" href="images/default/favicon.png" />
<link rel="stylesheet" type="text/css" href="{css name='base.css'}" title="Normal" />
<link rel="stylesheet" type="text/css" href="{css name='base_print.css'}" media='print' title="Normal" />

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset={$LSencoding}">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="icon" type="image/png" href="images/default/favicon.png" />
<link rel="stylesheet" type="text/css" href="{css name='base.css'}" title="Normal" />
<link rel="stylesheet" type="text/css" href="{css name='base_print.css'}" media='print' title="Normal" />

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="icon" type="image/png" href="images/default/favicon.png" />
<link rel="stylesheet" type="text/css" href="{css name='login.css'}" media="screen" title="Normal" />
{$LSsession_css}

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="stylesheet" type="text/css" href="{css name='recoverpassword.css'}" media="screen" title="Normal" />
{$LSsession_css}
{$LSsession_js}

View file

@ -3,6 +3,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<base href="{$public_root_url}/"/>
<META http-equiv="refresh" content='0; URL={$url}'>
<title>LdapSaisie - Redirection</title>
</head>

View file

@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset={$LSencoding}">
<title>LdapSaisie{if $pagetitle != ''} - {$pagetitle|escape:"htmlall"}{/if}</title>
<base href="{$public_root_url}/"/>
<link rel="icon" type="image/png" href="images/default/favicon.png" />
<link rel="stylesheet" type="text/css" href="{css name='base.css'}" title="Normal" />
<link rel="stylesheet" type="text/css" href="{css name='base_print.css'}" media='print' title="Normal" />