Commit 88eef61a authored by Michael Herold's avatar Michael Herold
Browse files

Adds footer to login page (closes #21)

parent ffd8ae81
......@@ -5,6 +5,7 @@ v0.10.0-unpublished:
- Style fixes for radio lists
- Shows current deputy role
- Updates header (always shows owner, not contact email)
- Adds footer to login page
v0.6.0:
- Fixes missing unicode support for requests.
- Adds config fields 'site_information_url' and 'footer'
......
<?php
/*
* Copyright (C) 2016 Michael Herold <quabla@hemio.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace hemio\edentata;
use hemio\html;
/**
* Description of ContentFooter
*
* @author Michael Herold <quabla@hemio.de>
*/
class ContentFooter extends html\Footer {
public function __construct($config) {
$version = file_get_contents('VERSION');
if ($config->enabled('footer'))
$this['text'] = new html\Str(_msg($config['footer'], ['version' => $version]));
if ($config->enabled('site_information_url')) {
$siteInfo = new html\A;
$siteInfo->setAttribute('href', $config['site_information_url']);
$siteInfo[] = new html\Str(_('Site Information'));
if (isset($this['text']))
$this[] = new html\Str(' – ');
$this['site_information'] = $siteInfo;
}
}
}
......@@ -48,4 +48,6 @@ $document->getHtml()->getBody()->addChild(
)
);
$document->getHtml()->getBody()->addChild(new ContentFooter($config));
echo $document->__toString();
......@@ -297,24 +297,7 @@ try {
$mainContent['messages']->addChild(new gui\Message($e));
}
$version = file_get_contents('VERSION');
$body['footer'] = new html\Footer();
if ($config->enabled('footer'))
$body['footer']['text'] = new html\Str(_msg($config['footer'], ['version' => $version]));
if ($config->enabled('site_information_url')) {
$siteInfo = new html\A;
$siteInfo->setAttribute('href', $config['site_information_url']);
$siteInfo[] = new html\Str(_('Site Information'));
if (isset($body['footer']['text']))
$body['footer'][] = new html\Str(' – ');
$body['footer']['site_information'] = $siteInfo;
}
$body['footer'] = new ContentFooter($config);
echo $doc->__toString();
//echo System::reportString();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment