FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Filter_form Class Reference

This is library for filter form. More...

Public Member Functions

 __construct ($table= '', $base_url= '')
 Constructor, sets table name and compiles values from $_GET.
 autoload ()
 Automatic loads filters from $_GET.
 add ($name, $table=NULL)
 Adds new filter to filter form.
 html ()
 Renders filter form as HTML.
 as_sql ($approved_keys=FALSE)
 Returns SQL query (only part after WHERE) to use in model methods.
 as_array ()
 is_loaded_from_saved_query ()
 Indicates whether the filter form configuration was loaded from database.
 is_loaded_from_default_saved_query ()
 Indicates whether the filter form configuration that was loaded from database is default.
 is_first_load ()
 Indicates whether it is first load.
 get_base_url ()
 Returns base URL of the filter form.
 __toString ()
 Prints filter form as HTML.

Public Attributes

const OPER_CONTAINS = 1
 Definition of constants.
const OPER_CONTAINS_NOT = 2
const OPER_IS = 3
const OPER_IS_NOT = 4
const OPER_EQUAL = 5
const OPER_EQUAL_NOT = 6
const OPER_SMALLER = 7
const OPER_SMALLER_OR_EQUAL = 8
const OPER_GREATER = 9
const OPER_GREATER_OR_EQUAL = 10
const OPER_BIT_IS = 11
const OPER_BIT_IS_NOT = 12
const OPER_NETWORK_IS_IN = 13
const OPER_NETWORK_IS_NOT_IN = 14
const OPER_IS_EMPTY = 15
const OPER_IS_NOT_EMPTY = 16

Protected Attributes

 $template = 'filter_form_template'
 $filters = array()
 $values = array()
 $types = array()
 $operations = array()
 $tables = array()
 $default = array()
 $default_count = 0
 $states = array()
 $default_query_id = NULL
 $base_url = NULL
 $can_add = FALSE
 $loaded_from_saved_query = FALSE
 $loaded_from_default_saved_query = FALSE
 $opers
 $operation_types
 $minlengths
 $returns
 $first_load = FALSE

Detailed Description

This is library for filter form.

Author
Michal Kliment
Version
1.0

Constructor & Destructor Documentation

Filter_form::__construct (   $table = '',
  $base_url = '' 
)

Constructor, sets table name and compiles values from $_GET.

Author
Michal Kliment
Parameters
string$table

Member Function Documentation

Filter_form::__toString ( )

Prints filter form as HTML.

Author
Michal Kliment
Returns
string
Filter_form::add (   $name,
  $table = NULL 
)

Adds new filter to filter form.

Author
Michal Kliment
Parameters
string$name
Returns
Filter object
Filter_form::as_array ( )
Returns
array
Filter_form::as_sql (   $approved_keys = FALSE)

Returns SQL query (only part after WHERE) to use in model methods.

Parameters
mixed$approved_keysArray which defined columns which should be used in query.
Author
Michal Kliment
Returns
string
Filter_form::autoload ( )

Automatic loads filters from $_GET.

Author
Michal Kliment
Returns
int
Filter_form::get_base_url ( )

Returns base URL of the filter form.

Returns
string URL
Filter_form::html ( )

Renders filter form as HTML.

Author
Michal Kliment
Returns
string
Filter_form::is_first_load ( )

Indicates whether it is first load.

Returns
boolean
Filter_form::is_loaded_from_default_saved_query ( )

Indicates whether the filter form configuration that was loaded from database is default.

Returns
boolean
Filter_form::is_loaded_from_saved_query ( )

Indicates whether the filter form configuration was loaded from database.

Returns
boolean

Member Data Documentation

Filter_form::$minlengths
protected
Initial value:
array
(
'combo' => 0,
'select' => 0,
'text' => 1,
'bit' => 0,
'date' => 1,
'select_number' => 0,
'network_address' => 1
)
Filter_form::$returns
protected
Initial value:
array
(
'combo' => 'value',
'select' => 'key',
'text' => 'value',
'bit' => 'key',
'number' => 'value',
'date' => 'value',
'select_number' => 'key',
'network_address' => 'value'
)

The documentation for this class was generated from the following file: