Add CSRF token validation and include tokens in authentication, website manager, and GrapesJS forms and requests. Harden login with password hash verification and session ID regeneration, validate database identifiers and charset, and secure upload MIME detection and filename generation. Update nullable type declarations and PHP syntax across core contracts and modules, switch the Docker image to PHP 8.4, and move the theme script asset to the end of the page. Refresh the PageBuilderBody distribution assets.
65 lines
1.6 KiB
PHP
65 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Plugi\Contracts;
|
|
|
|
interface PageBuilderContract
|
|
{
|
|
/**
|
|
* Process the current GET or POST request and redirect or render the requested page.
|
|
*
|
|
* @param $route
|
|
* @param $action
|
|
* @param PageContract|null $page
|
|
*/
|
|
public function handleRequest($route, $action, ?PageContract $page = null);
|
|
|
|
/**
|
|
* Render the given page inside the PageBuilder.
|
|
*
|
|
* @param PageContract $page
|
|
*/
|
|
public function renderPageBuilder(PageContract $page);
|
|
|
|
/**
|
|
* Render the given page.
|
|
*
|
|
* @param PageContract $page
|
|
* @param null $language
|
|
* @return string
|
|
*/
|
|
public function renderPage(PageContract $page, ?string $language = null): string;
|
|
|
|
/**
|
|
* Update the given page with the given data (an array of html blocks)
|
|
*
|
|
* @param PageContract $page
|
|
* @param $data
|
|
* @return bool|object|null
|
|
*/
|
|
public function updatePage(PageContract $page, $data);
|
|
|
|
/**
|
|
* Get or set custom css for customizing layout of the page builder.
|
|
*
|
|
* @param string|null $css
|
|
* @return string
|
|
*/
|
|
public function customStyle(?string $css = null);
|
|
|
|
/**
|
|
* Get or set custom scripts for customizing behaviour of the page builder.
|
|
*
|
|
* @param string $location head|body
|
|
* @param string|null $scripts
|
|
* @return string
|
|
*/
|
|
public function customScripts(string $location, ?string $scripts = null);
|
|
|
|
/**
|
|
* Set a theme for the page builder.
|
|
*
|
|
* @param ThemeContract $theme
|
|
*/
|
|
public function setTheme(ThemeContract $theme);
|
|
}
|