/** Datei: plugins/pwas/library/ARUNOX/Launcher/PWA/PWA.php **/ * @copyright 2024 Sparky@ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\Launcher; use ARUNOX\Core\Hooks; use ARUNOX\Core\Launcher; use ARUNOX\Themes\LCARS\Theme; use ARUNOX\Launcher\PWA\API\v1\Controller; class PWA extends Launcher { /* ### VARIABLES ################################################ # */ /* ### PUBLIC FUNCTIONS ######################################### # */ public static function theme( string $theme ) : string { if( static::is() ) return Theme::class; return $theme; } /* ### PUBLIC HOOK FUNCTIONS #################################### # */ public static function templatePageTitle( $filterValue ) { return static::is() ? "PWA" : $filterValue; } public static function restResponseAddTemplate( $filterValue ) { if( static::is() ) { $filterValue->template = "frame"; } return $filterValue; } public static function modifyRouteRestLogin( $filterValue ) { $filterValue["action"] = [ Controller::class, "restConfigLogin" ]; return $filterValue; } public static function responseData( $filterValue ) { // show( $filterValue, FALSE ); return $filterValue; } public static function publicAPIOutput( $filterValue ) { show( $filterValue ); return $filterValue; } /* ### PROTECTED FUNCTIONS ####################################### # */ /* ### PRIVATE FUNCTIONS ######################################## # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/pwas/library/ARUNOX/Launcher/PWA/API/v1/Controller.php **/ * @copyright 2025 ARUNOX * @version 1.1.0 * * @since 1.0.0 File is created */ namespace ARUNOX\Launcher\PWA\API\v1; use ARUNOX\Plugins; use ARUNOX\Core\Hooks; use ARUNOX\API\BaseController; class Controller extends BaseController { /* ### PUBLIC REST CONFIG FUNCTIONS ############################# # */ public static function restConfigLogin() { Plugins\REST\Response::setTemplate( "login" ); return Plugins\REST\Response::addWrapper( "details", "Locked" ) ->get() ->addText( "Logge dich ein um fortzufahren" ) ->setAction( "/login", "POST" ) ->addButton(...Hooks::filter( "rest.generator::button.type->submit", [], "Anmelden", "users" )) ->addField(...Hooks::filter( "rest.generator::control.type->email", [], "email", TRUE, "login" )) ->addField(...Hooks::filter( "rest.generator::control.type->password", [], "password", FALSE, "login" )) ; } /* ### PUBLIC REST EXTENSION FUNCTIONS ########################## # */ }