mirror of
https://github.com/humhub/humhub.git
synced 2025-02-12 03:26:25 +01:00
Enh #3923: Add ability to disable profile stream
This commit is contained in:
parent
f9a4ab0c3f
commit
19a4042514
@ -18,3 +18,4 @@ HumHub Change Log
|
||||
- Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:emptyResult()` helper to manage render state of JsInputWidget
|
||||
- Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:field` in order to access ActiveField instances within JsInputWidget
|
||||
- Enh #4216: Added `humhub\modules\ui\filter\widgets\DropdownFilterInput` in order to support dropdown stream filters
|
||||
- Enh #3923: Add ability to disable profile stream
|
||||
|
@ -118,6 +118,12 @@ class Module extends \humhub\components\Module
|
||||
'/^.{5,255}$/' => 'Password needs to be at least 8 characters long.',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var bool disable profile stream
|
||||
* @since 1.6
|
||||
*/
|
||||
public $profileDisableStream = true;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@ -9,6 +9,7 @@
|
||||
namespace humhub\modules\user\controllers;
|
||||
|
||||
use humhub\modules\user\components\ProfileStream;
|
||||
use humhub\modules\user\Module;
|
||||
use Yii;
|
||||
use yii\web\HttpException;
|
||||
use yii\db\Expression;
|
||||
@ -26,6 +27,7 @@ use humhub\modules\space\models\Space;
|
||||
* Also the following functions are implemented here.
|
||||
*
|
||||
* @author Luke
|
||||
* @property Module $module
|
||||
* @since 0.5
|
||||
*/
|
||||
class ProfileController extends ContentContainerController
|
||||
@ -75,6 +77,10 @@ class ProfileController extends ContentContainerController
|
||||
|
||||
public function actionHome()
|
||||
{
|
||||
if ($this->module->profileDisableStream) {
|
||||
$this->redirect('about');
|
||||
}
|
||||
|
||||
return $this->render('home', ['user' => $this->contentContainer]);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\modules\user\widgets;
|
||||
|
||||
use humhub\modules\user\Module;
|
||||
use Yii;
|
||||
use humhub\modules\ui\menu\MenuLink;
|
||||
use humhub\modules\ui\menu\widgets\LeftNavigation;
|
||||
@ -43,21 +44,25 @@ class ProfileMenu extends LeftNavigation
|
||||
|
||||
$this->panelTitle = Yii::t('UserModule.profile', '<strong>Profile</strong> menu');
|
||||
|
||||
$this->addEntry(new MenuLink([
|
||||
'label' => Yii::t('UserModule.profile', 'Stream'),
|
||||
'icon' => 'bars',
|
||||
'url' => $this->user->createUrl('//user/profile/home'),
|
||||
'sortOrder' => 200,
|
||||
'isActive' => MenuLink::isActiveState('user', 'profile', ['index', 'home'])
|
||||
]));
|
||||
/** @var Module $module */
|
||||
$module = Yii::$app->getModule('user');
|
||||
|
||||
if (!$module->profileDisableStream) {
|
||||
$this->addEntry(new MenuLink([
|
||||
'label' => Yii::t('UserModule.profile', 'Stream'),
|
||||
'icon' => 'bars',
|
||||
'url' => $this->user->createUrl('//user/profile/home'),
|
||||
'sortOrder' => 200,
|
||||
'isActive' => MenuLink::isActiveState('user', 'profile', ['index', 'home'])
|
||||
]));
|
||||
}
|
||||
|
||||
$this->addEntry(new MenuLink([
|
||||
'label' => Yii::t('UserModule.profile', 'About'),
|
||||
'icon' => 'info-circle',
|
||||
'url' => $this->user->createUrl('/user/profile/about'),
|
||||
'sortOrder' => 300,
|
||||
'isActive' => MenuLink::isActiveState('user', 'profile', 'about'),
|
||||
'isActive' => MenuLink::isActiveState('user', 'profile', 'about'),
|
||||
'isVisible' => $this->user->permissionManager->can(ViewAboutPage::class)
|
||||
]));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user