/** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Wrapper/Modal/Modal.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Wrapper; use ARUNOX\Database\BaseEntity; use ARUNOX\Plugins\REST\Response; use ARUNOX\Plugins\REST\Generator; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Base\BaseWrapper; use ARUNOX\Plugins\REST\Generator\Base\BaseGenerator; use ARUNOX\Plugins\REST\Generator\Helpers\ActionHelpers; class Modal extends BaseWrapper { /* ### TRAITS ################################################### # */ use ActionHelpers; /* ### VARIABLES ################################################ # */ protected static string $TYPE = "wrapper"; protected ?string $HISTORY = NULL; protected ?string $GENERATOR = "dialog"; protected array $ALLOWED_CONTENT = []; protected array $ALLOWED_CONFIG = [ "id" => Config\Type::String, "size" => Modal\Size::class, "width" => Modal\Size::class, "close" => Config\Type::Bool, "backdrop" => Config\Type::Bool, "icon" => Config\Type::String, "color" => Config\Color::class, ]; protected array $ALLOWED_DATA = [ "list" => Config\Type::Array, "data" => BaseEntity::class, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ public function getContent() { return $this->get(); } /* ### PUBLIC STATIC FUNCTIONS ################################## # */ public static function close( string $name ) { return [ "type" => "dialog", "action" => "close", "name" => $name ]; } public static function details( ...$args ) : BaseGenerator { return parent::create( "data/form", ...$args ); } public static function overview( ...$args ) : BaseGenerator { return parent::create( "data/table", ...$args ); } /* ### MAGIC FUNCTIONS ########################################## # */ public function __construct( ?string $template = NULL, ?string $title = "Modal", ...$args ) { parent::__construct( $title, $template, ...$args ); $this->setSize( Modal\Size::md ); $this->setClose( TRUE ); $this->setBackdrop( TRUE ); } } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Wrapper/Modal/Size.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Wrapper\Modal; /* ### ENUMS ######################################################## # */ enum Size : string { case sm = "sm"; case md = "md"; case lg = "lg"; case xl = "xl"; case full = "full"; /* ### MAGIC FUNCTIONS ########################################## # */ }