Class cphplib_formular

Description

cphplib formular extention

Located in /cphplib_formular.inc (line 19)

cphplib
   |
   --cphplib_formular
Variable Summary
Method Summary
cphplib_formular cphplib_formular ([mixed $locale = "de_DE"])
void add_form_error (string $message, [string $field = null])
string fm_button (string $name, string $value, string $onclick, [string $customize = ""])
string fm_checkbox (string $name, string $value, string $desc, [string $active_value = ""], [string $options = ""])
string fm_date (array $customize, [string $options = ""])
string fm_end ()
string fm_file (string $name, int $size, [string $onchange = ""], [string $customize = ""])
string fm_hidden (string $field_name, [string $field_value = ""], [bool $mode = false])
string fm_image (string $name, string $image_name, string $alt_name, [string $onclick = ""], [string $customize = ""])
string fm_input (string $name, [string $value = ""], [mixed $size = ""], [int $maxlength = ""], [string $options = ""], [array $customize = null])
string fm_month_days (int $month, int $year)
array fm_month_options ()
string fm_radio (string $name, string $value, string $desc, [string $active_value = ""], [string $alt_values = ""], [string $options = ""])
string fm_select (string $name, array $fmdata, [string $active = null], [string $options = ""], [string $onchange = ""])
string fm_select_period (array &$uvar, [bool $with_userdef = false], [int $first_year = ""])
string fm_start ([string $action = ""], [string $name = "form1"], [string $method = "post"], [bool $mode = true], [string $customize = ""])
string fm_submit (string $name, string $value, [string $customize = ""])
string fm_text (string $name, [string $value = ""], [string $cols = ""], [string $rows = ""], [string $options = ""], int $text_mode, [bool $with_hidden_field = true])
array fm_year_options ([int $first = ""], [int $last = ""])
string get_error_class (string $name, [bool $with_opera_color = false])
bool get_form_errors ()
bool is_form_error ([string $field = null])
void remove_form_error ([string $field = null])
string show_form_errors ()
Variables
char $browser_type (line 48)

Current browser type

string $class_button = "button" (line 76)

CSS class for buttons in formular

string $class_error_body = "err" (line 104)

CSS class for error messages (BODY)

string $class_error_header = "err_header" (line 97)

CSS class for error messages (HEADER)

string $class_non_error = "" (line 90)

CSS class for valid input fileds (non-error displaying)

string $class_shadow = "shadow" (line 83)

CSS class for buttons in formular (for error displaying)

string $default_date_period = "M" (line 113)

Default date view mode: M = month Q = quarter Y = year

string $error_color = "grey" (line 129)

Color for error displaying (only used for opera!)

bool $err_mode = false (line 27)

Show error messages with class

  • var: true: show error fields with class false: show non-error fields with class
int $first_date_year = 1970 (line 120)

First year in date select box

string $formular_name (line 69)

Current formular name

array $form_errors (line 34)

Formular error messages

char $os_type (line 41)

Current client operating system

bool $set_formular_id = false (line 62)

Set id parameter of formular object

bool $set_formular_name = true (line 55)

Set name parameter of formular object

Inherited Variables

Inherited from cphplib

cphplib::$date_format
cphplib::$db
cphplib::$db_type
cphplib::$error_level
cphplib::$error_user_function
cphplib::$image_url
cphplib::$locale
cphplib::$mod_rewrite
cphplib::$m_dbsession_cookies
cphplib::$m_dbsession_detail_table
cphplib::$m_dbsession_handler
cphplib::$m_dbsession_id
cphplib::$m_dbsession_id_name
cphplib::$m_dbsession_table
cphplib::$m_dbsession_timeout
cphplib::$m_sep_i
cphplib::$m_sep_l
cphplib::$m_sep_s
cphplib::$page_entries
cphplib::$sql_like
cphplib::$time_format
cphplib::$version
cphplib::$xhtml
Methods
Constructor cphplib_formular (line 131)
cphplib_formular cphplib_formular ([mixed $locale = "de_DE"])
add_form_error (line 201)

Add formular error message to stack ($this->form_errors)

void add_form_error (string $message, [string $field = null])
  • string $message: error message
  • string $field: name of formular object (use , if you want more than one fields)
fm_button (line 572)

Calculates button string

string fm_button (string $name, string $value, string $onclick, [string $customize = ""])
  • string $name: name of the button
  • string $value: value of the button
  • string $onclick: onclick event (e.g. javascript:...)
  • string $customize: other tag parameter options like CLASS
fm_checkbox (line 953)

checkbox for formular

string fm_checkbox (string $name, string $value, string $desc, [string $active_value = ""], [string $options = ""])
  • string $name
  • string $value
  • string $desc: description behind checkbox
  • string $active_value: active checkbox
  • string $options: other optional tag parameters
fm_date (line 756)

calculates Date select string

  • return: date select string for formular
string fm_date (array $customize, [string $options = ""])
  • array $customize: array with the following keys: name_year = select box name for year name_month = select box name for month name_day = select box name for day name_hour = select box name for hour name_minute = select box name for minute value_year = selected year {default: current year} value_month = selected month {default: current month} value_day = selectd day {default: current day} value_hour = selected hour {default: current hour} value_minute = selected_minute {default: current minute} with_time = it true, with time and title {default: false} with_alltime = it true, with alltime event {default: false} name_alltime = name of alltime checkbox value_alltime = if "Y", it is selected {default: "N"} minute_int = minute interval 1, 5, 10 or 15 {default: 5 } with_run = true, if with run button {default: false} prefix = if defined, it will be print in front of the first select box start_year = set this, if the selection shall not start from year 1970 end_year = set this, if the selection shall not end after year 2037
  • string $options: other tag parameters like readonly or class
fm_end (line 189)

close tag for HTML form

string fm_end ()
fm_file (line 620)

calculates file input field

string fm_file (string $name, int $size, [string $onchange = ""], [string $customize = ""])
  • string $name
  • int $size
  • string $onchange
  • string $customize
fm_hidden (line 928)

Hidden field

string fm_hidden (string $field_name, [string $field_value = ""], [bool $mode = false])
  • string $field_name
  • string $field_value
  • bool $mode: false: if empty, don't print it
fm_image (line 598)

calculates image button

  • return: button string for formular
string fm_image (string $name, string $image_name, string $alt_name, [string $onclick = ""], [string $customize = ""])
  • string $name: name of the button
  • string $image_name: image name
  • string $alt_name: alt text for image
  • string $onclick: onclick event (e.g. javascript:...)
  • string $customize: other tag parameter options like CLASS
fm_input (line 1062)

calculats input tag for formular

  • return: string with input tag for formular
string fm_input (string $name, [string $value = ""], [mixed $size = ""], [int $maxlength = ""], [string $options = ""], [array $customize = null])
  • string $name
  • string $value
  • mixed $size: smallest,small,medium (2xmedium=normal), default or big
  • int $maxlength: maximum input length
  • string $options: other optional tag parameters
  • array $customize
fm_month_days (line 1367)

Get day of month

string fm_month_days (int $month, int $year)
  • int $month
  • int $year
fm_month_options (line 1306)

options with months

array fm_month_options ()
fm_quarter_options (line 1284)

options with quarters

array fm_quarter_options ()
fm_radio (line 997)

checkbox for formular

  • return: string with checkbox for formular
string fm_radio (string $name, string $value, string $desc, [string $active_value = ""], [string $alt_values = ""], [string $options = ""])
  • string $name
  • string $value
  • string $desc: description behind radio button
  • string $active_value: active radio
  • string $alt_values: alternate active values for other radio buttons. If no other radio button is correct, that one with optional alt_values will be checked
  • string $options: other optional tag parameters
fm_select (line 466)

calculates select start for formular

string fm_select (string $name, array $fmdata, [string $active = null], [string $options = ""], [string $onchange = ""])
  • string $name: name of select tag
  • array $fmdata: array with options value: desc: default: if true, this entry will be selected {default: false} convert: if true, convert to html {default: true} customize: other values like styles or ids
  • string $active: if actuve is value a valid, this entry is selected {default: first in data array}
  • string $options: other tag parameters
  • string $onchange: onchange event
fm_select_period (line 1236)

draw period form dialog

  • return: period form dialog
string fm_select_period (array &$uvar, [bool $with_userdef = false], [int $first_year = ""])
  • array $uvar
  • bool $with_userdef: true: with user defined period false: without user defined period {default}
  • int $first_year
fm_start (line 151)

begining for formular (this function can only handle the session_id, if dbsession_start has been called immediately after creating the class object)

  • return: formular head
string fm_start ([string $action = ""], [string $name = "form1"], [string $method = "post"], [bool $mode = true], [string $customize = ""])
  • string $action: action {default: PHP_SELF}
  • string $name: name for formular {default: void}
  • string $method: post or get {default: post}
  • bool $mode: false: no session_id, true: with session_id if required {default: true}
  • string $customize: for addon parameters like enctype
fm_submit (line 551)

calculates submit button string

  • return: submit button string for formular
string fm_submit (string $name, string $value, [string $customize = ""])
  • string $name: name of the button
  • string $value: value of the button
  • string $customize: other formular parameters, e.g. CLASS
fm_text (line 649)

calculates text field for formular

  • return: text field string for formular
string fm_text (string $name, [string $value = ""], [string $cols = ""], [string $rows = ""], [string $options = ""], int $text_mode, [bool $with_hidden_field = true])
  • string $name: name of text tag
  • string $value: content of text tag
  • string $cols: number of colomns
  • string $rows: number of rows
  • string $options: other formular parameters like CLASS
  • int $text_mode: 0: no edit options 1: no edit options, with mce 2: edit options, text active 3: edit options, mce small active 4: edit options, mce large active
  • bool $with_hidden_field
fm_year_options (line 1330)

options with years

array fm_year_options ([int $first = ""], [int $last = ""])
  • int $first: first available year
  • int $last
get_error_class (line 387)

Get error CSS class

If err_mode = false and "global_errors" are defined, no shadow class is used! (inactive)

string get_error_class (string $name, [bool $with_opera_color = false])
  • string $name
  • bool $with_opera_color
get_form_errors (line 303)

Get formular error messages

  • return: true, if error exists
bool get_form_errors ()
is_form_error (line 261)

Exists a formular error

  • return: true, if error exists
bool is_form_error ([string $field = null])
  • string $field: only check this field (use , if you want more than one fields) if empty all fields
remove_form_error (line 220)

Remove formular error message from error stack ($this->form_errors)

void remove_form_error ([string $field = null])
  • string $field: name of formular object (use , if you want more than one fields) if no field name is defined, all error messages will be deleted
show_form_errors (line 331)

show all formular errors

  • return: html list of errors
string show_form_errors ()

Inherited Methods

Inherited From cphplib

cphplib::cphplib()
cphplib::age_from_birthday()
cphplib::array_rsort()
cphplib::array_sort()
cphplib::array_unique()
cphplib::browser_type()
cphplib::checkBankId()
cphplib::checkBirthday()
cphplib::checkColor()
cphplib::checkDomainName()
cphplib::checkEAN()
cphplib::checkEmail()
cphplib::checkHtmlTag()
cphplib::checkIP()
cphplib::checkMAC()
cphplib::checkNumber()
cphplib::checkNumWildcard()
cphplib::checkPassword()
cphplib::checkPhone()
cphplib::checkString()
cphplib::checkUserName()
cphplib::checkZip()
cphplib::check_php_version()
cphplib::convDate()
cphplib::convDateTime()
cphplib::convFirstLetter()
cphplib::convHtml()
cphplib::convnumSep()
cphplib::convTime()
cphplib::convToNum()
cphplib::convToTimestamp()
cphplib::convUmlaute()
cphplib::convUrl()
cphplib::countdown()
cphplib::cross_sum()
cphplib::currentDate()
cphplib::currentTime()
cphplib::date2days()
cphplib::dbsessionsub_start()
cphplib::dbsession_delete()
cphplib::dbsession_end()
cphplib::dbsession_read()
cphplib::dbsession_start()
cphplib::dbsession_write()
cphplib::db_close()
cphplib::db_connect()
cphplib::db_free_id()
cphplib::db_insert_id()
cphplib::db_next_id()
cphplib::db_seq_id()
cphplib::db_version()
cphplib::end_tag()
cphplib::fileExtension()
cphplib::file_exists()
cphplib::generate_password()
cphplib::get_base_url()
cphplib::get_client_ip()
cphplib::get_filename_from_text()
cphplib::get_fontsizes()
cphplib::get_id_string()
cphplib::get_image_size()
cphplib::get_mod_rewrite_url()
cphplib::get_user_var()
cphplib::hitcounter()
cphplib::html_head()
cphplib::html_header()
cphplib::in_multi_array()
cphplib::js_conv()
cphplib::killSpace()
cphplib::metatag_write()
cphplib::net_access()
cphplib::os_type()
cphplib::pager()
cphplib::rand_value()
cphplib::remove_magic_quotes()
cphplib::rgb2dec()
cphplib::set_format()
cphplib::set_locale()
cphplib::set_strings()
cphplib::show_dbdate()
cphplib::show_dbdatetime()
cphplib::show_error()
cphplib::sql_value()
cphplib::table_header()
cphplib::text_shorten()
cphplib::url()
cphplib::url_on_scripthost()
cphplib::validate_timestamp()

Documentation generated on Fri, 11 Nov 2005 10:40:00 +0100 by phpDocumentor 1.3.0RC3