added config for optional copyright notice

This commit is contained in:
Andreas Gohr 2024-02-08 09:24:23 +01:00
commit 9603fc81cf
7 changed files with 31 additions and 20 deletions

View file

@ -8,3 +8,4 @@ $conf['sidebar_sections'] = 'h1,h2,h3,h4,h5';
$conf['header_layout'] = 'header-default';
$conf['autocollapse'] = 1;
$conf['closedwiki'] = 0;
$conf['copyright'] = '';

View file

@ -20,3 +20,4 @@ $meta['header_layout'] = array(
$meta['autocollapse'] = array('onoff');
$meta['closedwiki'] = array('onoff');
$meta['copyright'] = [];

View file

@ -37,6 +37,7 @@
box-sizing: border-box;
background-color: @ini_background_site;
margin-top: 5px; // for box-shadow of content
text-align: center;
}
p {

View file

@ -387,16 +387,7 @@ include('tpl/favicon_tiles.php');
<div class="col-xs-12">
<div class="main-footer">
<p>
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* copyright */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_license($img = false, $imgonly = false, $return = false, $wrap = false);
?>
</p>
<?php include 'tpl/main-footer.php'; ?>
</div>
</div>

View file

@ -17,3 +17,4 @@ $lang['header_layout_o_compact'] = 'compact header layout for short wiki title
$lang['autocollapse'] = 'Automatically collapse the sidebar when viewing non-content pages for more screen estate.';
$lang['closedwiki'] = 'This is a closed wiki. Hide most wiki functionality before user has logged in.';
$lang['copyright'] = 'Copyright notice. Use %year%, %title%, and %TITLE% as placeholders. May contain HTML. You probably want to disable the default license notice.';

View file

@ -426,16 +426,7 @@ $classWideContent = (Template::getInstance())->fullWidthClass();
<div class="col-xs-12">
<div class="main-footer">
<p>
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* copyright */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_license($img = false, $imgonly = false, $return = false, $wrap = false);
?>
</p>
<?php include 'tpl/main-footer.php'; ?>
</div>
</div>

25
tpl/main-footer.php Normal file
View file

@ -0,0 +1,25 @@
<?php
global $conf;
if ($conf['license']) {
echo '<p>';
tpl_license($img = false, $imgonly = false, $return = false, $wrap = false);
echo '</p>';
}
if (tpl_getConf('copyright')) {
$copy = str_replace(
[
'%year%',
'%title%',
'%TITLE%',
],
[
date('Y'),
$conf['title'],
dokuwiki\Utf8\PhpString::strtoupper($conf['title']),
],
tpl_getConf('copyright')
);
echo '<p>' . $copy . '</p>';
}