From 2b10abd17f88ba23817bf28840a0f44da74bf362 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Tue, 17 Jan 2017 13:52:27 +0100 Subject: [PATCH] [FEATURE] Template Markers: Replace configuration values Replace markers with configured values. --- lib/config.original.php | 8 ++++++++ lib/functions.php | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/config.original.php b/lib/config.original.php index 30ec134..cd39bb3 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -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 ' + */ +$cfg['contactperson'] = ''; + /* Propose a preview link if file type is previewable */ $cfg['preview'] = true; diff --git a/lib/functions.php b/lib/functions.php index a89d8b8..6c9c832 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -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); -- 2.34.1