Loginpage classes
Request
Iacbox\Loginpage\Request
Request
encapsulates all request environment super globals like POST and GET params, path and the current Session
Class reference
/**
* Returns unique ID of the request
* @return string ID of the request
*/
public function getID():string {}
/**
* Returns request method of the request
* @return string Request method of the request
*/
public function getMethod():string {}
/**
* Returns path of the request
* @return string Path of the request
*/
public function getPath():string {}
/**
* Returns query string of the the request
* @return string Query string of the request
*/
public function getQueryString():string {}
/**
* Returns hash of GET params of the request
* @return array GET params of the request
*/
public function getGetParams():array {}
/**
* Returns specific GET param of the request
* @param string $paramName Name of GET param to read
* @return string Specified GET param or null if not found
*/
public function getGetParam(string $paramName):?string {}
/**
* Returns hash of POST params of the request
* @return array Post params of the request
*/
public function getPostParams():array {}
/**
* Returns specific POST param of the request
* @param string $paramName Name of POST param to read
* @return string Specified POST param or null if not found
*/
public function getPostParam(string $paramName):?string {}
/**
* Returns $_SERVER array of the request
* @return array The current $_SERVER hash
*/
public function getServerParams():array {}
/**
* Returns GET or POST param in that order of the request by name
* @param string $paramName Name of param to read
* @return string Specified GET/POST param of the request or null if not found
*/
public function getRequestParam(string $paramName):?string {}
/**
* Returns specified $_SERVER param of this request
* @param string $paramName Name of param from $_SERVER to read
* @return array Specified $_SERVER value of the request or null if not found
*/
public function getServerParam(string $paramName):?string {}
/**
* Returns specified file from $_FILES of this request
* @param string $paramName Name of param from $_FILES to read
* @return array Specified $_FILES value of the request or null if not found
*/
public function getFile(string $paramName):?array {}
/**
* Returns $_COOKIE array of this request
* @return array $_COOKIE hash of this request
*/
public function getCookies():array {}
/**
* Returns specified cookie from $_COOKIE of request
* @param string $paramName Name of param from $_COOKIE to read
* @return array Specified $_COOKIE value of the request or empty string if not found
*/
public function getCookie(string $cookieName):string {}
/**
* Returns login page Session object of the request
* @return Session Session object of the request
*/
public function getSession():Session {}
/**
* Check if request has method POST
* @return bool True if this is a HTTP POST
*/
public function isPost():bool {}
/**
* Check if request has method GET
* @return bool True if this is a HTTP GET
*/
public function isGet():bool {}
/**
* Check for XHR requests by checking the xmlhttprequest HTTP header or if GET/POST param "xhr=1" is set.
* Mainly used to know if there should any header be outputed or not.
* @return bool True if this is an XHR request
*/
public function isXHR():bool {}
/**
* Return user agent of the Request
* @return string The user agent if sent as HTTP header or the string 'unknown'
*/
public function getUserAgent() {}
/**
* Overwrite hash of GET params of the request
* @param array $getParams Hash of GET params
* @return void
*/
public function overwriteGetParams(array $getParams) {}
/**
* Overwrite hash of POST params of the request
* @param array $postParams Hash of POST params
* @return void
*/
public function overwritePostParams(array $postParams) {}
Session
Iacbox\Loginpage\Session
Session
holds all information of current login page state, client MAC, IP and vlan information and various backend states
Class reference
// Login page state constants
/** Starting state of login page */
const AUTH_NEEDED = 2;
/** Waiting for an internal callback with an success/error code */
const AUTH_PENDING = 3;
/** Waiting for an external callback (current login method redirects to external websites like social or payment logins) */
const AUTH_EXT_PENDING = 4;
/** Mainly for prepaid tickets (paypal, etc) - to know what to charge a selction has to be made */
const TEMPLATE_BEFORE_NEEDED = 5;
/** Mainly for PMS - authentication was ok, but template selection is needed */
const TEMPLATE_AFTER_NEEDED = 6;
/** Authentication was successful - user is online */
const ONLINE = 8;
/** User is taken online for a short amount to make an action */
const TEMPORARILY_ONLINE = 10;
/** Password change needed for login */
const PASSWORD_CHANGE_NEEDED = 14;
/**
* Return unique id of the session
* @return string ID of the session
*/
public function getID():string {}
/**
* Return IP address of the client
* @return string IP address of the client
*/
public function getIP():string {}
/**
* Return MAC address of the client
* @return string MAC address of the client in the long uppercase format like "AA:BB:CC:11:22:33"
*/
public function getMAC():string {}
/**
* Return short MAC address of the client as lowercase without colons ":"
* @return string Short MAC address of the client like "aabbcc112233"
*/
public function getShortMAC():string {}
/**
* Returns pseudonymized MAC hashed with sha512/256
* @return string The pseudonymized MAC as partial hash as hex string.
*/
public function getPseudonymizedMAC() {}
/**
* Return vlan id of the client
* @return string VLAN id of the client (0 if not set)
*/
public function getVLAN():?int {}
/**
* Return route id the client
* route id = 4096 + route id in webadmin
* @return string Route id of the client (0 if not set)
*/
public function getRouteID():?int {}
/**
* Return currently active login method
* @return string Active login method or null if no login method active
*/
public function getUsedLoginMethod():?string {}
/**
* Return timestamp of last save interaction of the session
* @return int timestamp of last interaction
*/
public function getLastInteraction():?int {}
/**
* Return timestamp of last online state of the session
* @return int timestamp of last online state
*/
public function getLastSuccessfulLogin():?int {}
/**
* Return language set in the session
* @return string Language identifier of the session
*/
public function getLang():?string {}
/**
* Set the login page state and save this object in the $_SESSION.
* @param int $state State constant defined in Session
* @return int The state constant that was passed as argument to be able to return it (often used in plugins)
*/
public function setState($state) {}
/**
* Returns current login page state of the session
* @return int The current state
*/
public function getState():int {}
/**
* Returns login page state before login page logic started
* @return int The previous state
*/
public function getPreviousState():int {}
/**
* Returns last status from device status
* @return int The last status from device status
*/
public function getLastStatus():array {}
/**
* Returns current login page state before login page logic started as string
* @return string The current login page state as string
*/
public function getStateAsString() {}
/**
* Returns previous login page state as string
* @return string The previous login page state as string
*/
public function getPreviousStateAsString():string {}
/**
* Saves a specific key=value pair in the session
* Attention: does not save the session, to save session call save() function
* @param string $key Key which will be defiend
* @param mixed $value Value to the key
* @return void
*/
public function setBackendState($key, $value) {}
/**
* Returns the saved value for the given key from session
* @param string $key Key to find a specific value
* @return mixed|null Found Value or null if not found
*/
public function getBackendState($key) {}
/**
* Saves the session
* @return void
*/
public function save() {}
Response
Iacbox\Loginpage\Response
Response
encapsulates a response to a request.
If provided it holds the information what to render or the answer to a XHR call.
Each function requiring a Response
class as a return value also accepts null
, which indicates to continue with default login page logic.
Class reference
// constants for http return codes returned by response
/** HTTP return code 200 OK*/
public const HTTP_SUCCESS = 200;
/** HTTP return code 204 No Content*/
public const HTTP_NO_CONTNET = 204;
/** HTTP return code 301 Moved Permanently*/
public const HTTP_MOVED_PERMANENTLY = 301;
/** HTTP return code 302 Found (previously Moved Temporarily)*/
public const HTTP_MOVED_TEMPORARILY = 302;
/** HTTP return code 400 Bad request */
public const HTTP_BAD_REQUEST = 400;
/** HTTP return code 401 Unauthorized*/
public const HTTP_UNAUTHORIZED = 401;
/** HTTP return code 403 Forbidden*/
public const HTTP_FORBIDDEN = 403;
/** HTTP return code 404 Not Found*/
public const HTTP_NOT_FOUND = 404;
/** HTTP return code 405 Method Not Allowed*/
public const HTTP_METHOD_NOT_ALLOWED = 405;
/** HTTP return code 500 Internal Server Error*/
public const HTTP_INTERNAL_SERVER_ERROR = 500;
// constants for MIME type returned by response
/** MIME for plain text */
public const MIME_PLAIN_TEXT = 'plain/text';
/** MIME for html */
public const MIME_HTML = 'text/html; charset=UTF-8';
/** MIME for json */
public const MIME_JSON = 'application/json';
/** MIME for xml */
public const MIME_XML = 'application/xml';
/** MIME for octet stream */
public const MIME_BINARY_DATA = 'application/octet-stream';
/**
* Construct new generic response for request handler
* @param int $httpCode Http code returned by response (default = HTTP_SUCCESS)
* @param string $mimeType Mime type returned by response (default = MIME_HTML)
* @param string $body Body returned by response (default = '')
* @return void
*/
public function __construct() {}
/**
* Return response object with Mime type HTML
* @param string $html Html content sent with reponse
* @param int $httpCode Http code returned by response (default = HTTP_SUCCESS)
* @return Response response for request handler
*/
public static function createHTMLResponse(string $html, int $httpCode = self::HTTP_SUCCESS):Response {}
/**
* Return response object with Mime type JSON
* @param array $jsonData JSON content as Hash to encode
* @param int $httpCode Http code returned by response (default = HTTP_SUCCESS)
* @return Response response for request handler
*/
public static function createJSONResponse(array $jsonData, int $httpCode = self::HTTP_SUCCESS):Response {}
/**
* Return response object with Mime type XML
* @param string $xml XML content sent with reponse
* @param int $httpCode Http code returned by response (default = HTTP_SUCCESS)
* @return Response response for request handler
*/
public static function createXMLResponse(string $xml, int $httpCode = self::HTTP_SUCCESS):Response {}
/**
* Return response object with Mime type Binary
* @param string $fullPathToFile Full Path to file to send as content
* @param string $mimeType Mime type returned by response (default = MIME_BINARY_DATA)
* @return Response response for request handler
*/
public static function createBinaryResponse(string $fullPathToFile, string $mimeType = self::MIME_BINARY_DATA):Response {}
/**
* Return response object for redirect
* @param string $targetURI Target URI for redirect
* @param boolk $permanently true if HTTP_MOVED_PERMANENTLY 301 else HTTP_MOVED_TEMPORARILY 302
* @return Response response for request handler
*/
public static function createRedirectResponse(string $targetURI, bool $permanently = false):Response {}
/**
* Return response object with HTTP_METHOD_NOT_ALLOWED 405;
* @return Response response for request handler
*/
public static function createMethodNotAllowedResponse():Response {}
/**
* Return response object with with HTTP_NOT_FOUND 404
* @param string $path Path for not found message
* @return Response response for request handler
*/
public static function createNotFoundResponse(?string $path):Response {}
LoginServiceResponse
Iacbox\Loginpage\Comm\LoginServiceResponse
LoginServiceResponse
holds all data and states returned from an login attempt by a login method
Class reference
/**
* Check if an error occurred during login request
* @return bool true if error occurred during login
*/
public function hadError():bool {}
/**
* Check if password change is required for login request
* @return bool true if password change is required
*/
public function needPasswordChange():bool {}
/**
* Check if client is online after login request
* @return bool true if client is online
*/
public function isDeviceOnline():bool {}
HtmlBuilder
Iacbox\Loginpage\Html\HtmlBuilder
HtmlBuilder
provides multiple functions to generate DOMElements for render functions
Class reference
// constants for css icons
const ICON_EMAIL = 'iac-email-action-unread';
const ICON_PMS = 'iac-hotel-double-bed-1';
const ICON_FACEBOOK = 'iac-social-media-facebook';
const ICON_TWITTER = 'iac-social-media-twitter';
const ICON_GOOGLE_PLUS = 'iac-social-media-google-plus-1';
const ICON_TICKET = 'iac-ticket';
const ICON_MOBILE_PHONE = 'iac-mobile-phone';
const ICON_LOGOUT = 'iac-logout';
const ICON_WIFI = 'iac-wifi';
const ICON_LINKEDIN = 'iac-professional-network-linkedin';
const ICON_FILE = 'iac-common-file-horizontal-image';
const ICON_GOOGLE = 'iac-logo-google-1';
const ICON_WINDOWS = 'iac-logo-windows-1';
const ICON_ARROW_DOWN = 'iac-arrow-down-slim';
const ICON_ARROW_UP = 'iac-arrow-up-slim';
const ICON_CREDIT_CARD = 'iac-credit-card-1';
const ICON_USER = 'iac-user-single-neutral';
const ICON_MICROSOFT_365 = 'iac-business-media-microsoft-365';
// constants for validation used in setValidation()
/** No validation */
const VALIDATION_NONE = 'none';
/** Validate Username (not allowed characters '(\'"<>$&?;,^)') */
const VALIDATION_USERNAME = 'username';
/** Validate Password (Unicode: Letters, Numbers, Symbols and Punctuation) */
const VALIDATION_PASSWORD = 'password';
/** Validate Email */
const VALIDATION_EMAIL = 'email';
/** Validate Mobilenumber */
const VALIDATION_MOBILENUMBER = 'mobilenumber';
/** Validate Numeric */
const VALIDATION_NUMERIC = 'numeric';
/** Validate Alphanumeric (Unicode: Letters, Numbers, '-' and '_')*/
const VALIDATION_ALPHANUMERIC = 'alphanumeric';
/** Validate Mobilenumber (A-Z, a-z, 0-9, '-' and '_')*/
const VALIDATION_ALPHANUMERIC_ASCII = 'alphanumericASCII';
/** Validate LETTER (UNICODE: Letters) */
const VALIDATION_LETTER = 'letter';
/** Validate LETTER WITH WHITESPACE (UNICODE: Letters, Sperators, Dash_Punctuation, Apostrophe)*/
const VALIDATION_LETTER_WHITESPACE = 'letterWhitespace';
/**
* Create new DOMElement
* @param string $tag Tag name of the element
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Element created
*/
public function createElement(string $tag, array $cssClasses = []):DOMElement {}
/**
* Create new div DOMElement
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Div element created
*/
public function createDiv(array $cssClasses = []):DOMElement {}
/**
* Create new form DOMElement
* @param string $action value of action attribute of form
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Div element created
*/
public function createForm(string $action, array $cssClasses = []):DOMElement {}
/**
* Create new label DOMElement
* @param string $text Text to add or fallback for translation key if set
* @param string $textKey Translation key to use (default = null)
* @param string $forElemName value of for attribute of label
* @param array $cssClasses array of CSS classes to add (default =[])
* @param DOMElement $linkElem Additional element added as child of label element (default = null)
* @return DOMElement Label element created
*/
public function createLabel(string $text, ?string $textKey = null, ?string $forElemName = null, array $cssClasses = [], ?DOMElement $linkElem = null):DOMElement {}
/**
* Create new button DOMElement
* @param string $text Text to add or fallback for translation key if set
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Button element created
*/
public function createButton(string $text, ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new submit button DOMElement
* @param string $text Text to add or fallback for translation key if set
* @param string $name Name of submit button
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Div element with submit button element
*/
public function createSubmitButton(string $text, string $name, ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new cancel submit button DOMElement (submit without form validation)
* @param string $text Text to add or fallback for translation key if set
* @param string $name Name of submit button
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Div element with submit button element
*/
public function createCancelButton(string $text, string $name, ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new submit button with icon DOMElement (submit without form validation)
* @param $icon cssIcon identifier
* @param string $text Text to add or fallback for translation key if set
* @param string $name Name of submit button
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Div element with submit button element
*/
public function createIconSubmitButton($icon, string $text, string $name, ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new text input element
* @param string $name Name of text input
* @param string $value Initial value of input (default = '')
* @param string $placeholder Placeholder of input (default = '')
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Input element created
*/
public function createTextInput(string $name, string $value = '', string $placeholder = '', array $cssClasses = []):DOMElement {}
/**
* Create new password input element
* @param string $name Name of password input
* @param string $value Initial value of input (default = '')
* @param string $placeholder Placeholder of input (default = '')
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Input element created
*/
public function createPasswordInput(string $name, string $value = '', string $placeholder = '', array $cssClasses = []):DOMElement {}
/**
* Create new checkbox element
* @param string $name Name of checkbox element
* @param string $value Value attribute of input
* @param bool $checked Initial status of checkbox (default = false)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Checkbox element created
*/
public function createCheckbox(string $name, string $value, bool $checked = false, array $cssClasses = []):DOMElement {}
/**
* Create new hidden input element
* @param string $name Name of hidden input
* @param string $value Initial value of input (default = '')
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Hidden input element created
*/
public function createHiddenInput(string $name, string $value = '', array $cssClasses = []):DOMElement {}
/**
* Create new textarea input element
* @param string $name Name of textarea input
* @param string $value Initial value of input (default = '')
* @param string $placeholder Placeholder of input (default = '')
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Text area element created
*/
public function createTextArea(string $name, string $value = '', string $placeholder = '', array $cssClasses = []):DOMElement {}
/**
* Create new dropdown element
* @param string $name Name of dropdown
* @param array $options Hash of options ['value' => 'text']
* @param string $selected Initial selected key (default = '')
* @param array $cssClasses Array of CSS classes to add (default = [])
* @param bool $doHTMLEscaping True if options text should be html escaped (default = true)
* @return DOMElement Input element created
*/
public function createDropdown(string $name, array $options, string $selected = '', array $cssClasses = [], bool $doHTMLEscaping = true):DOMElement {}
/**
* Create new radio select element
* @param string $name Name of radio select
* @param string $value Value attribute of radio select
* @param bool $checked Initial status of radio select (default = false)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Radio Select element created
*/
public function createRadioSelect(string $name, string $value, bool $checked = false, array $cssClasses = []):DOMElement {}
/**
* Create new image element
* @param string $src Source of image (default = '')
* @param string $title Title of image (default = '')
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Image element created
*/
public function createImage(?string $src = '', ?string $title = '', array $cssClasses = []):DOMElement {}
/**
* Create new link element
* @param string $href Href attribute of link (default = null)
* @param string $target Target attribute of link if set (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Link element created
*/
public function createLink(?string $href = null, ?string $target = null, array $cssClasses = []):DOMElement {}
/**
* This creates a text node which will render just the text - no HTML tags are involved.
* For a full text node with span tag and possible translation please use createText().
* @param string $text Text to be rendered (default = '')
* @param bool $noSanitize True if text should be html sanitized (default = false)
* @return DOMText Text node created
*/
public function createTextOnly(string $text = '', bool $noSanitize = false):DOMText {}
/**
* Create new text span DOMElement
* @param string $text Text to add or fallback for translation key if set (default = '')
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Text span element created
*/
public function createText(?string $text = '', ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new paragraph DOMElement
* @param string $text Text to add or fallback for translation key if set (default = '')
* @param string $textKey Translation key to use (default = null)
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Paragraph element created
*/
public function createParagraph(string $text = null, ?string $textKey = null, array $cssClasses = []):DOMElement {}
/**
* Create new iframe DOMElement
* @param string $url Url for iframe
* @param array $cssClasses array of CSS classes to add (default =[])
* @return DOMElement Iframe element created
*/
public function createIFrame(string $url, array $cssClasses = []):DOMElement {}
/**
* Create icon DOMElement
* @param string $iconCSS css icon constant
* @return DOMElement Icon element created
*/
public function createIcon(string $iconCSS) {}
/**
* Create script DOMElement
* @param string $javascriptCode Javascript added inside tag (default = '')
* @return DOMElement Script element created
*/
public function createInlineJavascript(string $javascriptCode = ''):DOMElement {}
/**
* Create style DOMElement
* @param string $css CSS added inside tag (default = '')
* @return DOMElement Style element created
*/
public function createInlineCSS(string $css = ''):DOMElement {}
/**
* Apply CSS classes to a DOMElement
* @param DOMElement $elem DOMElement to which CSS classes are applied
* @param array $cssClasses Array of CSS classes to apply
* @return DOMElement DOMElement with CSS classes applied
*/
public function applyCSS(DOMElement $elem, array $cssClasses):DOMElement {}
/**
* Add CSS classes to a DOMElement
* @param DOMElement $elem DOMElement to which CSS classes are applied
* @param array $cssClasses Array of CSS classes to add
* @return DOMElement DOMElement with CSS classes added
*/
public function addCSSClasses(DOMElement $elem, array $cssClasses):DOMElement {}
/**
* Add ID to a DOMElement
* @param DOMElement $elem DOMElement to add ID to
* @param string $ID ID to add
* @return DOMElement DOMElement with ID added
*/
public function setID(DOMElement $elem, string $ID):DOMElement {}
/**
* Add attributes to a DOMElement
* @param DOMElement $elem DOMElement to add attributes to
* @param array $attributes Hash of attributes ['attribute' => 'value']
* @return DOMElement DOMElement with attributes added
*/
public function setAttributes(DOMElement $elem, array $attributes):DOMElement {}
/**
* Add JS Validation to a DOMElement
* @param DOMElement $elem DOMElement to add validation to
* @param string $language Language to use for validation error message
* @param string $validationType Validation constant as defined in HtmlBuilder
* @param bool $required JS handler to add
* @return DOMElement DOMElement with validation added
*/
public function setValidation(DOMElement $elem, string $language, string $validationType, bool $required=true):DOMElement {}
/**
* Add OnClickHandler to a DOMElement
* @param DOMElement $elem DOMElement to add OnClickHandler to
* @param string $handler JS handler to add
* @return DOMElement DOMElement with handler added
*/
public function setOnClickHandler(DOMElement $elem, string $handler):DOMElement {}
/**
* Render DOMNode to html
* @param DOMNode $rootElement DOMNode to render
* @return string Rendered Html from DOMNode
*/
public function render(DOMNode $rootElement):string {}
/**
* Add Html to a DOMNode
* @param DOMNode $parent DOMNode to add html to
* @param string $html Html to add
* @return void
*/
function appendHTML(DOMNode $parent, string $html) {}
RenderHelper
Iacbox\Loginpage\Extension\RenderHelper
RenderHelper
provides multiple functions to find insertPoints in forms and login methods for onPrepareRenderListener and multiple functions for easy generation of html elements with surrounding divs, compatible with default login page themes and the login page editor.
Each extension class offers the function getRenderHelper()
which returns a working instance of RenderHelper
.
Class reference
/**
* Returns list of all insertPoints at he start of each form in node
* @param DOMElement $rootNode base node to search
* @param bool $allForms If true include forms with 'ignoreRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsAtStartOfForms(DOMElement $rootNode, bool $allForms = false):array {}
/**
* Returns list of all insertPoints before submit button or terms of use of each form in node
* @api
* @param DOMElement $rootNode base node to search
* @param bool $allForms If true include forms with 'ignoreRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsBeforeSubmitOfForms(DOMElement $rootNode, bool $allForms = false):array {}
/**
* Returns list of all insertPoints at he start of each form in node
* @api
* @param DOMElement $rootNode base node to search
* @param array $excludeList List of LoginMethod names ignored
* @param bool $allLoginMethods If true include LoginMethods with 'ignoreOnRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsAtStartOfLoginMethodsWithExcludeList(DOMElement $rootNode, array $excludeList, bool $allLoginMethods = false):array {}
/**
* Returns list of all insertPoints at he start of each form in node
* @api
* @param DOMElement $rootNode base node to search
* @param array $includeList List of LoginMethod names allowed
* @param bool $allLoginMethods If true include LoginMethods with 'ignoreOnRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsAtStartOfLoginMethodsWithIncludeList(DOMElement $rootNode, array $includeList, bool $allLoginMethods = false):array {}
/**
* Returns list of all insertPoints at he start of each form in node
* @api
* @param DOMElement $rootNode base node to search
* @param array $excludeList List of LoginMethod names ignored
* @param bool $allLoginMethods If true include LoginMethods with 'ignoreOnRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsBeforeSubmitOfLoginMethodsWithExcludeList(DOMElement $rootNode, array $excludeList, bool $allLoginMethods = false):array {}
/**
* Returns list of all insertPoints at he start of each form in node
* @api
* @param DOMElement $rootNode base node to search
* @param array $includeList List of LoginMethod names allowed
* @param bool $allLoginMethods If true include LoginMethods with 'ignoreOnRender' set (default = false)
* @return array List of all form insert Points in node as Hash ['parent', 'insertPoint']
*/
public function getInsertPointsBeforeSubmitOfLoginMethodsWithIncludeList(DOMElement $rootNode, array $includeList, bool $allLoginMethods = false):array {}
/**
* Returns translation key from text input with 'translatable' set
* @api
* @param string Text from text Input
* @param string Fallback translation Key if none found in text (default null)
* @return string Translation key set in text input else default if set or ''
*/
public function getTranslationKeyFromText(string $text, string $fallback = null):string {}
/**
* Returns translation for translation key
* @api
* @param string $key Translation key
* @param string $fallback Fallback if no translation available for key (default = null)
* @return string Translation for key else fallback if set or translation key if fallback is null
*/
public function translate(string $key, ?string $fallback = null):string {}
/**
* Returns instance of HtmlBuilder class
* @api
* @return HtmlBuilder Instance of HtmlBuilder
*/
public function getHtmlBuilder():HtmlBuilder {}
/**
* Creates Html from DOMElement and its childs to be send with Response class
* @api
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $domElement DOMElement to be converted to html
* @return string Html text representing DOMElement
*/
public function createHtmlFromDOMElement(HtmlBuilder $builder, DOMElement $domElement):string {}
/**
* Add text to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append text
* @param string $text Text to add or fallback for translation key if set
* @param string $translationKey Translation key to use (default = null)
* @param string $alignment Alignment of text (center, left, right, default = '')
* @return void
*/
public function addText(Request $request, HtmlBuilder $builder, DOMElement &$form, string $text, string $translationKey = null, string $alignment = '') {}
/**
* Add input field to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append input field
* @param string $name Name of text input used for post param
* @param string $label Label for input or fallback for translation key if set
* @param string $labelTranslationKey Translation key to use (default = null)
* @param string $validation Identifier of Validation to use from HtmlBuilder (default = 'none')
* @return void
*/
public function addTextInput(Request $request, HtmlBuilder $builder, DOMElement &$form, string $name, string $label, string $labelTranslationKey = null, string $validation = 'none') {}
/**
* Add masked input to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append masked input
* @param string $name Name of text input used for post param
* @param string $label Label for input or fallback for translation key if set
* @param string $labelTranslationKey Translation key to use (default = null)
* @param string $validation Identifier of Validation to use from HtmlBuilder (default = 'none')
* @return void
*/
public function addMaskedTextInput(Request $request, HtmlBuilder $builder, DOMElement &$form, string $name, string $label, string $labelTranslationKey, string $validation = 'none') {}
/**
* Add select input to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append select
* @param string $name Name of text input used for post param
* @param array $options Hash of options with [value => displayed text for option]
* @param string $label Label for select or fallback for translation key if set
* @param string $labelTranslationKey Translation key to use (default = null)
* @return void
*/
public function addSelect(Request $request, HtmlBuilder $builder, DOMElement &$form, string $name, array $options, string $label, string $labelTranslationKey) {}
/**
* Add checkbox to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append checkbox
* @param string $name Name of checkbox used for post param
* @param string $label Label for checkbox or fallback for translation key if set
* @param string $labelTranslationKey Translation key to use (default = null)
* @param bool $required true if checkbox is required to be checked for submit
* @return void
*/
public function addCheckbox(Request $request, HtmlBuilder $builder, DOMElement &$form, string $name, string $label, string $labelTranslationKey, bool $required = false) {}
/**
* Add submit button to DOMElement form with default LoginMethod layout
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $form DOMElement form to append submit button
* @param string $name Name of submit button used for post param
* @param string $label Label for submit button or fallback for translation key if set
* @param string $labelTranslationKey Translation key to use (default = null)
* @return void
*/
public function addSubmit(Request $request, HtmlBuilder $builder, DOMElement &$form, string $name, string $text, string $translationKey) {}
/**
* Add expandable div to a DOMElement
* @api
* @param Request $request Request from login page
* @param HtmlBuilder $builder HtmlBuilder to use
* @param DOMElement $parent DOMElement form to append expandable div
* @param DOMElement $headerDiv Div DOMElement representing clickable header to expand/collapse content
* @param DOMElement $contentDiv Div DOMElement representing content
* @param bool $expanded true/false if starting state is expanded/collapsed
* @return void
*/
public function addExpandableBox(Request $request, HtmlBuilder $builder, DOMElement &$parent, DOMElement $headerDiv, DOMElement $contentDiv, bool $expanded) {}