chore: bootstrap module from working instance and add install guide
This commit is contained in:
38
Module.php
Normal file
38
Module.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\donations;
|
||||
|
||||
use humhub\modules\content\components\ContentContainerActiveRecord;
|
||||
use humhub\modules\content\components\ContentContainerModule;
|
||||
use humhub\modules\space\models\Space;
|
||||
|
||||
class Module extends ContentContainerModule
|
||||
{
|
||||
public $resourcesPath = 'resources';
|
||||
|
||||
public function getContentContainerTypes()
|
||||
{
|
||||
return [Space::class];
|
||||
}
|
||||
|
||||
public function getPermissions($contentContainer = null)
|
||||
{
|
||||
if ($contentContainer instanceof Space) {
|
||||
return [
|
||||
new permissions\ManageDonations(),
|
||||
new permissions\Donate(),
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getContentContainerConfigUrl(ContentContainerActiveRecord $container)
|
||||
{
|
||||
if ($container->moduleManager->isEnabled('rescue_foundation')) {
|
||||
return $container->createUrl('/rescue_foundation/settings');
|
||||
}
|
||||
|
||||
return $container->createUrl('/donations/settings');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user