Index: branches/RC/core/units/general/helpers/file_helper.php =================================================================== diff -u -N -r10720 -r11857 --- branches/RC/core/units/general/helpers/file_helper.php (.../file_helper.php) (revision 10720) +++ branches/RC/core/units/general/helpers/file_helper.php (.../file_helper.php) (revision 11857) @@ -159,7 +159,8 @@ if (preg_match('/^('.$field_prefix.'[\d]+|Primary'.$field_prefix.')$/', $field_name)) { $fields[$field_name] = $field_options; $virtual_fields[$field_name] = $field_options; - $virtual_fields['Delete'.$field_name] = Array ('type' => 'int', 'not_null' => 1, 'default' => 0); + $this->_createCustomFields($prefix, $field_name, $virtual_fields, $is_image); + $image_count++; } } @@ -185,6 +186,22 @@ } /** + * Adds ability to create more virtual fields associated with main image/file + * + * @param string $prefix + * @param string $field_name + * @param Array $virtual_fields + */ + function _createCustomFields($prefix, $field_name, &$virtual_fields, $is_image) + { + $virtual_fields['Delete' . $field_name] = Array ('type' => 'int', 'not_null' => 1, 'default' => 0); + + if ($is_image) { + $virtual_fields[$field_name . 'Alt'] = Array ('type' => 'string', 'default' => ''); + } + } + + /** * Downloads file to user * * @param string $filename