/** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Helpers/GroupHelpers.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Helpers; use ARUNOX\Plugins\REST\Generator\Data\Form\Group; trait GroupHelpers { /* ### TRAIT INIT FUNCTIONS ##################################### # */ public function GroupHelpersInit() { $this->addAllowedContent( "group", [ "generator" => Group::class, "args" => [], ]); } /* ### PUBLIC FUNCTIONS ######################################### # */ public function addGroup( ...$args ) { $this->add( "group", ...$args ); return isset( $args[1] ) ? $this : end( $this->content ); } } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Helpers/ControlHelpers.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Helpers; use ARUNOX\Plugins\REST\Generator; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; trait ControlHelpers { /* ### TRAIT INIT FUNCTIONS ##################################### # */ public function ControlHelpersInit() { $this->addAllowedContent( "field", [ "generator" => Control::class, "args" => [], ]); } /* ### PUBLIC FUNCTIONS ######################################### # */ public function addField( ...$args ) { if( isset( $args["type"] ) ) { $class = "ARUNOX\\Plugins\\REST\\Generator\\Data\\Form\\Control\\" . $args["type"]->name; } if( class_exists( $class ) ) { $field = Generator::create( $class, ...$args ); $this->add( "field", $field ); } else $this->add( "field", ...$args ); return $this; } public function addFields( ...$args ) { foreach( $args as $arg ) { $this->addField( ...$arg ); } } } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Form.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Base\BaseWrapper; use ARUNOX\Plugins\REST\Generator\Helpers\TextHelpers; use ARUNOX\Plugins\REST\Generator\Helpers\ActionHelpers; use ARUNOX\Plugins\REST\Generator\Helpers\ButtonHelpers; use ARUNOX\Plugins\REST\Generator\Data\Form\Helpers\GroupHelpers; use ARUNOX\Plugins\REST\Generator\Data\Form\Helpers\ControlHelpers; class Form extends BaseWrapper { /* ### TRAITS ################################################### # */ use TextHelpers, ActionHelpers, ControlHelpers, ButtonHelpers, GroupHelpers; /* ### VARIABLES ################################################ # */ protected ?string $GENERATOR = "form"; protected array $ALLOWED_CONTENT = []; protected array $ALLOWED_CONFIG = []; /* ### PUBLIC FUNCTIONS ######################################### # */ public function setApi( ...$args ) { return $this->setNamedAction( "api", ...$args ); } public function getApi( ...$args ) { return $this->getNamedAction( "api", ...$args ); } public function addTab( ...$args ) { $this->addContent( "layouts/tabs", ...$args ); return end( $this->content ); } /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Group.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Base\BaseGenerator; use ARUNOX\Plugins\REST\Generator\Helpers\TextHelpers; use ARUNOX\Plugins\REST\Generator\Data\Form\Helpers\ControlHelpers; class Group extends BaseGenerator { /* ### TRAITS ################################################### # */ use TextHelpers, ControlHelpers; /* ### VARIABLES ################################################ # */ protected static ?string $PRIMARYKEY = "title"; protected ?string $GENERATOR = "data/form/group"; protected array $ALLOWED_CONTENT = []; protected array $ALLOWED_CONFIG = [ "title" => Config\Type::String, "border" => Config\Type::Bool, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ public function __construct( ?string $title = NULL, ...$fields ) { parent::__construct(); if( $title ) $this->setTitle( $title ); $this->addFields( ...$fields ); } } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Progress.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Progress extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "api" => Config\Type::String, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Checkbox.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Checkbox extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "options" => Config\Type::Array, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Range.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Range extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "min" => Config\Type::Numeric, "max" => Config\Type::Numeric, "step" => Config\Type::Numeric, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Textarea.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Textarea extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "lines" => Config\Type::Numeric, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Radio.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Radio extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "options" => Config\Type::Array, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Type.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; /* ### ENUMS ######################################################## # */ enum Type : string { case Tel = "tel"; case URL = "url"; case Text = "text"; case Code = "code"; case Date = "date"; case Time = "time"; case File = "file"; case Range = "range"; case Email = "email"; case Radio = "radio"; case Select = "select"; case Hidden = "hidden"; case Number = "number"; case Custom = "custom"; case DateTime = "datetime-local"; case Textarea = "textarea"; case Checkbox = "checkbox"; case Password = "password"; case Progress = "progress"; /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Password.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Password extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "confirm" => Config\Type::String, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Select.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form\Control; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Data\Form\Control; class Select extends Control { /* ### VARIABLES ################################################ # */ protected array $ALLOWED_CONFIG = [ "choose" => Config\Type::String, "choose_id" => [ Config\Type::String, Config\Type::Numeric ], "options" => Config\Type::Array, ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/rest/library/ARUNOX/Plugins/REST/Generator/Data/Form/Control/Control.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Plugins\REST\Generator\Data\Form; use ARUNOX\Plugins\REST\Generator\Config; use ARUNOX\Plugins\REST\Generator\Base\BaseGenerator; use ARUNOX\Plugins\REST\Generator\Helpers\ActionHelpers; use ARUNOX\Plugins\REST\Generator\Data\Form\Control\Type; class Control extends BaseGenerator { /* ### TRAITS ################################################### # */ use ActionHelpers; /* ### VARIABLES ################################################ # */ protected static ?string $PRIMARYKEY = "key"; protected ?string $GENERATOR = "control"; protected array $ALLOWED_CONFIG = [ "key" => Config\Type::String, "label" => Config\Type::String, "title" => Config\Type::String, "hint" => Config\Type::String, "required" => Config\Type::String, "readonly" => Config\Type::Bool, "validate" => [ Config\Type::Array, Config\Type::String ], "value" => [ Config\Type::Scalar, Config\Type::Array ], "type" => Control\Type::class ]; /* ### PUBLIC FUNCTIONS ######################################### # */ /* ### MAGIC FUNCTIONS ########################################## # */ }