Class form

Description

This calss handles form fields (text input, file upload, textarea .. etc)

  • author: Abdul Al-Hasany
  • version: 2010
  • copyright: Abdul Al-hasany (c) 2010
  • access: public

Located in /includes/form.class.php (line 39)


	
			
Method Summary
mixed checkbox_selection (mixed $title, [array $name_options = array()], [string $value = array()], [string $full = ''])
mixed deleteform ([string $name = 'delete'])
mixed edit_upload ( $input_name,  $post_id,  $location, [ $replace = 'replace[]'], [ $delete = 'delete[]'], [ $new = 'attachment[]'], string $field_name, string $attachment_name)
string files_upload (string $title, string $name, [int $fields_no = 4], [int $size = '50'], [string $full = ''])
string form_table ([array $form = array()])
mixed group_permission (string $msg, [array $name = array()], [string $value = ''])
string hiddenform (string $name, [string $value = ''])
string html_area ()
string inputform ([string $title = ''], string $type, string $name, [string $full = ''], [mixed $value = ''], [int $size = '35'])
mixed radio_selection (mixed $title, mixed $name, [array $options = array()], [string $value = '0'], [string $full = ''])
mixed selectform (string $title, string $name, [array $options = array()], [string $value = ''], [string $full = ''])
mixed smiles ()
mixed textarea ([string $title = 'Text'], [string $name = 'post'], [string $value = ''], [array $info = array()])
Methods
checkbox_selection (line 263)

This function handles checkbox selection

  • return: template containing checkbox form field
mixed checkbox_selection (mixed $title, [array $name_options = array()], [string $value = array()], [string $full = ''])
  • mixed $title: title of the form field
  • array $name_options: array containing checkbox values and titles
  • string $value: intial checked values
  • string $full: fill with * to make it a requrired form field
deleteform (line 381)

function adds a deleting form field

  • return: template inclding form field
mixed deleteform ([string $name = 'delete'])
  • string $name: name of the form field
edit_upload (line 286)

handles editing file upload, paritcularly attachments

  • return: template with edit upload form field
mixed edit_upload ( $input_name,  $post_id,  $location, [ $replace = 'replace[]'], [ $delete = 'delete[]'], [ $new = 'attachment[]'], string $field_name, string $attachment_name)
  • string $field_name: name of the input
  • string $attachment_name: name of attachment to be edited
  • $input_name
  • $post_id
  • $location
  • $replace
  • $delete
  • $new
files_upload (line 398)

handles file upload field

  • return: template containg input form field
string files_upload (string $title, string $name, [int $fields_no = 4], [int $size = '50'], [string $full = ''])
  • string $title: title of the input
  • string $name: name of the input
  • string $full: fill with * to make it a required input
  • int $size: size of the input box
  • int $fields_no: no of maximum fields to display
form_table (line 49)

Display the form table with all the form elements

  • return: form template containg all the elements
string form_table ([array $form = array()])
  • array $form: accepts an array containg action, method, name, submit button and title
group_permission (line 226)

This function handles group permissions field in the form (used for moderators when adding a category)

  • return: template of group permissions
mixed group_permission (string $msg, [array $name = array()], [string $value = ''])
  • string $msg: title of the form field
  • array $name: name of the form field
  • string $value: intial value of the form field
hiddenform (line 75)

adds a hidden form

  • return: hidden input form
string hiddenform (string $name, [string $value = ''])
  • string $name: name of the input
  • string $value: value of the input
html_area (line 441)

This function displays html editor when selected in the textarea

  • return: html editor
string html_area ()
inputform (line 92)

handles input form and dispalys it

  • return: template containg input form field
string inputform ([string $title = ''], string $type, string $name, [string $full = ''], [mixed $value = ''], [int $size = '35'])
  • string $title: title of the input
  • string $type: type of the input (file or text)
  • string $name: name of the input
  • string $full: fill with * to make it a required input
  • mixed $value: intial value of the input
  • int $size: size of the input box
radio_selection (line 333)

This function handles multiple radio selection. The defualt value is yes and no.

This function accepts arrays only as options. If $options is left empty a simple Yes and No values will be loaded

  • return: template includ radio selection options
mixed radio_selection (mixed $title, mixed $name, [array $options = array()], [string $value = '0'], [string $full = ''])
  • mixed $title: title of the form field
  • mixed $name: name of the form field
  • array $options: array of options to be poulated
  • string $value: value of the form field
  • string $full: fill with * to make it a requrired field
selectform (line 202)

This function handles multiple selection (accept arrays only)

  • return: template containg select form field
mixed selectform (string $title, string $name, [array $options = array()], [string $value = ''], [string $full = ''])
  • string $title: title of the select form field
  • string $name: name of the select form field
  • array $options: array of options to populate in the selection form field
  • string $value: intial selected value
  • string $full: fill with * to make it a required input
smiles (line 114)

This function displays smiles next the box of posting a message

  • return: smiles box
mixed smiles ()
textarea (line 149)

This function handles textarea field

  • return: template containg textarea form field
mixed textarea ([string $title = 'Text'], [string $name = 'post'], [string $value = ''], [array $info = array()])
  • string $title: textarea title
  • string $name: textarea name
  • string $value: textarea intial value
  • array $info: textarea info array containg cols, row, count, editor type, smiles status (on or off) and required,

Documentation generated on Fri, 16 Apr 2010 12:54:44 +1000 by phpDocumentor 1.4.1