Merge branch 'develop' of github.com:humhub/humhub into develop

This commit is contained in:
Lucas Bartholemy 2022-03-30 13:10:28 +02:00
commit 1ac9efd09d
5 changed files with 32 additions and 9 deletions

View File

@ -2,6 +2,9 @@
--------------------------
- Fix #5603: Syntax error in database view installer
- Fix #5608: Remove duplicated field "Hostname" on install
- Fix #5612: Fix RichText post process event pass data
- Enh #5610: Show menu item "Add Licence Key" for purchased modules
- Enh #5599: Introduce a variables in the Space model to call ProfileImage and ProfileBannerImage classes
1.11.0-beta.2 (March 18, 2022)

View File

@ -8,6 +8,7 @@
namespace humhub\modules\admin\widgets;
use humhub\components\Module;
use humhub\components\OnlineModule;
use humhub\modules\content\components\ContentContainerModule;
use humhub\modules\ui\menu\MenuLink;
use humhub\modules\ui\menu\widgets\Menu;
@ -130,6 +131,18 @@ class ModuleControls extends Menu
'sortOrder' => 400,
]));
}
$onlineModule = new OnlineModule(['module' => $this->module]);
if ($onlineModule->info('purchased')) {
$this->addEntry(new MenuLink([
'id' => 'marketplace-licence-key',
'label' => Yii::t('AdminModule.base', 'Add Licence Key'),
'url' => ['/marketplace/purchase'],
'htmlOptions' => ['data-target' => '#globalModal'],
'icon' => 'key',
'sortOrder' => 500,
]));
}
}
private function getMarketplaceUrl($module): ?string

View File

@ -79,6 +79,16 @@ abstract class ContentContainerActiveRecord extends ActiveRecord
*/
public $blockedUsersField;
/**
* @var string
*/
public $profileImageClass = ProfileImage::class;
/**
* @var string
*/
public $profileBannerImageClass = ProfileBannerImage::class;
/**
* Returns the display name of content container
*
@ -102,7 +112,7 @@ abstract class ContentContainerActiveRecord extends ActiveRecord
*/
public function getProfileImage()
{
return new ProfileImage($this);
return new $this->profileImageClass($this);
}
/**
@ -112,7 +122,7 @@ abstract class ContentContainerActiveRecord extends ActiveRecord
*/
public function getProfileBannerImage()
{
return new ProfileBannerImage($this);
return new $this->profileBannerImageClass($this);
}
/**

View File

@ -238,13 +238,10 @@ abstract class AbstractRichText extends JsWidget
$record->updateAttributes([$attribute => $text]);
}
$evt = new Event(['result' => ['text' => $text, 'record' => $record, 'attribute' => $attribute]]);
Event::trigger(static::class, static::EVENT_POST_PROCESS, $evt);
Event::trigger(static::class, static::EVENT_POST_PROCESS,
new Event(['data' => ['text' => $text, 'record' => $record, 'attribute' => $attribute]]));
$result['text'] = $text;
return $result;
return $evt->result;
}
/**

View File

@ -483,7 +483,7 @@ class Space extends ContentContainerActiveRecord implements Searchable
*/
public function getProfileImage()
{
return new ProfileImage($this, 'default_space');
return new $this->profileImageClass($this, 'default_space');
}
/**