Show language chooser for guest on the sidebar footer (#7384)

* Show language chooser for guest on the sidebar footer

* Add language chooser to main footer navigation

* Remove static/js/humhub-app.js.tmp that was added by error

---------

Co-authored-by: Marc Farré <contact@marc.fun>
This commit is contained in:
Yuriy Bakhtin 2025-01-15 16:05:51 +01:00 committed by GitHub
parent 056e0d4654
commit c2737c384c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,7 @@ HumHub Changelog
- Fix #7377: Configured Redis cache key prefix was overwritten by the default value - Fix #7377: Configured Redis cache key prefix was overwritten by the default value
- Fix #7375: Use default language for email invitation and show language chooser on registration form - Fix #7375: Use default language for email invitation and show language chooser on registration form
- Enh #7383: Improve SelfTest for Base URL - Enh #7383: Improve SelfTest for Base URL
- Enh #5426: Show language chooser for guest on the sidebar footer
1.17.0 (January 13, 2025) 1.17.0 (January 13, 2025)
------------------------- -------------------------

View File

@ -32,6 +32,14 @@ use yii\base\Widget;
*/ */
class LanguageChooser extends Widget class LanguageChooser extends Widget
{ {
/**
* @inheritdoc
*/
public function beforeRun()
{
return parent::beforeRun() && Yii::$app->user->isGuest;
}
/** /**
* Displays / Run the Widget * Displays / Run the Widget
*/ */

View File

@ -6,6 +6,7 @@
*/ */
use humhub\modules\ui\menu\MenuLink; use humhub\modules\ui\menu\MenuLink;
use humhub\widgets\LanguageChooser;
use humhub\widgets\PoweredBy; use humhub\widgets\PoweredBy;
use yii\helpers\Html; use yii\helpers\Html;
@ -28,7 +29,9 @@ use yii\helpers\Html;
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?= PoweredBy::widget(); ?> <?= PoweredBy::widget() ?>
<?= LanguageChooser::widget() ?>
</small> </small>
</div> </div>
<br/> <br/>

View File

@ -6,6 +6,7 @@
*/ */
use humhub\modules\ui\menu\MenuLink; use humhub\modules\ui\menu\MenuLink;
use humhub\widgets\LanguageChooser;
use humhub\widgets\PoweredBy; use humhub\widgets\PoweredBy;
use yii\helpers\Html; use yii\helpers\Html;
@ -30,6 +31,8 @@ use yii\helpers\Html;
<?php endforeach; ?> <?php endforeach; ?>
<?= PoweredBy::widget(); ?> <?= PoweredBy::widget(); ?>
<?= LanguageChooser::widget() ?>
</small> </small>
</div> </div>
<br/> <br/>