? 223941-2.patch
? 223941.patch
? sites/all/modules
? sites/default/files
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.758
diff -u -p -r1.758 common.inc
--- includes/common.inc 18 Feb 2008 16:53:36 -0000 1.758
+++ includes/common.inc 19 Feb 2008 22:38:47 -0000
@@ -3011,6 +3011,9 @@ function drupal_common_theme() {
'form_element' => array(
'arguments' => array('element' => NULL, 'value' => NULL),
),
+ 'field_example' => array(
+ 'arguments' => array('text' => NULL),
+ ),
);
}
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.267
diff -u -p -r1.267 form.inc
--- includes/form.inc 12 Feb 2008 13:52:32 -0000 1.267
+++ includes/form.inc 19 Feb 2008 22:38:48 -0000
@@ -2003,6 +2003,10 @@ function theme_textfield($element) {
$output .= ' '. $element['#field_suffix'] .'';
}
+ if (isset($element['#example'])) {
+ $output .= theme('field_example', $element['#example']);
+ }
+
return theme('form_element', $element, $output) . $extra;
}
@@ -2169,7 +2173,7 @@ function theme_form_element($element, $v
}
$output .= " $value\n";
-
+
if (!empty($element['#description'])) {
$output .= '
'. $element['#description'] ."
\n";
}
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.416
diff -u -p -r1.416 theme.inc
--- includes/theme.inc 6 Feb 2008 19:38:26 -0000 1.416
+++ includes/theme.inc 19 Feb 2008 22:38:48 -0000
@@ -1616,6 +1616,19 @@ function theme_indentation($size = 1) {
}
/**
+ * Format examples specified in FAPI #example properties.
+ *
+ * @param $example
+ * An example entry for a text field.
+ * @return
+ * A themed HTML string containing the example.
+ */
+function theme_field_example($example) {
+ $output = ' '. t('Example:') .' '. $example .'';
+ return $output;
+}
+
+/**
* @} End of "defgroup themeable".
*/
Index: modules/system/system.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.css,v
retrieving revision 1.48
diff -u -p -r1.48 system.css
--- modules/system/system.css 9 Jan 2008 09:56:39 -0000 1.48
+++ modules/system/system.css 19 Feb 2008 22:38:48 -0000
@@ -135,6 +135,15 @@ tr.merge-up, tr.merge-up td, tr.merge-up
.form-item .description {
font-size: 0.85em;
}
+.form-item .example {
+ font-size: 0.85em;
+ font-weight: bold;
+ color: #f99;
+}
+.form-item .example-caption {
+ font-size: 0.85em;
+ font-style: italic;
+}
.form-item label {
display: block;
font-weight: bold;
Index: modules/upload/upload.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.admin.inc,v
retrieving revision 1.7
diff -u -p -r1.7 upload.admin.inc
--- modules/upload/upload.admin.inc 10 Jan 2008 20:22:57 -0000 1.7
+++ modules/upload/upload.admin.inc 19 Feb 2008 22:38:48 -0000
@@ -70,8 +70,9 @@ function upload_admin_settings() {
'#default_value' => variable_get('upload_max_resolution', 0),
'#size' => 15,
'#maxlength' => 10,
- '#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an image toolkit is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
- '#field_suffix' => ''. t('WIDTHxHEIGHT') .''
+ '#description' => t('The maximum allowed image size. Set to 0 for no restriction. If an image toolkit is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))),
+ '#field_suffix' => ''. t('WIDTHXHEIGHT') .'',
+ '#example' => '640x480',
);
$form['settings_general']['upload_list_default'] = array(
'#type' => 'select',
@@ -87,6 +88,7 @@ function upload_admin_settings() {
'#default_value' => $upload_extensions_default,
'#maxlength' => 255,
'#description' => t('Default extensions that users can upload. Separate extensions with a space and do not include the leading dot.'),
+ '#example' => 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp',
);
$form['settings_general']['upload_uploadsize_default'] = array(
'#type' => 'textfield',
@@ -96,6 +98,7 @@ function upload_admin_settings() {
'#maxlength' => 5,
'#description' => t('The default maximum file size a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'),
'#field_suffix' => t('MB'),
+ '#example' => '1',
);
$form['settings_general']['upload_usersize_default'] = array(
'#type' => 'textfield',
@@ -105,6 +108,7 @@ function upload_admin_settings() {
'#maxlength' => 5,
'#description' => t('The default maximum size of all files a user can have on the site.'),
'#field_suffix' => t('MB'),
+ '#example' => '1',
);
$form['settings_general']['upload_max_size'] = array('#value' => ''. t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) .'
');