Add Footer Block options to make_block

This commit is contained in:
Tom 2023-08-30 13:59:00 +02:00
parent 19d77064b0
commit efb2a51216
9 changed files with 185 additions and 12 deletions

View file

@ -0,0 +1,41 @@
package extras
import (
"context"
"github.com/FAU-CDI/wisski-distillery/internal/phpx"
"github.com/FAU-CDI/wisski-distillery/internal/status"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/php"
_ "embed"
)
// Prefixes implements reading and writing prefix
type Theme struct {
ingredient.Base
Dependencies struct {
PHP *php.PHP
}
}
//go:embed theme.php
var themePHP string
// Get returns the currently active theme
func (t *Theme) Get(ctx context.Context, server *phpx.Server) (theme string, err error) {
err = t.Dependencies.PHP.ExecScript(
ctx, server, &theme, themePHP,
"get_active_theme",
)
return
}
func (t *Theme) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
if flags.Quick {
return
}
info.Theme, _ = t.Get(flags.Context, flags.Server)
return
}