$v ) {
if ( strpos( $k, 'ire__' ) === 0 ) {
list( $ire, $fieldname, $num ) = explode( '__', $k );
if ( !@$queries[$num] ) {
$queries[$num] = array();
}
if ( $GLOBALS['schema'][$fieldname]['type'] == 'checkbox' ) {
// we are actually looking at a hidden field; replace the value with that of the checkbox, if one was submitted
$v = @$_REQUEST["checkbox__{$fieldname}__$num"] ? 1 : 0;
}
$queries[$num][] = "`$fieldname`='" . mysql_escape($v) . "'";
}
}
foreach ( $queries as $num => $q ) {
$query = "UPDATE {$TABLE_PREFIX}{$tableName} SET ";
for ( $i=0; $i';
}
if ( $type == 'list' && $GLOBALS['schema'][$fieldname]['listType'] == 'pulldown' ) {
// display a dropdown
$displayValue = '';
$displayValue = _ire_showPulldown( $GLOBALS['schema'][$fieldname], $fieldname, $record );
}
// return the display value, which may have been overridden
return $displayValue;
}
function _ire_showPulldown($fieldSchema, $fieldname, $record) {
// set field attributes
$listOptions = getListOptionsFromSchema($fieldSchema, $record);
$valignTop = ($fieldSchema['listType'] != 'pulldown') ? 'style="vertical-align: top;"' : '';
// get field value
if ($record) { $fieldValue = @$record[ $fieldname ]; }
else { $fieldValue = ''; }
$fieldValues = preg_split("/\t/", $fieldValue, -1, PREG_SPLIT_NO_EMPTY); // for multi value fields
$encodedValue = htmlspecialchars($fieldValue);
// get list of values in database that aren't in list options (happens when list values are removed or field
// ... was a textfield than switched to a pulldown that doesn't offer all the previously entered values as options
$fieldValuesNotInList = array();
$listOptionValues = array();
foreach ($listOptions as $optionArray) {
list($value,$label) = $optionArray;
$listOptionValues[] = $value;
}
$fieldValuesNotInList = array_diff($fieldValues, $listOptionValues);
$noLongerInListText = (count($fieldValuesNotInList) > 1) ? t('Previous selections (no longer in list)') : t('Previous selection (no longer in list)' );
// pulldown
$select = '';
$select .= " \n";
return $select;
}
?>