YAP  2.5
 All Data Structures Namespaces Files Functions Variables
CYap_clsSearch Class Reference

Public Member Functions

 CYap_clsSearch ($search_field, $language)
 
 LoadCfg ($info)
 
 GetParameter ($paramName, $cfg, $default)
 
GetSearchField ($FieldName)
 
 AddSearchField (&$Field, $FieldName)
 
 RemoveSearchField ($FieldName)
 
 SetLayoutObject (&$layout)
 
 SetLayoutClass ($ClassName)
 
 SetSubmitObject (&$Submit)
 
 SetSubmitClass ($ClassName)
 
 NoSearchBox ()
 
 ReadFormData ()
 
 StoreInformation ($prefix)
 
 LoadInformation ($prefix)
 
 CleanSessionInfo ($prefix)
 
 GetWhereCondition ($db_class)
 
 GetPageSize ()
 
 AddRowPerPage ()
 
 JsSearchFormValidate ()
 
 Draw ()
 

Data Fields

 $tblFields
 
 $tblFieldsOrder
 
 $Lang
 
 $LayoutClass
 
 $LayoutObject
 
 $SubmitClass
 
 $SubmitObject
 

Detailed Description

Definition at line 48 of file CYap_clsSearch.php.

Member Function Documentation

AddRowPerPage ( )

Add the control to ask the number of rows per page to tblfield Function called by CYAP::Cyap

See Also
CYap::CYap
Parameters
$nRowsInteger Number of per page (default value)
Returns
void public

Definition at line 375 of file CYap_clsSearch.php.

AddSearchField ( $Field,
  $FieldName 
)

Add the custom made field object. It allows the user to create programmatically some field to add to the form.

Parameters
CYAP_clsSearchField$Field
string$FieldName
Returns
void public

Definition at line 189 of file CYap_clsSearch.php.

CleanSessionInfo (   $prefix)

Remove all information from session array

Parameters
string$prefixText to prepend to session variable name public
Since
2.1.0

Definition at line 326 of file CYap_clsSearch.php.

CYap_clsSearch (   $search_field,
  $language 
)

Class constructor

Parameters
array$search_fieldConfiguration data gievn to CYap or read from config file
array$languageString translation table to the selected language
Returns
CYap_clsSearch public
Since
2.1.0

Definition at line 95 of file CYap_clsSearch.php.

Draw ( )

Draw the form. It istances the object SearchLayout and order it to build the HTML code required to display the form. It return the HTML statements required to display the form.

Returns
string public
Since
2.1.0

Definition at line 417 of file CYap_clsSearch.php.

GetPageSize ( )

Get the page size. Called by Cyap to retrieve the value of the field PageSize

Returns
string public
Since
2.1.0

Definition at line 360 of file CYap_clsSearch.php.

GetParameter (   $paramName,
  $cfg,
  $default 
)

utility used to extract the request parameter from the configuration array.

Parameters
string$paramName
string[]$cfg
string$default
Returns
string private

Definition at line 160 of file CYap_clsSearch.php.

& GetSearchField (   $FieldName)

Get the requested seacrh field It return null, if the requested field doesn't exists

Parameters
string$FieldName
Returns
CYAP_clsSearchField public

Definition at line 173 of file CYap_clsSearch.php.

GetWhereCondition (   $db_class)

Build the condition to retrieve the rows. It returns the text to append the sql the sql statement used to retrieve the data to display

Parameters
CYap_Db$db_class
Returns
String public
Since
2.1.0

Definition at line 341 of file CYap_clsSearch.php.

JsSearchFormValidate ( )

Javascript code to validate the search box form.

private

Returns
void
See Also
show_form()

Definition at line 390 of file CYap_clsSearch.php.

LoadCfg (   $info)

Check and load the configuration information about the search box coming from the caller

Parameters
string[]$info parameters from the caller public
Since
2.1.0

Definition at line 120 of file CYap_clsSearch.php.

LoadInformation (   $prefix)

Load the fields status into session

Parameters
string$prefixText to prepend to session variable name public
Since
2.1.0

Definition at line 311 of file CYap_clsSearch.php.

NoSearchBox ( )

Should I show the search box? If there isn't any field set to filter the output, the search form is not show Function called by CYap to knows whether display or not the box

Returns
boolean True: do not display the form public
Since
2.1.0

Definition at line 271 of file CYap_clsSearch.php.

ReadFormData ( )

Read data from search form. Each field retrieves its own value Called by CYap::AnalizeRequest (

See Also
CYAP::AnalizeRequest)
Returns
void
Since
2.1.0 public

Definition at line 283 of file CYap_clsSearch.php.

RemoveSearchField (   $FieldName)

Remove the requested field from the field list.

Parameters
string$FieldNamepublic
Returns
void

Definition at line 211 of file CYap_clsSearch.php.

SetLayoutClass (   $ClassName)

It gives the layout class name to instance to draw the form

Parameters
string$ClassName

Definition at line 238 of file CYap_clsSearch.php.

SetLayoutObject ( $layout)

Pass an instanced layout class to the search class. When thr form will be draws, the class will use the provided layout object

Parameters
CYAP_clsSearchLayout$layoutpublic
Returns
void

Definition at line 229 of file CYap_clsSearch.php.

SetSubmitClass (   $ClassName)
Parameters
string$ClassName

Definition at line 257 of file CYap_clsSearch.php.

SetSubmitObject ( $Submit)
Parameters
CYAP_Control$Submitpublic
Returns
void

Definition at line 249 of file CYap_clsSearch.php.

StoreInformation (   $prefix)

Store the fields status into session. Called by CYAP::AnalizeRequest

Parameters
string$prefixText to prepend to session variable name public
Since
2.1.0

Definition at line 296 of file CYap_clsSearch.php.

Field Documentation

$Lang

Definition at line 66 of file CYap_clsSearch.php.

$LayoutClass

Definition at line 68 of file CYap_clsSearch.php.

$LayoutObject

Definition at line 70 of file CYap_clsSearch.php.

$SubmitClass

Definition at line 78 of file CYap_clsSearch.php.

$SubmitObject

Definition at line 85 of file CYap_clsSearch.php.

$tblFields

Array of CYap_clsSearchField objects. It is an associative array indexed by the field name.

Definition at line 54 of file CYap_clsSearch.php.

$tblFieldsOrder

Definition at line 60 of file CYap_clsSearch.php.


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