/** Datei: plugins/users/hooks/generator/controls.php **/ username.users", function( array $config ) { return array_replace_recursive( $config, [ "label" => "Benutzername", "validate" => [ "required" => "Bitte geben Sie einen Benutzernamen an!", "request" => [ "route" => "/users/{hashid}/validate/username", "method" => "POST", "waiting" => "Eingabe wird überprüft!", "message" => "Der eingegeben Benutzername wird bereits verwendet!", ], ], ]); }); Hooks::add("rest.generator::control.name->email.users", function( array $config ) { return array_replace_recursive( $config, [ "validate" => [ "request" => [ "route" => "/users/{hashid}/validate/email", "method" => "POST", "waiting" => "Eingabe wird überprüft!", "message" => "Der eingegeben E-Mail-Adresse wird bereits verwendet!", ], ], ]); }); Hooks::add("rest.generator::control.type->select", function( array $config ) { foreach( $config["options"] as &$option ) { if( $option["value"] < Users\Model::getRole() ) { $option = NULL; } } $config["options"] = array_filter( $config["options"] ); $config["options"] = array_values( $config["options"] ); return $config; }); /** Datei: plugins/users/hooks/generator/buttons.php **/ password", function( array $config, string $plugin, string $route_id = "id" ) { return array_replace_recursive([ "label" => "Passwort ändern", "color" => REST\Generator\Config\Color::Secondary, "icon" => "bi bi-key", "action" => "/{$plugin}/{{$route_id}}/password", ], $config ); }); Hooks::add("rest.generator::button.name->simulate", function( array $config, string $plugin, string $route_id = "id" ) { return array_replace_recursive([ "label" => "Benutzer simulieren", "color" => REST\Generator\Config\Color::Default, "icon" => "bi bi-play-fill", "action" => "/{$plugin}/{{$route_id}}/simulate", ], $config ); }); /** Datei: plugins/users/hooks/generator/columns.php **/ username.users", function( array $config ) { return array_replace_recursive( $config, [ "label" => "Benutzername", ]); });