feat(11.1-03): add the Coming from WinterCMS concept map with a verified plugin example
- docs/setup/coming-from-wintercms.md maps WinterCMS concepts to checked pkg.Ident spans and lists what SummerCMS does not provide - party BlogPlugin and ExamplePlugin, shown through src= fences - TestDocsRequiredPages asserts required pages build as .html and .md - index links the new page
This commit is contained in:
34
modules/party/example_plugin_test.go
Normal file
34
modules/party/example_plugin_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package party_test
|
||||
|
||||
import (
|
||||
"git.golem15.com/golem15/summercms/modules/backpack"
|
||||
"git.golem15.com/golem15/summercms/modules/pact"
|
||||
)
|
||||
|
||||
// BlogPlugin is the acme.blog plugin: the Go form of a WinterCMS Plugin.php.
|
||||
// A real plugin package also registers it from init with
|
||||
// party.Register(&BlogPlugin{}).
|
||||
type BlogPlugin struct{}
|
||||
|
||||
// The optional capabilities the plugin opts into, checked at compile time.
|
||||
var _ pact.HasPermissions = (*BlogPlugin)(nil)
|
||||
|
||||
// ID is the plugin identifier in vendor.plugin form.
|
||||
func (p *BlogPlugin) ID() string { return "acme.blog" }
|
||||
|
||||
// Requires lists the plugins that must register and boot first ($require).
|
||||
func (p *BlogPlugin) Requires() []string { return []string{"acme.user"} }
|
||||
|
||||
// Register runs before any plugin boots: publish services here.
|
||||
func (p *BlogPlugin) Register(app *backpack.App) error { return nil }
|
||||
|
||||
// Boot runs after every plugin registered: listen to events and look up
|
||||
// services other plugins published.
|
||||
func (p *BlogPlugin) Boot(app *backpack.App) error { return nil }
|
||||
|
||||
// Permissions replaces registerPermissions().
|
||||
func (p *BlogPlugin) Permissions() []pact.Permission {
|
||||
return []pact.Permission{
|
||||
{Code: "acme.blog.access_posts", Tab: "Blog", Label: "Manage posts"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user