mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 22:58:06 +01:00
Fixed: Empty space message broken for members without write privileges
This commit is contained in:
parent
b424240b98
commit
b58639f717
@ -75,7 +75,15 @@ class SpaceController extends \humhub\modules\content\components\ContentContaine
|
||||
*/
|
||||
public function actionHome()
|
||||
{
|
||||
return $this->render('home', ['space' => $this->contentContainer]);
|
||||
$space = $this->contentContainer;
|
||||
$canCreatePosts = $space->permissionManager->can(new \humhub\modules\post\permissions\CreatePost());
|
||||
$isMember = $space->isMember();
|
||||
|
||||
return $this->render('home', [
|
||||
'space' => $space,
|
||||
'canCreatePosts' => $canCreatePosts,
|
||||
'isMember' => $isMember
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,14 +1,19 @@
|
||||
<?php echo \humhub\modules\post\widgets\Form::widget(['contentContainer' => $space]); ?>
|
||||
<?php
|
||||
|
||||
echo \humhub\modules\content\widgets\Stream::widget(array(
|
||||
$emptyMessage = '';
|
||||
if ($canCreatePosts) {
|
||||
$emptyMessage = Yii::t('SpaceModule.views_space_index', '<b>This space is still empty!</b><br>Start by posting something here...');
|
||||
} elseif ($isMember) {
|
||||
$emptyMessage = Yii::t('SpaceModule.views_space_index', '<b>This space is still empty!</b>');
|
||||
} else {
|
||||
$emptyMessage = Yii::t('SpaceModule.views_space_index', '<b>You are not member of this space and there is no public content, yet!</b>');
|
||||
}
|
||||
|
||||
echo \humhub\modules\content\widgets\Stream::widget([
|
||||
'contentContainer' => $space,
|
||||
'streamAction' => '/space/space/stream',
|
||||
'messageStreamEmpty' => ($space->permissionManager->can(new \humhub\modules\post\permissions\CreatePost())) ?
|
||||
Yii::t('SpaceModule.views_space_index', '<b>This space is still empty!</b><br>Start by posting something here...') :
|
||||
Yii::t('SpaceModule.views_space_index', '<b>You are not member of this space and there is no public content, yet!</b>'),
|
||||
'messageStreamEmptyCss' => ($space->permissionManager->can(new \humhub\modules\post\permissions\CreatePost())) ?
|
||||
'placeholder-empty-stream' :
|
||||
'',
|
||||
));
|
||||
'messageStreamEmpty' => $emptyMessage,
|
||||
'messageStreamEmptyCss' => ($canCreatePosts) ? 'placeholder-empty-stream' : '',
|
||||
]);
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user