chore: sync module from working instance and add install guide
This commit is contained in:
31
widgets/RescueInfoSidebar.php
Normal file
31
widgets/RescueInfoSidebar.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\space_profiles\widgets;
|
||||
|
||||
use humhub\components\Widget;
|
||||
use humhub\modules\space\models\Space;
|
||||
use humhub\modules\space_profiles\models\SpaceProfile;
|
||||
|
||||
class RescueInfoSidebar extends Widget
|
||||
{
|
||||
public Space $space;
|
||||
|
||||
public function run()
|
||||
{
|
||||
$profile = SpaceProfile::findOne(['contentcontainer_id' => $this->space->contentcontainer_id]);
|
||||
|
||||
$spaceDescription = trim((string)$this->space->about);
|
||||
if ($spaceDescription === '') {
|
||||
$spaceDescription = trim((string)$this->space->description);
|
||||
}
|
||||
if ($spaceDescription === '') {
|
||||
$spaceDescription = trim((string)($profile?->description ?? ''));
|
||||
}
|
||||
|
||||
return $this->render('rescueInfoSidebar', [
|
||||
'space' => $this->space,
|
||||
'profile' => $profile,
|
||||
'spaceDescription' => $spaceDescription,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user