Add Footer Block options to make_block
This commit is contained in:
parent
19d77064b0
commit
efb2a51216
9 changed files with 185 additions and 12 deletions
41
internal/wisski/ingredient/php/extras/theme.go
Normal file
41
internal/wisski/ingredient/php/extras/theme.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue