From: Dan Untenzu Date: Tue, 17 Jan 2017 12:52:27 +0000 (+0100) Subject: [FEATURE] Template Markers: Replace configuration values X-Git-Tag: 2.0.0~6 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/2b10abd17f88ba23817bf28840a0f44da74bf362?ds=sidebyside [FEATURE] Template Markers: Replace configuration values Replace markers with configured values. --- 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);