clears the FieldClassDesc cache
void
clearFieldClassDescCache
([boolean $debug = False])
sets the old style $GLOBALS['OCSP']['DBMS_FIELDDESC']
void
compat_setOCSP_DBMS_FIELDDESC
([boolean $debug = False])
OCSP_FORM
&factory_from_cacheArr
(
array $cacheArr, [
string $className =
NULL], [
boolean $debug =
False])
-
array
$cacheArr
-
string
$className: (if set overwrite 'FRM_CLASS' in cacheArr )
-
boolean
$debug
returns the form object with FRM_ID is $aId
OCSP_FORM
&factory_from_id
(
int $aId, [
string $className =
''], [
boolean $debug =
False], [
boolean $forceNew =
False])
-
int
$aId
-
string
$className: (note need to be loaded before if not a standard openCSP form class)
-
boolean
$debug
-
boolean
$forceNew: (do not check self::instances_byId)
returns the form object with FRM_NAME= $aName
OCSP_FORM
&factory_from_name
(
$aName, [
float $className =
NULL], [
boolean $debug =
False], [
boolean $forceNew =
False],
int $aId)
-
int
$aId
-
float
$className
-
boolean
$debug
-
boolean
$forceNew: (do not check self::instances_byId)
-
$aName
OCSP_FORM
&factory_from_request
([
boolean $debug =
False])
gets an html option list with all possible forms for $aTable
string
findForm_getHTMLOptionList
([string $aTable = NULL], [int $selectedForm = 0], [boolean $debug = False])
-
string
$aTable
-
int
$selectedForm
-
boolean
$debug
void
findForm_listForTable
([ $aTable = NULL], [ $debug = False])
string
getCacheFileName
(mixed $frmIdName, [global $debug = False])
-
mixed
$frmIdName
-
global
$debug: array $OCSP_CONF
returns the field class description for a field
void
getFieldClassDesc
([ $aClassName = 'DBMS_FIELD'], [boolean $debug = False], array $aClass)
-
array
$aClass
-
boolean
$debug
-
$aClassName
returns all field class descriptions
array
getFieldClassDescArr
()
OCSP_FORM
&get_existing_instance
(
mixed $frmIdName,
string $className, [
boolean $debug =
False])
-
mixed
$frmIdName
-
string
$className
-
boolean
$debug
loads the field Desc from File cache and sets self::$dbmsFieldClassDesc
boolean
loadFieldClassDesc
([boolean $debug = False])
requires the a field class src file
boolean
requireFieldClass
(string $aClassName, [boolean $debug = False])
-
string
$aClassName
-
boolean
$debug
loads field definition from the db and caches to a file
boolean
writeFieldClassDescToCache
([boolean $debug = False])
OCSP_FORM
__construct
([int $aId = 0], [string $aName = ""], [boolean $debug = False])
-
int
$aId
-
string
$aName
-
boolean
$debug
adds a new block to the form and returns the block
boolean
addNewBlock
(array $blockData, [array $colNames = NULL], [boolean $debug = False])
-
array
$blockData
-
array
$colNames
-
boolean
$debug
adds a new block to the form and returns the block
boolean
addNewBlockFromPost
([string $arrName = 'DBVAL'], [array $colNames = NULL], [boolean $debug = False])
-
string
$arrName
-
array
$colNames
-
boolean
$debug
adds a pass-through field
void
addPassThroughField
(string $colName, mixed $mixValue)
-
string
$colName
-
mixed
$mixValue
adds a table to the form
boolean
addTable
(string $aTable, [int $aBlockId = 0], [boolean $debug = False])
-
string
$aTable
-
int
$aBlockId
-
boolean
$debug
return if the form can be changed on an relaod
boolean
ajax_canChangeForm
()
Redefined in descendants as:
creates an OCSP_AJAXFORM for the form
void
ajax_createObj
()
OCSP_AJAX
&ajax_getObj
([
boolean $force =
True])
void
ajax_setObj
(
&$aAjaxFrmObj,
OCSP_AJAX $aAjaxFrmObj)
changes the class of a field object
boolean
castFieldTo
(string $fldKey, string $className, [boolean $debug = False])
-
string
$fldKey
-
string
$className
-
boolean
$debug
boolean
checkSubmitData
([string $method = ""], [boolean $debug = False], string $contrClass)
-
string
$method: (POST|GET)
-
string
$contrClass: (sub)class Name of OCSP_FRMCONTR
-
boolean
$debug
clears all errors
void
clearErrors
([ $fieldsTo = False], boolean $fieldsToo, boolean $debug)
-
boolean
$fieldsToo
-
boolean
$debug
-
$fieldsTo
link a block from an other form
boolean
copyBlock
(int $blockId, [boolean $debug = False])
-
int
$blockId
-
boolean
$debug
creates the field column in the database
boolean
createDBColumn
( &$field, boolean $debug, mixed $filed)
-
mixed
$filed: (name or object)
-
boolean
$debug
-
&$field
loads the right settings from T_DBMS_FORMRIGHTS
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanCol
(string $str_col, [boolean $debug = False])
-
string
$str_col
-
boolean
$debug
returns if the current user is allowed to open the form readonly
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanDelete
([ $debug = False])
returns if the current user is allowed to open the form readonly
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanEdit
([ $debug = False])
returns if the current user is allowed to open the form readonly
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanExport
([ $debug = False])
returns if the current user is allowed to open the form readonly
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanInsert
([ $debug = False])
returns if the current user can save the form in the current mode
boolean
curUserCanSave
([boolean $debug = False])
Redefined in descendants as:
returns if the current user is allowed to open the form readonly
NOTE rights are only checked if a row is found in T_DBMS_FORMRIGHTS
boolean
curUserCanShow
([ $debug = False])
deletes the form cache files
void
delCacheFiles
()
marks a block as deleted (changes FRM_ID to $this->getId() * (-1))
boolean
deleteBlock
(int $blockId, [boolean $debug = False])
-
int
$blockId
-
boolean
$debug
deletes a field NOTE: does not delete the database column of this field NOTE: does not store the form this has to be done outside
void
deleteField
(string $fldKey, [int $blockId = -1], [boolean $debug = False], return 3)
-
string
$fldKey
-
int
$blockId
-
boolean
$debug
-
return
3: boolean
deletes a form and all dependencies
void
deleteFromDb
([boolean $debug = False])
foctory a new field object
DBMS_FIELD
factory_field
(
string $fldName, [
string $fldClass =
''], [
array $dbDesc =
array()], [
array $fieldValues =
array()], [
boolean $debug =
False])
-
string
$fldName
-
string
$fldClass
-
array
$dbDesc
-
array
$fieldValues
-
boolean
$debug
returns the autoincrement field of $tbl
DBMS_FIELD
&getAutoIncField
(
string $tbl, [
boolan $debug =
False])
-
string
$tbl
-
boolan
$debug
-
int
$blockId
-
boolean
$debug
returns the first block with $blockName as Name
OCSP_FORM_BLOCK
&getBlockByName
(
string $blockName, [
boolean $debug =
False])
-
string
$blockName
-
boolean
$debug
array
&getBlocks
([boolean $debug = False])
overwrite in child classes if get_class does not fit
string
getClassName
()
alias for $this->getControl()
alias for $this->getControlObj()
OCSP_FRMCONTR
&getControllObj
([
string $contrClass =
"OCSP_FRMCONTR"], [
boolean $debug =
False])
-
string
$contrClass
-
boolean
$debug
instantiates a new class if $this->myControl not type of $contrClass
NOTE the class must exists or have it's code in __FILE__
OCSP_FRMCONTR
&getControlObj
([
string $contrClass =
"OCSP_FRMCONTR"], [
boolean $debug =
False])
-
string
$contrClass
-
boolean
$debug
returns the post sub array name of the form fields
string
getDataArrName
()
if $this->myDBObj is NULL a new connection to either the users db or the global database will be establisched
OCSP_DB
&getDBObj
([
boolean $debug =
False])
Redefinition of:
- OCSP_OBJ::getDBObj()
- allowed modes are:
returns an array with all fields having an error
array
getErrorFields
([boolean $debug = False])
returns the form errors
string
getErrors
([boolean $withFields = False], [int $returnType = FRM_DATATYPE_STRING], [boolean $debug = False])
-
boolean
$withFields: if True the field errors are also included
-
int
$returnType
-
boolean
$debug
returns the form export string (php array)
string;
getExportString
()
returns a field object
DBMS_FIELD
&getField
(
string $aFldName, [
string $aTable =
""], [
int $aBlockId =
-1], [
boolean $debug =
False])
-
string
$aFldName
-
string
$aTable: (empty to search in all tables)
-
int
$aBlockId: (-1 to search in all blocks)
-
boolean
$debug
Redefined in descendants as:
returns an array of fields
array
getFields
([string $aTable = ""], [boolean $debug = False], [form $frmMode = -1])
-
string
$aTable: (empty to get all fields)
-
boolean
$debug
-
form
$frmMode: mode (-1 == all fields)
returns form command fields
commands needed in subclasses to validate submitdata this is used in OCSP_FRMCONTR_FORM::getFormCmdFields()
NOTE: only added if form class != OCSP_FORM
array
getFormCmdFields
([boolean $debug = False])
Redefined in descendants as:
returns the html code for list from a query
if $query is empty it is generated with:
$query="SELECT ".$this->getList_SQLFieldLst().$this->getFromStmt();
NOTE: use getList_SQLFieldLst() in the select statement if you have a LEFT JOIN to get the right fields and values
layout class var used:
- FRMLST_TABLEADD (<table $this->FRMLST_TABLEADD>)
- FRMLST_TRADD (<tr $this->FRMLST_TRADD[($rowNr % 2)] >)
- FRMLST_TDADD (<td $this->FRMLST_TDADD >)
string
getHTMLLstFromQuery
( &$nofRows, [string $query = ""], [array $links = NULL], [string $sortLnk = NULL], [int $limit = 0], [int $offset = 0], [boolean $debug = False], int $nofRows)
-
int
$nofRows: return the number of rows processed
-
string
$query: if empty the query is generated
-
array
$links
-
string
$sortLnk
-
int
$limit
-
int
$offset
-
boolean
$debug
-
&$nofRows
returns the html form name
string
getHTMLname
()
returns an array of all primary key's found in the form
the return array has the following structure: array [table][] => &fieldobj
array
getKeyFields
([boolean $debug = False])
returns the language string
string
getLangTxt
(string $txt, [string $lang = "DE"])
returns a layout field (added into the tag)
list keys:
- FRMLST_TABLEADD
- FRMLST_THEADADD
- FRMLST_THADD
- FRMLST_TRADD_odd
- FRMLST_TRADD_even
- FRMLST_TDADD
- FRMLST_ADDBEFORELINKS
- FRMLST_ROWADD
- FRMLST_LIMIT
form keys:
- FRMFRM_FORMADD
- FRMFRM_FIELDSETADD
- FRMFRM_TABLEADD
string
getLayoutField
(string $key)
if $contrClass is not set to "NO" a controll object will be created if none exists ($this->myControl) is empty
if $contrClass is set to "NO" $this->myControl is returned as is without checking that we
OCSP_FRMCONTR_LIST
&getListControll
([
string $contrClass =
"OCSP_FRMCONTR_LIST"], [
boolean $debug =
False])
-
string
$contrClass
-
boolean
$debug
OCSP_FRMVIEW_LIST
&getListView
([
string $viewClass =
"OCSP_FRMVIEW_LIST"], [
boolean $debug =
False])
-
string
$viewClass
-
boolean
$debug
void
&getMyDBControll
([ $debug = False])
array()
getMyDBRow
([boolean $debug = False])
if empty($this->my_jsId) it is set
string
getMyJsId
()
DBMS_TABLEOBJ
&getMyTblObj
([
boolean $force =
False], [
boolean $debug =
False])
-
boolean
$force: (if False only $this->myTblObj is returned else it tries to instantiate a new object)
-
boolean
$debug
Redefined in descendants as:
returns the number of blocks
void
getNofBlocks
([boolean $debug = False])
returns the number of fields in the form
void
getNofFields
([int $mode = -1], [boolean $debug = False])
returns the value of an object variable
mixed
getObjectVar
(string $varName)
returns the pass-through fields array
$this->myPassThroughFields;
getPassThroughFields
()
returns an array with the primary key fields
array
getPKFields
([string $aTable = ""], [boolean $debug = False])
-
string
$aTable
-
boolean
$debug
returns the relaod url
string
getReloadUri
([boolean $debug = False])
get main commands of the form
used keywords:
- js: execute a java script
- default: open url
string
getSubmitAction
(int $mode, [string $type = 'ACTION'])
-
int
$mode
-
string
$type: ([ACTION|NEXT|RELOAD])
returns the include file for the table object class
string
getTblObjInc
([boolean $debug = False])
returns the title of the form
string
getTitle
()
instantiates a new class if $this->myControl not type of $contrClass
NOTE the class must exists or have it's code in __FILE__
OCSP_FRMVIEW
&getViewObj
([
string $viewClass =
"OCSP_FRMVIEW"], [
boolean $debug =
False])
-
string
$viewClass
-
boolean
$debug
returns if the form has errors
void
hasErrors
()
set a field hidden
void
hideField
(string $aFldName, [string $aTable = ""], [string $scope = "all"], [int $aBlockId = -1], [boolean $debug = False])
-
string
$aFldName
-
string
$aTable
-
string
$scope: @see DBMS_FIELD::setHidden()
-
int
$aBlockId
-
boolean
$debug
imports the form from an array NOTE: does not save the form
void
importFromArray
(array $impArray, [boolean $debug = False])
-
array
$impArray
-
boolean
$debug
void
initCheckSubmitData
(array $frmSettings, string $dataArrName, array $frmValues, [boolean $debug = False])
-
array
$frmSettings
-
string
$dataArrName
-
array
$frmValues
-
boolean
$debug
Redefined in descendants as:
link a block from an other form
boolean
linkBlock
(int $blockId, [boolean $debug = False])
-
int
$blockId
-
boolean
$debug
loads the form blocks from the database into $this::myBlocks
void
loadBlocksFromDb
([boolean $debug = False])
void
loadFieldDescFromCache
([boolean $debug = False])
returns a new form form the database
OSCP_FORM_BASIC
&loadFromDb
([int $aId = 0], [string $aName = ""], [float $revision = 0.0], boolean $debug)
-
int
$aId
-
string
$aName
-
boolean
$debug
-
float
$revision
returns a new form from the file cache
OCSP_FORM
loadFromFileCache
([
int $aId =
0], [
string $aName =
""],
float $revision,
boolean $debug)
-
int
$aId
-
string
$aName
-
boolean
$debug
-
float
$revision
settings:
- (OCSP_FRMVIEW_LIST) VIEWOBJ
- (string) VIEWCLASS
- (OCSP_FRMCONTR_LIST) CONTROBJ
- (string) CONTRCLASS
- (string) LISTQUERY
- (array) FILTER
- (int) OFFSET
- (int) LIMIT
- (array) LSTGROUPS
- (string) ORDERBY
- (array) CONTRROWCMD
- (array) CONTRBUTTONS (['C'] => command ['I'] => icon tag)
- (array) FOOTERCMDS (['name'] => html)
int
prepareList
(array $settings, [boolean $debug = False])
-
array
$settings: (array of settings to list view and controll)
-
boolean
$debug
register a table for use with the form
unlicke add table the columns are not loaded
void
registerTable
(string $aTable)
removes a table an all table columns from the form
void
removeTable
(string $aTable, [boolean $debug = False])
-
string
$aTable
-
boolean
$debug
void
setAjaxDisableChangeForm
( $to)
sets a control
NOTE also changes the controll in $this->myView and sets the view in $aControll if $sync is True
void
setControl
(
&$aControl, [
boolean $sync =
True], [
boolean $debug =
False],
OCSP_FRMCONTR $aControl)
alias for setControl
void
setControll
(
&$aControl, [
boolean $sync =
True], [
boolean $debug =
False],
OCSP_FRMCONTR $aControl)
void
setDBObj
(
&$dbObj, [
boolean $debug =
False],
OCSP_DB $dbObj)
-
OCSP_DB
$dbObj
-
boolean
$debug
-
&$dbObj
Redefinition of:
- OCSP_OBJ::setDBObj()
- sets the database object (link)
adds an error to this::errors
void
setError
(mixed $aError, [string $fld = ""], [boolean $debug = False])
-
mixed
$aError: either an array with LABEL and MSG values or only the message if empty only $this->errors['ERROR'] is set to True
-
string
$fld
-
boolean
$debug
void
setFrmMode
(int $mode)
void
setLayoutField
(string $key, string $value)
-
string
$key
-
string
$value
void
setMasterTable
( $aTbl)
void
setMyDBRow
(array $aRow, [boolean $debug = False])
-
array
$aRow
-
boolean
$debug
void
setMyJsId
(string $aId)
links a table object with the form
void
setMyTblObj
( &$tblObj, [boolean $debug = False], DBMS_TABLE_OBJ $tblObj)
-
DBMS_TABLE_OBJ
$tblObj
-
boolean
$debug
-
&$tblObj
Redefined in descendants as:
void
setName
(string $aName)
sets a main cmmonad of the form
used keywords:
- js: execute a java script
- default: open url
string
setSubmitAction
(int $mode, string $uri, [string $type = 'ACTION'])
-
int
$mode
-
string
$uri
-
string
$type: ([ACTION|NEXT|RELOAD])
void
setTblObjClass
(string $className, [ $debug = False])
sets the tableobject class and include from $dataArr and tries to instantiate by calling $this->getMyTblObj
if class is set in $dataArr and it could not be instantiated False is returned else True is returned
boolean
setTblObjFromSubmitData
( &$dataArr, [boolean $debug = False], array $dataArr)
-
array
$dataArr: (normaly $_POST)
-
boolean
$debug
-
&$dataArr
Redefined in descendants as:
void
setTblObjInc
(string $incFile, [ $debug = False])
stores a form object and all depending objects (blocks and fields) to the database
void
storeToDb
([boolean $debug = False])
writes field definition array (T_DBMS_FIELDDESC) to the cache
and populated
- $GLOBALS['DBMS_FIELD_CLASSES']
- $GLOBALS['DBMS_FIELD_DESC']
void
writeFieldDescToCache
([boolen $debug = False])
writes the object to the file cache
void
writeToFileCache
(boolean $debug)
Inherited Methods
Inherited From OCSP_OBJ
OCSP_OBJ::castObj()
OCSP_OBJ::cloneMe()
OCSP_OBJ::currentUser()
OCSP_OBJ::dbConnect()
OCSP_OBJ::defaultDBObj()
OCSP_OBJ::defaultReadDBObj()
OCSP_OBJ::defaultWriteDBObj()
OCSP_OBJ::getConf()
OCSP_OBJ::getDBObj()
OCSP_OBJ::get_myClassConstant()
OCSP_OBJ::get_myObject_vars()
OCSP_OBJ::get_mySourceFile()
OCSP_OBJ::isConnected()
OCSP_OBJ::isMultiByteStr()
OCSP_OBJ::isUTF8()
OCSP_OBJ::setConf()
OCSP_OBJ::setDBObj()
OCSP_OBJ::set_myObject_vars()
OCSP_OBJ::set_myVarsFrom()