Invision Power Services, Inc. * @copyright (c) Invision Power Services, Inc. * @license https://www.invisioncommunity.com/legal/standards/ * @package Invision Community * @since 18 Feb 2013 */ namespace IPS\Helpers; /* To prevent PHP errors (extending class does not exist) revealing path */ use DomainException; use Exception; use IPS\Application; use IPS\Db; use IPS\Extensions\FormsAbstract; use IPS\File; use IPS\Helpers\Form\CheckboxSet; use IPS\Helpers\Form\FormAbstract; use IPS\Helpers\Form\Matrix; use IPS\Helpers\Form\SocialGroup; use IPS\Http\Url; use IPS\IPS; use IPS\Lang\Setup\Lang; use IPS\Login; use IPS\Member; use IPS\Output; use IPS\Request; use IPS\Session; use IPS\Settings; use IPS\Theme; use Throwable; use UnderflowException; use function count; use function defined; use function func_get_args; use function in_array; use function is_array; use function is_string; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * Form Builder */ class Form { /* Used by the Forms Extensions */ const FORM_REGISTRATION = 'registration'; const FORM_CHECKOUT = 'checkout'; /** * @brief Form ID */ public ?string $id = ''; /** * @brief Action URL */ public string|Url $action = ''; /** * @brief Input Elements HTML */ public array $elements = array(); /** * @brief Hidden Fields */ public array $hiddenFields = array(); /** * @brief Tabs */ protected array $tabs = array(); /** * @brief Current Tab we're adding elements to */ protected string $currentTab = ''; /** * @brief Active tab */ public ?string $activeTab = NULL; /** * @brief Additional class for tables */ protected array $tabClasses = array(); /** * @brief Sidebar */ public array $sidebar = array(); /** * @brief CSS Class(es) */ public string $class = 'ipsForm--default '; /** * @brief Generic Form Error */ public string $error = ''; /** * @brief Hidden Values */ public array $hiddenValues = array(); /** * @brief Extra attributes for `