Source Location: /php/validation_functions.php
validation_functions.php
holds validation functions
PHP versions 4 and 5
LICENSE: ARK - The Archaeological Recording Kit. An open-source framework for displaying and working with archaeological data Copyright (C) 2008 L - P : Partnership Ltd. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
string chkAbk(
string $var, array $val_vars, array $field_vars)
[line 865]
checks to see if a submitted value is valid in the abk
[ Top ]
string chkChDown(
string $var, array $val_vars, array $field_vars)
[line 579]
checks for a downward chain attached to a fragment
[ Top ]
string chkDate(
string $var, array $val_vars, array $field_vars)
[line 511]
checks a string to see if it complies with certain date criteria
[ Top ]
string chkDateSet(
string $var, array $val_vars, array $field_vars)
[line 554]
checks a date string to see if is set
[ Top ]
string chkDupDouble(
string $col1, string $val1, string $col2, string $val2, string $tbl)
[line 659]
checks for the presence of a pair of values
0.4
FIX ME: This is a NON standard chk function call
[ Top ]
string chkDuplicate(
array $var, $val_vars, $field_vars, array $field_settings)
[line 465]
checks for the presence of an itemvalue in the db
[ Top ]
TRUE chkDupSimple(
string $item, string $tbl, string $col)
[line 698]
checks for the presence of an existing value of any type
0.4
FIX ME: This is a NON standard chk function call
[ Top ]
array chkDupStr(
string $dup, string $col, string $tbl, string $sql, string $element, string $params)
[line 747]
checks for the presence of duplicate strings
0.3
FIX ME: This is a NON standard chk function call FIX ME: This function is surely OBSOLTETE?
NOTE 1: LANGUAGES the alias returned will be the $col specified to this function. IF you want to display more than one language take the id and use the get alias function in a foreach loop after running this function.
NOTE 2: This function has been written with the aim of reducing duplicate addtions to luts. It may be possible to hack it to serve other purposes.
NOTE 3: The params option should contain an array of the types of check to be carried out
[ Top ]
string chkFalse(
string $var, array $val_vars, array $field_vars)
[line 628]
checks a var to see if it is FALSE
[ Top ]
string chkItemList(
string $var, array $val_vars, array $field_vars)
[line 941]
takes an list of items (usually from an XMI), explodes the list and checks if all of the itemvalues are valid
[ Top ]
string chkItemListAllowBlank(
string $var, array $val_vars, array $field_vars)
[line 1025]
takes an list of items (usually from an XMI), explodes the list and checks if all of the itemvalues are valid but this will allow blanks
[ Top ]
string chkNumeric(
array $var, $val_vars, $field_vars, array $field_settings)
[line 437]
checks to see if a var is numeric
[ Top ]
string chkSet(
arrat $var, array $val_vars, $field_vars)
[line 413]
checks to if a value is 'set' ie not null or false or empty
[ Top ]
string chkSkipBlank(
string $var, array $val_vars, array $field_vars)
[line 912]
checks to see if a submitted value is blank and skip this field if it is
[ Top ]
TRUE chkValid(
string $item_cd, string $ste_cd, string $item_id, string $tbl, string $clm)
[line 822]
checks for the presence and uniqueness of an item_value in the db
0.4
NOTE 1: If you want to check an item_val you must set it. If you want to check ste_cd/no DON'T set item_val This is an either or option
NOTE 2: It is possible to hack this function to check for just about anything do it by spoofing the $item_cd, $tbl and $clm values (see also note 1)
[ Top ]
string reqClassType(
$vars, array $field_settings, array $var)
[line 127]
requests a classtype number based on the field settings
[ Top ]
string reqDate(
array $vars, array $field_settings)
[line 274]
requests dates from the an array (typically the qstr)
0.5
The date can be split and formatted using other date handlers
[ Top ]
string reqDateRange(
array $vars, array $field_settings)
[line 341]
requests the parts of a date range and applies an AD/BC modifier
0.6
at present (0.6) this function isnt handling real dates, just years it would probably be possible to improve this but it would mean editing the frmElem function responsible for submitting spans
[ Top ]
string reqField(
$vars, array $field_settings, array $var)
[line 160]
set a var from the vars in the field settings array
[ Top ]
int reqFragId(
array $vars, array $field_settings)
[line 374]
requests a fragment id which is needed in edit and delete routines
[ Top ]
string reqItemList(
$vars, array $field_settings, array $var)
[line 106]
this is for requesting a itemlist
0.6
Returns the var if it is present otherwise returns false Essentially a wrapper function for reqMulti
[ Top ]
string reqItemVal(
$vars, [array $field_settings = FALSE], array $var)
[line 213]
requests a particular form of an itemvalue
0.5
Note: essentially a wrapper for the reqMulti() function to better handle itemkeys
[ Top ]
string reqManual(
$vars, [array $field_settings = FALSE], array $var)
[line 185]
sets a var to a manual setting from the field array
[ Top ]
string reqMulti(
$vars, [array $field_settings = FALSE], array $var)
[line 62]
cleanly requests a var returning FALSE
0.5
Returns the var if it is present otherwise returns false Essentially a wrapper function for reqQst the non std function
[ Top ]