[FEATURE] Template Markers: Replace configuration values

Replace markers with configured values.
This commit is contained in:
Dan Untenzu 2017-01-17 13:52:27 +01:00 committed by Jerome Jutteau
parent 4a53554259
commit 2b10abd17f
2 changed files with 13 additions and 3 deletions

View File

@ -43,6 +43,14 @@ $cfg['lang'] = 'auto';
*/
$cfg['style'] = 'courgette';
/* Name the organisation running this installation, eg. 'ACME'
*/
$cfg['organisation'] = 'ACME';
/* Provide a contact person for this installation, eg. 'John Doe <doe@example.com>'
*/
$cfg['contactperson'] = '';
/* Propose a preview link if file type is previewable
*/
$cfg['preview'] = true;

View File

@ -1373,11 +1373,13 @@ jirafeau_replace_markers ($content, $htmllinebreaks = false)
{
$patterns = array(
'/###ORGANISATION###/',
'/###CONTACTPERSON###/'
'/###CONTACTPERSON###/',
'/###WEBROOT###/'
);
$replacements = array(
'[ORGANISATION PROVIDING THIS WEBSITE]',
'contact@[THIS WEBSITE]'
$GLOBALS['cfg']['organisation'],
$GLOBALS['cfg']['contactperson'],
$GLOBALS['cfg']['web_root']
);
$content = preg_replace($patterns, $replacements, $content);