mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Enh: Added footer navigation - FooterMenu widget
This commit is contained in:
parent
28d5b0b3c9
commit
7fe9a1586e
@ -7,6 +7,7 @@ HumHub Change Log
|
||||
- Fix #3108: Fixed cronjob examples with leading zero (acs-ferreira)
|
||||
- Fix: Memory leak in activity mail summary processor cron
|
||||
- Fix: With enabled guest mode BaseAccountController does not redirect to login page
|
||||
- Enh: Added footer navigation - FooterMenu widget
|
||||
|
||||
|
||||
1.2.5 (April 11, 2018)
|
||||
|
69
protected/humhub/widgets/FooterMenu.php
Normal file
69
protected/humhub/widgets/FooterMenu.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\widgets;
|
||||
|
||||
/**
|
||||
* FooterMenu displays a footer navigation for pages e.g. Imprint
|
||||
*
|
||||
* @since 1.2.6
|
||||
* @author Luke
|
||||
*/
|
||||
class FooterMenu extends BaseMenu
|
||||
{
|
||||
const LOCATION_LOGIN = 'login';
|
||||
const LOCATION_SIDEBAR = 'sidebar';
|
||||
const LOCATION_FULL_PAGE = 'full';
|
||||
const LOCATION_EMAIL = 'mail';
|
||||
|
||||
|
||||
/**
|
||||
* @var string location of footer menu (e.g. login, mail, sidebar)
|
||||
*/
|
||||
public $location = 'full';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $template = 'footerNavigation';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public $id = 'footer-menu-nav';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ($this->location === static::LOCATION_LOGIN) {
|
||||
$this->template = 'footerNavigation_login';
|
||||
} elseif ($this->location === static::LOCATION_SIDEBAR) {
|
||||
$this->template = 'footerNavigation_sidebar';
|
||||
} elseif ($this->location === static::LOCATION_EMAIL) {
|
||||
$this->template = 'footerNavigation_email';
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->trigger(self::EVENT_RUN);
|
||||
|
||||
return $this->render($this->template, [
|
||||
'items' => $this->getItems(),
|
||||
'location' => $this->location,
|
||||
'numItems' => count($this->getItems())
|
||||
]);
|
||||
}
|
||||
}
|
22
protected/humhub/widgets/views/footerNavigation.php
Normal file
22
protected/humhub/widgets/views/footerNavigation.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($numItems > 0): ?>
|
||||
<div class="text-center" style="filter:opacity(.6);font-size:12px">
|
||||
<small>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= Html::a($item['label'], $item['url']); ?> ·
|
||||
<?php endforeach; ?>
|
||||
Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
</small>
|
||||
</div>
|
||||
<br/>
|
||||
<?php endif; ?>
|
28
protected/humhub/widgets/views/footerNavigation_email.php
Normal file
28
protected/humhub/widgets/views/footerNavigation_email.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$i = 0;
|
||||
?>
|
||||
|
||||
<center>
|
||||
<div class="text text-center powered">
|
||||
<?php if ($numItems > 0): ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= Html::a($item['label'], $item['url'], ['style' => 'text-decoration: none; color: '.$this->theme->variable('text-color-soft2', '#aeaeae').';']); ?>
|
||||
|
||||
<?php if (++$i !== $numItems): ?>
|
||||
·
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<br/>
|
||||
<br/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</center>
|
26
protected/humhub/widgets/views/footerNavigation_login.php
Normal file
26
protected/humhub/widgets/views/footerNavigation_login.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$i = 0;
|
||||
?>
|
||||
|
||||
<div class="text text-center powered">
|
||||
<?php if ($numItems > 0): ?>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= Html::a($item['label'], $item['url']); ?>
|
||||
|
||||
<?php if (++$i !== $numItems): ?>
|
||||
·
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<br/><br/>
|
||||
<?php endif; ?>
|
||||
Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
</div>
|
29
protected/humhub/widgets/views/footerNavigation_sidebar.php
Normal file
29
protected/humhub/widgets/views/footerNavigation_sidebar.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$i = 0;
|
||||
?>
|
||||
|
||||
<?php if ($numItems > 0): ?>
|
||||
<div style="filter:opacity(.6);font-size:12px">
|
||||
<small>
|
||||
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= Html::a($item['label'], $item['url']); ?>
|
||||
|
||||
<?php if (++$i !== $numItems): ?>
|
||||
·
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
· Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
</small>
|
||||
</div>
|
||||
<br />
|
||||
<?php endif; ?>
|
Loading…
x
Reference in New Issue
Block a user