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

Public Member Functions

 CYap ($search_field=array(), $show_field=array(), $db_info=array(), $show_info=array(), $modify_info=array())
 
 _LoadCfg ($FileName)
 
 check_showfield ($info)
 
 check_db ($info)
 
 LoadSearchCfg ($info)
 
 check_show_info ($info)
 
 check_modify_info ($info)
 
GetSearchObject ()
 
 SetSearchObject (&$newObject)
 
 _ManageFormats ()
 
 ForgetAll ()
 
 _InitializeSessionVar ()
 
 _DoEvent ($ev)
 
 _SetDefaultHandler ()
 
 RegisterEvent ($EventName, $Handler)
 
 _OnOrderUp ()
 
 _OnOrderDown ()
 
 _OnDetailClick ()
 
 _OnModifyClick ()
 
 _OnDoModify ()
 
 _OnAbortModify ()
 
 _OnRemoveClick ()
 
 _OnDoRemove ()
 
 _OnAbortRemove ()
 
 _OnCmdExecuted ()
 
 _OnToPage ()
 
 _OnExit ()
 
 _OnTableView ()
 
 _OnNewRow ()
 
 _OnDoSaveRow ()
 
 _OnAbortSaveRow ()
 
 _OnSearch ()
 
 _OnFirstTime ()
 
 _OnDrawCurrent ()
 
 showpage ($ForcedEvent='')
 
 _SaveToSession ()
 
 _RunDisplayFunc ()
 
 _DisplayData ()
 
 analize_request ()
 
 load_previous_data ()
 
 _JsSearchBoxCheck ()
 
 show_form ()
 
 _ShowSearchBox ($txt)
 
 check_orderfield ()
 
 perform_query ()
 
 show_table_rows ()
 
 _ShowDetailMode ($Fields, $result)
 
 _ShowTableMode ($Fields, $result)
 
 show_header (&$clsTable)
 
 show_single_row ($RowData, $RowNumber, &$clsTable)
 
 _DetHrefLink ($RowNumber, $RowData)
 
 _DeleteHrefLink ($RowData)
 
 _ModifyHrefLink ($RowData)
 
 _AddHrefLink (&$clsTable)
 
 show_detail_row ($DataRow, $Show=true, $Fields, &$clsTable)
 
 show_selectors ()
 
 select_page ()
 
 InDetailMode ()
 
 _JsOut ()
 
 _ToolTipJs ()
 
 _ToolTipsDiv ()
 
 _ModifyInputForm ()
 
 _ModifyExecute ($Add)
 
 _ModifySuccessed ()
 
 _BuildControlTable ($tblFields)
 
 _ShowModifyBox ($Row, $Fields, $Add, $KeyValue, $Controls)
 
 _FillFromRequest ($row, $Fields)
 
 _RetrieveRow ($KeyValue, $Fields)
 
 _RetrieveFieldType ($res=NULL, $ModifyMode=true)
 
 _CompileFieldType ($meta, $flags, $CfgParam)
 
 _Apice ($fieldType)
 
 _DeleteRequestConfirm ()
 
 _DeleteExecute ()
 
 _CheckAuthorization ($Key, $Action)
 
 _DontAllow ()
 
 _CheckFieldCallBack ($row, $Key)
 
 _OpenDb ()
 

Data Fields

 $show_field
 
 $db_info
 
 $show_info
 
 $modify_info
 
 $Prefix
 
 $DbOpened
 
 $WrongFields
 
 $Lang
 
 $ShowFirstPage
 
 $PagSize
 
 $PagerExit
 
 $PageRequest
 
 $db
 
 $TotRow
 
 $Mode
 
 $OutFormats
 
 $Pre_1_0_Style
 
 $EventTable
 
 $FieldType
 
 $SearchCfg
 
 $OrderField
 
 $OrderDirection
 
 $NoSearchBox
 
 $NeedOpenDb
 
 $DetailMode
 
 $SearchObj
 
 $Db_Class
 

Detailed Description

Definition at line 41 of file CYap.php.

Member Function Documentation

_AddHrefLink ( $clsTable)

If allowed, add the link to the add row function private

Definition at line 1507 of file CYap.php.

_Apice (   $fieldType)

String quote, for each type of Mysql field the function return the single quote if required

Parameters
stringMysql field type private

Definition at line 2199 of file CYap.php.

_BuildControlTable (   $tblFields)

Build the control object for each field and return it.

Parameters
arrayarray of all table columns
Returns
array array of all created control to manage each field private

Definition at line 1938 of file CYap.php.

_CheckAuthorization (   $Key,
  $Action 
)

Ask to the callback function (if I have one ) if the current user may perform the requested function The allowed action are: RemoveRow, AddRow, ModifyRow If I haven't any callback function return true

Parameters
stringrow key to apply the action
stringaction The allowed action are: RemoveRow, AddRow, ModifyRow
Returns
bool true-> perform the job, false user not allowed private

Definition at line 2328 of file CYap.php.

_CheckFieldCallBack (   $row,
  $Key 
)

Check if the field name in $Key contains a valid value. If not return false The function perform the check by the provided callback function. If any return true.

Parameters
arrayall the row value returned from the form
stringfield name
Returns
bool private

Definition at line 2388 of file CYap.php.

_CompileFieldType (   $meta,
  $flags,
  $CfgParam 
)

Build the array that holds all information about the field

Parameters
arrayinformation from mysql
stringfield's flags
arrayinformation about the field from the configuration paramaters
Returns
array private

Definition at line 2135 of file CYap.php.

_DeleteExecute ( )

Ok, I get the confirm to remove the row, I do it! private

Returns
bool successed or not

Definition at line 2285 of file CYap.php.

_DeleteHrefLink (   $RowData)

If allowed, add the link to the delete function for the currente row

Parameters
arrayrow values
Returns
string private

Definition at line 1469 of file CYap.php.

_DeleteRequestConfirm ( )

Request the confirm to remove the row

private

Definition at line 2234 of file CYap.php.

_DetHrefLink (   $RowNumber,
  $RowData 
)

function to show the link to the detail mode for the current record

Parameters
integer$RowNumbercurrent row number. First row: 1
arrayrow values
Returns
string private

Definition at line 1439 of file CYap.php.

_DisplayData ( )

Perform the actions required to display the rows (table/detail mode) private

Definition at line 1020 of file CYap.php.

_DoEvent (   $ev)

Execute the function related to the given event

Parameters
stringevent private

Definition at line 628 of file CYap.php.

_DontAllow ( )

The user is not allowed to perform the operation, show the message private

Returns
void

Definition at line 2371 of file CYap.php.

_FillFromRequest (   $row,
  $Fields 
)

For each field, check from the request, if I have some value from the previous input field (an insert/modify not approved)

Parameters
arrayarray holding each field and its values from the database
Returns
array private

Definition at line 2018 of file CYap.php.

_InitializeSessionVar ( )

Initialize the session vars

private

Definition at line 598 of file CYap.php.

_JsOut ( )

Send the Javascript code required by Yap to output the tooltip private

Definition at line 1665 of file CYap.php.

_JsSearchBoxCheck ( )

Js code to validate the search box form. The base class implementation do nothing (return always true), but it allows extend and customize the checks on value entered into the search box. private

Returns
void
See Also
show_form()

Definition at line 1127 of file CYap.php.

_LoadCfg (   $FileName)

Load the configuration file

Parameters
stringprivate

Definition at line 243 of file CYap.php.

_ManageFormats ( )

Parse the output formats from info['outformat'], and converts that information into executable commands. Set the default formats Default formats: NONE: no format applied NUMERIC_IT: numeric number, Italian format x.xxx.xxx NUMERIC_EN: numeric number, English format x,xxx,xxx.xx MONEY_IT : monetary Italian format x.xxx.xxx,xx MONEY_EN : monetary English format x,xxx,xxx.xx DATE_IN : convert timestamps into Italian dormat date day/month/year DATE_US : convert timestamps into US format date month/day/year Initialise the $this->OutFormat array; private

Definition at line 539 of file CYap.php.

_ModifyExecute (   $Add)

Add/Update the record

Parameters
boolTrue=add mode (I have not the key value, field id) private

Definition at line 1852 of file CYap.php.

_ModifyHrefLink (   $RowData)

If allowed, add the link to the modify function for the currente row

Parameters
arrayrow values
Returns
string private

Definition at line 1489 of file CYap.php.

_ModifyInputForm ( )

Show the form for modify/insert a new row

Parameters
boolTrue=add mode (I have not the key value, field id)
stringrecord id (used only in Modify Mode) private

Definition at line 1795 of file CYap.php.

_ModifySuccessed ( )

Operation (add/modify) executed with success, draw the messge private

Definition at line 1920 of file CYap.php.

_OnAbortModify ( )

Abort event on modify row function

private

Definition at line 744 of file CYap.php.

_OnAbortRemove ( )

Ops, I don't want remove this row private

Definition at line 768 of file CYap.php.

_OnAbortSaveRow ( )

Click on 'abort button' on 'new row' form private

Definition at line 833 of file CYap.php.

_OnCmdExecuted ( )

Click on 'OK' button on the form 'Command executed' private

Definition at line 776 of file CYap.php.

_OnDetailClick ( )

Click on button show row detail private

Definition at line 710 of file CYap.php.

_OnDoModify ( )

ok, the modify form is filled, store the new values

private

Definition at line 730 of file CYap.php.

_OnDoRemove ( )

Yes delete this row private

Definition at line 760 of file CYap.php.

_OnDoSaveRow ( )

Ok, the 'new row' form is filled, store the data private

Definition at line 821 of file CYap.php.

_OnDrawCurrent ( )

Draw the data from the current status private

Definition at line 871 of file CYap.php.

_OnExit ( )

Definition at line 793 of file CYap.php.

_OnFirstTime ( )

First time the module is called. Initialize the internal status and don't expect any information from session private

Definition at line 852 of file CYap.php.

_OnModifyClick ( )

Click on 'modify row' link private

Definition at line 720 of file CYap.php.

_OnNewRow ( )

Click on 'add row' button

private

Definition at line 812 of file CYap.php.

_OnOrderDown ( )

Click on table header to change the order type private

Definition at line 702 of file CYap.php.

_OnOrderUp ( )

Click on table header to change the order type private

Definition at line 694 of file CYap.php.

_OnRemoveClick ( )

Click on 'delete row' link private

Definition at line 752 of file CYap.php.

_OnSearch ( )

Filled the search form. Parse the new search parameters, and display the new result. private

Definition at line 842 of file CYap.php.

_OnTableView ( )

Click on button show rows table private

Definition at line 801 of file CYap.php.

_OnToPage ( )

Skip to a new page. This event expects the pag parameter to know which is the new page to show up private

Definition at line 785 of file CYap.php.

_OpenDb ( )

Open the connection to the database

Definition at line 2406 of file CYap.php.

_RetrieveFieldType (   $res = NULL,
  $ModifyMode = true 
)

Retrieve the field definition from the database

Parameters
resourcereturn by mysql_query from whom get the field type
booleantrue if I return the list of the field to be changed (use modify_info) false if I return all field from the table (view mode)
Returns
array private

Definition at line 2069 of file CYap.php.

_RetrieveRow (   $KeyValue,
  $Fields 
)

Retrieve the row contents from the database

Parameters
stringkey the affected row
arrayfields type
Returns
array private

Definition at line 2041 of file CYap.php.

_RunDisplayFunc ( )

Run the display function based on mode switch private

Definition at line 976 of file CYap.php.

_SaveToSession ( )

Store some information into session private

Definition at line 967 of file CYap.php.

_SetDefaultHandler ( )

Fill the event table with the default handler private

See Also
CYap()

Definition at line 653 of file CYap.php.

_ShowDetailMode (   $Fields,
  $result 
)

Definition at line 1274 of file CYap.php.

_ShowModifyBox (   $Row,
  $Fields,
  $Add,
  $KeyValue,
  $Controls 
)

Build the form for the input/add row

Parameters
array$Rowarray of the value for each field
array$Fieldsarray holding the fields informations from the database
bool$AddI'm adding or modifing the row?
string$KeyValueValue of the index key for the row to modify
array$Controlsarray carrying the objects required to show the form private

Definition at line 2005 of file CYap.php.

_ShowSearchBox (   $txt)

Call the CYapBox to show th search box. This function is splitted from the previous to allow to override it if you need to cheng the search box layout.

Parameters
stringHtml code to show the search form private

Definition at line 1156 of file CYap.php.

_ShowTableMode (   $Fields,
  $result 
)

Definition at line 1293 of file CYap.php.

_ToolTipJs ( )

Javascript code required to draw the tooltips private

Definition at line 1681 of file CYap.php.

_ToolTipsDiv ( )

Html code require do draw the tool tips This function is expected to run inside the body of the page private

See Also
_ToolTipJs()
_JsOut()

Definition at line 1774 of file CYap.php.

analize_request ( )

The function parse the text from the search box and build the information required to perform the query private

Definition at line 1053 of file CYap.php.

check_db (   $info)

Check and load the configuration information about the database connection coming from the caller

Parameters
arrayparameters from the caller private

Definition at line 305 of file CYap.php.

check_modify_info (   $info)

Check and load the configuration information about the add/modify/delete row from the caller

Parameters
arrayparameters from the caller private

Definition at line 452 of file CYap.php.

check_orderfield ( )

Look into the $_REQUEST for the sort parameter.

CGI parameter of -> orderField ot -> Order Type = order direction Session parameter OrderField set OrderDirection set private

Definition at line 1174 of file CYap.php.

check_show_info (   $info)

Check and load the configuration information coming from the caller

Parameters
arrayparameters from the caller private

Definition at line 359 of file CYap.php.

check_showfield (   $info)

Check and load the configuration information about the fields to show coming from the caller

Parameters
arrayparameters from the caller private

Definition at line 292 of file CYap.php.

CYap (   $search_field = array(),
  $show_field = array(),
  $db_info = array(),
  $show_info = array(),
  $modify_info = array() 
)

Table viev class reference Request (post/get) parameters of: OrderField set when the user click on the header filedname. It change the field to use to order the table. Values: field name. None = use the current order field (session var OrderField) ot: OrderDirection, chenge the order direction on the field specified by of DetailMode: (default false), if true yap shows the full detail row, if false the class shows the table. If it doesn't exist, the class looks for it into the session vars and into the configuration params. Pag: page number, the class shows the request page. If it doesn't exist, the class looks for it into session var (show the same page as the referrer). If the class doesn't find it, the first page will be shown . ev: event occurred to the form. id: row identification value used by update/delete function. If it doesn't set, the class swicth into insert mode (if cmd=m).

public

Parameters
array
array
array
array
See Also
load_previous_data

Definition at line 195 of file CYap.php.

ForgetAll ( )

Clean all session parameters. It is usefull to avoid conflict with another execution of this class within the same session

public

Definition at line 581 of file CYap.php.

& GetSearchObject ( )

Return the reference to the object used to manage the firlter form

Returns
CYap_clsSearch public
Since
2.1.0

Definition at line 507 of file CYap.php.

InDetailMode ( )

InDetailMode - Am I in 'deatil mode'?

Returns
boolean private

Definition at line 1652 of file CYap.php.

load_previous_data ( )

Class behaviour setup from session or post parameter. The post parameter has the precedence over the session parameter

private

Definition at line 1083 of file CYap.php.

LoadSearchCfg (   $info)

Add to the configuration loaded from config file the parameters passed to constructor function.

Parameters
array$info
Returns
void private

Definition at line 346 of file CYap.php.

perform_query ( )

Perform the query on database to retrieve the rows to show

Returns
boolean true on success, false on error private

Definition at line 1197 of file CYap.php.

RegisterEvent (   $EventName,
  $Handler 
)

Register a new or modify an event, and its handler

Parameters
stringevent name
stringhandler public
Returns
boolean

Definition at line 684 of file CYap.php.

select_page ( )

select_page from a list of 5 pages before and 5 pages after

private

Definition at line 1622 of file CYap.php.

SetSearchObject ( $newObject)

Replace the current search object with the new one. Function usefull to provide a custom made search filter.

Parameters
CYap_clsSearch$newObjectpublic
Since
2.1.0

Definition at line 520 of file CYap.php.

show_detail_row (   $DataRow,
  $Show = true,
  $Fields,
$clsTable 
)

Show one data row. Detail view

Parameters
array$DataRowarray associativo con il record restituito dalla query
boolean$Showshould I show the table or return it as string? (true->show, false->return as string)
objectCYap_DetailView $clsTable reference to the class used to print the table private

Definition at line 1528 of file CYap.php.

show_form ( )

Visualizzazione della maschera per l'input dei campi di ricerca Show the search box. The function make the HTMl code for the form, The box is shown through the module CYapBox (called by the function _ShowSearchBox) private

Definition at line 1139 of file CYap.php.

show_header ( $clsTable)

Show the column header Each header is a link to this page with parameters to change the sort direction and field

Parameters
objectCYap_table $clsTable reference to the class used to print the table private

Definition at line 1330 of file CYap.php.

show_selectors ( )

Page picker (begin,previuos,next,end) private

Definition at line 1569 of file CYap.php.

show_single_row (   $RowData,
  $RowNumber,
$clsTable 
)

Show one table row

Parameters
arrayarray associativo con il record restituito dalla query
integernumber of row's table. First row: 1
objectCYap_table $clsTable reference to the class used to print the table private

Definition at line 1372 of file CYap.php.

show_table_rows ( )

Show rows: main function to open the table, and retrieve data from database

private

Definition at line 1230 of file CYap.php.

showpage (   $ForcedEvent = '')

function to show the page

Returns
void
Parameters
stringforced event public

Definition at line 886 of file CYap.php.

Field Documentation

$db

Definition at line 106 of file CYap.php.

object CYapDb $Db_Class

Istance of the database class abstraction

Definition at line 169 of file CYap.php.

$db_info

Definition at line 45 of file CYap.php.

$DbOpened

Definition at line 63 of file CYap.php.

$DetailMode

Definition at line 162 of file CYap.php.

$EventTable

Definition at line 147 of file CYap.php.

$FieldType

Definition at line 153 of file CYap.php.

$Lang

Definition at line 73 of file CYap.php.

$Mode

Definition at line 121 of file CYap.php.

$modify_info

Definition at line 50 of file CYap.php.

$NeedOpenDb

Definition at line 161 of file CYap.php.

$NoSearchBox

Definition at line 160 of file CYap.php.

$OrderDirection

Definition at line 159 of file CYap.php.

$OrderField

Definition at line 157 of file CYap.php.

$OutFormats

Definition at line 128 of file CYap.php.

$PageRequest

Definition at line 101 of file CYap.php.

$PagerExit

Definition at line 96 of file CYap.php.

$PagSize

Definition at line 91 of file CYap.php.

$Pre_1_0_Style

Definition at line 140 of file CYap.php.

$Prefix

Definition at line 57 of file CYap.php.

$SearchCfg

Definition at line 155 of file CYap.php.

$SearchObj

Definition at line 164 of file CYap.php.

$show_field

Definition at line 44 of file CYap.php.

$show_info

Definition at line 46 of file CYap.php.

$ShowFirstPage

Definition at line 80 of file CYap.php.

$TotRow

Definition at line 111 of file CYap.php.

$WrongFields

Definition at line 68 of file CYap.php.


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