Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class HtmlFormBasic

HtmlElement
Extended by HtmlFormBasic

Direct known subclasses

HtmlForm

Indirect known subclasses

HtmlFormInstallation

Copyright: 2004-2016 The Admidio Team
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:

Create html form elements

This class creates html form elements. Create an instance of an form element and set the input elements inline . The class supports setting all form elements and allows you to configure all attributes programatically. The parsed form object is returned as string.


Class: HtmlFormBasic
Code: $attrArray = array('class' => 'Classname');
Code:

// Get the Instance for a new form element and set an action attribute $form = new HtmlFormBasic('test.php'); // XHTML determines that the input elements are inline elements of a block element // so we need somthing like a div Block. In this example we use a fieldset $form->addFieldSet(); // we can define a label for the input element with reference ID $form->addLabel('Field_1', 'ID_1'); // set an input element like a text field. All valid types are supported // you can define further attributes as associative array and set as parameter in correct position $form->addSimpleInput('text', 'Input_1', 'ID_1', 'Value_1', $attrArray); // add a linebreak $form->linebreak(); // next label $form->addLabel('Radio_1', 'ID_2'); // next element is a radio button $form->addSimpleInput('radio', 'Radio_1', 'ID_2', 'Value_Radio'); // add a linebreak $form->linebreak(); // Define a select box $form->addSelect('Select_Name', 'ID_3', $attrArray); // now we can also specify an optiongroup $form->addOptionGroup('Group_1', 'ID_4', $attrArray); // define options $form->addOption('Option_Value_1', 'Option_Label_1'); $form->addOption('Option_Value_2', 'Option_Label_2'); $form->addOption('Option_Value_3', 'Option_Label_3'); // end of option group $form->closeOptionGroup(); // end of select box $form->closeSelect(); // add a linebreak $form->linebreak(); // example of a text area $form->addTextArea('Textarea', '4', '4', 'Input please ...', 'ID_5', $attrArray); // close open fieldset block $form->closeFieldSet(); // print the form echo $form->getHtmlForm();


Endcode
Endcode
Par: Example of an array with further attributes
Par: Example: Creating a form element
Located at htmlformbasic.php

Methods summary

public
# __construct( string $action = null, string $id = null, string $method = 'get', string $event = null, string $script = null )

Constructor creates the element

Constructor creates the element

Parameters

$action
Optional action attribute of the form
$id
Id of the form
$method
Get/Post (Default "get" if not defined)
$event
Optional event handler
$script
Optional script or function called from event handler

Overrides

HtmlElement::__construct
public
# addFieldSet( string $legend = null, string $id = null )

Add a fieldset.

Add a fieldset.

Parameters

$legend
Description for optional legend element as string
$id
Optional ID
public
# addSimpleInput( string $type, string $name, string $id = null, string $value = '', array $arrAttributes = null )

Add a input field with attribute properties.

Add a input field with attribute properties.

Parameters

$type
Type of input field e.g. 'text'
$name
Name of the input field
$id
Optional ID for the input
$value
Value of the field (Default: empty)
$arrAttributes
Further attributes as array with key/value pairs
public
# addLabel( string $string = '', string $refId = null, string $attribute = 'for' )

Add a label to the input field.

Add a label to the input field.

Parameters

$string
Value of the label as string
$refId
$attribute
public
# addLegend( string $legend )

Add a legend element in current fieldset.

Add a legend element in current fieldset.

Parameters

$legend
Data for the element as string
public
# addOption( string $value, string $label, string $id = null, boolean $selected = false, boolean $disable = false )

Add inline element into current division.

Add inline element into current division.

Parameters

$value
Option value
$label
Label of the option
$id
Optional Id of the option
$selected
Mark as selected (Default: false)
$disable
Disable option (optional)
public
# addOptionGroup( string $label, string $id = null, array $arrAttributes = null, boolean $disable = false )

Add an option group.

Add an option group.

Parameters

$label
Label of the option group
$id
Optional Id of the group
$arrAttributes
Further attributes as array with key/value pairs
$disable
Disable option group (Default: false)
public
# addSelect( string $name, string $id = null, array $arrAttributes = null, boolean $disable = false )

Add an option group.

Add an option group.

Parameters

$name
Name of the select
$id
Optional Id of the select
$arrAttributes
Further attributes as array with key/value pairs
$disable
Disable select (Default: false)
public
# addSimpleButton( string $name, string $type, string $value, string $id = null, string $link = null )

Adds a button to the form.

Adds a button to the form.

Parameters

$name
Name of the button
$type
Type attribute (Allowed: submit, reset, button (Default: button))
$value
Value of the button
$id
Optional ID for the button
$link

If set a javascript click event with a page load to this link will be attached to the button.

public
# addTextArea( string $name, integer $rows, integer $cols, string $text = '', string $id = null, array $arrAttributes = null, boolean $disable = false )

Add a text area.

Add a text area.

Parameters

$name
Name of the text area
$rows
Number of rows
$cols
Number of cols
$text
Text as content
$id
Optional Id
$arrAttributes
Further attributes as array with key/value pairs
$disable
Disable text area (Default: false)
public
# closeFieldSet( )

Par

Close current fieldset.
public
# closeOptionGroup( )

Par

Close current option group.
public
# closeSelect( )

Par

Close current select.
public string
# getHtmlForm( )

Get the full parsed html form

Get the full parsed html form

Returns

string
Returns the validated html form as string

Methods inherited from HtmlElement

addAttribute(), addData(), addElement(), addHtml(), addParentElement(), closeParentElement(), getHtmlElement(), setAttributesFromArray()

Properties summary

Properties inherited from HtmlElement

$arrParentElements, $currentElement, $currentElementAttributes, $currentElementDataWritten, $htmlString, $mainElement, $mainElementAttributes, $mainElementWritten, $nesting, $parentFlag

Admidio API API documentation generated by ApiGen