32 lines
898 B
PHP
32 lines
898 B
PHP
<?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,
|
|
]);
|
|
}
|
|
}
|