Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu for create calendar from wall stream #331

Merged
merged 13 commits into from
Nov 7, 2022
1 change: 1 addition & 0 deletions Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,5 @@ public static function onRestApiAddRules()

], 'calendar');
}

}
8 changes: 8 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,12 @@ public function getContainerPermissions($contentContainer = null)
}
return [];
}

/**
* @inheritdoc
*/
public function getContentClasses(?ContentContainerActiveRecord $contentContainer = null): array
{
return [CalendarEntry::class];
}
}
5 changes: 5 additions & 0 deletions models/CalendarEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class CalendarEntry extends ContentActiveRecord implements Searchable, Recurrent
*/
public $is_public = Content::VISIBILITY_PUBLIC;

/**
* @inheritdoc
*/
protected $createPermission = CreateEntry::class;

/**
* @inheritdoc
*/
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "Calendar",
"description": "Calendar for spaces or user profiles.",
"keywords": ["calendar"],
"version": "1.2.6",
"version": "1.3.0",
"humhub": {
"minVersion": "1.10"
"minVersion": "1.13"
},
"homepage": "https://github.com/humhub/calendar",
"authors": [
Expand Down
9 changes: 9 additions & 0 deletions widgets/WallEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

class WallEntry extends WallStreamModuleEntryWidget
{
/**
* @inheritdoc
*/
public $createRoute = '/calendar/entry/edit';

const VIEW_CONTEXT_FULLCALENDAR = 'fullCalendar';

Expand All @@ -34,6 +38,11 @@ class WallEntry extends WallStreamModuleEntryWidget
*/
public $editMode = self::EDIT_MODE_MODAL;

/**
* @inheritdoc
*/
public $createFormSortOrder = 500;

/**
* @var bool defines if the description and participation info should be cut at a certain height, this should only be the case in the stream
*/
Expand Down