mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Enh: "Powered by" message handling by widget
This commit is contained in:
parent
6748aaa39e
commit
185a21ef50
@ -6,6 +6,7 @@ HumHub Change Log
|
||||
---------------------------
|
||||
- Enh: Added maximum username length & maximum/minimum space url length (rekollekt)
|
||||
- Fix: Error message during database installation
|
||||
- Enh: "Powered by" message handling by widget
|
||||
|
||||
|
||||
1.3.6 (October 11, 2018)
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use humhub\assets\AppAsset;
|
||||
use humhub\widgets\PoweredBy;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
@ -37,7 +38,7 @@ AppAsset::register($this);
|
||||
<?php echo $content; ?>
|
||||
|
||||
<div class="text text-center powered">
|
||||
Powered by <a href="http://www.humhub.org" target="_blank">HumHub</a>
|
||||
<?= PoweredBy::widget(); ?>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
@ -47,4 +48,4 @@ AppAsset::register($this);
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
<?php $this->endPage() ?>
|
||||
|
@ -3,6 +3,7 @@
|
||||
use humhub\widgets\FooterMenu;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use humhub\widgets\PoweredBy;
|
||||
|
||||
?>
|
||||
|
||||
@ -696,7 +697,7 @@ use yii\helpers\Html;
|
||||
|
||||
<span style="text-decoration: none; color:<?= $soft2Color ?>;">
|
||||
<?= FooterMenu::widget(['location' => FooterMenu::LOCATION_EMAIL]); ?>
|
||||
Powered by <a href="http://www.humhub.org" style="text-decoration: none; color: <?= $soft2Color ?>;">HumHub</a>
|
||||
<?= PoweredBy::widget(['linkOptions' => ['style' => 'text-decoration:none;color:'.$soft2Color]]); ?>
|
||||
</span>
|
||||
|
||||
</td>
|
||||
|
@ -7,4 +7,4 @@
|
||||
<?= Yii::t('base', 'Unsubscribe') ?>: <?= $url ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Powered by HumHub (http://www.humhub.org)
|
||||
<?= \humhub\widgets\PoweredBy::widget(['textOnly' => true]); ?>
|
||||
|
57
protected/humhub/widgets/PoweredBy.php
Normal file
57
protected/humhub/widgets/PoweredBy.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2018 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\widgets;
|
||||
|
||||
use humhub\components\Widget;
|
||||
use humhub\libs\Html;
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* PoweredBy widget
|
||||
*
|
||||
* @since 1.3.7
|
||||
* @author Luke
|
||||
*/
|
||||
class PoweredBy extends Widget
|
||||
{
|
||||
|
||||
/**
|
||||
* @var bool return text link only
|
||||
*/
|
||||
public $textOnly = false;
|
||||
|
||||
/**
|
||||
* @var array link tag HTML options
|
||||
*/
|
||||
public $linkOptions = [];
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
if (isset(Yii::$app->params['hidePoweredBy'])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($this->textOnly) {
|
||||
return Yii::t('base', 'Powered by {name}', ['name' => 'HumHub (https://humhub.org)']);
|
||||
}
|
||||
|
||||
if (!isset($this->linkOptions['target'])) {
|
||||
$this->linkOptions['target'] = '_blank';
|
||||
}
|
||||
|
||||
return Yii::t('base', 'Powered by {name}', [
|
||||
'name' => Html::a('HumHub', 'https://humhub.org', $this->linkOptions)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
use humhub\widgets\PoweredBy;
|
||||
use yii\helpers\Html;
|
||||
|
||||
?>
|
||||
@ -15,7 +16,7 @@ use yii\helpers\Html;
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= Html::a($item['label'], $item['url']); ?> ·
|
||||
<?php endforeach; ?>
|
||||
Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
<?= PoweredBy::widget(); ?>
|
||||
</small>
|
||||
</div>
|
||||
<br/>
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use humhub\widgets\PoweredBy;
|
||||
|
||||
$i = 0;
|
||||
?>
|
||||
@ -22,5 +23,5 @@ $i = 0;
|
||||
<?php endforeach; ?>
|
||||
<br/><br/>
|
||||
<?php endif; ?>
|
||||
Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
<?= PoweredBy::widget(); ?>
|
||||
</div>
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use humhub\widgets\PoweredBy;
|
||||
|
||||
$i = 0;
|
||||
?>
|
||||
@ -22,7 +23,7 @@ $i = 0;
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
· Powered by <?= Html::a('HumHub', 'https://humhub.org'); ?>
|
||||
· <?= PoweredBy::widget(); ?>
|
||||
</small>
|
||||
</div>
|
||||
<br />
|
||||
|
Loading…
x
Reference in New Issue
Block a user