diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-04 16:50:02 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-04 16:50:02 +0000 |
commit | fe2b3e7c006a607c2b9fd9a485a7bda13515a94f (patch) | |
tree | 1c16960253df2c99488fdd8cf81305ff369884d4 /modules/system | |
parent | 353c05d01536aac26fec7e9cfee0e84838973286 (diff) | |
download | brdo-fe2b3e7c006a607c2b9fd9a485a7bda13515a94f.tar.gz brdo-fe2b3e7c006a607c2b9fd9a485a7bda13515a94f.tar.bz2 |
- Patch by Steven and me: refactored the form handling of nodes. The node system is now using form_set_error() and friends like the rest of Drupal does. This makes for both a consistent user experience and consistent code. It simplifies the forms and validation code, however, it does change the node API slightly:
* The _validate hook and the _nodeapi('validate') hook of the node API (1) no longer take an 'error' parameter and (2) should no longer return an error array. To set an error, call form_set_error().
* The _form hook of the node module no longer takes a form hook and should not worry about displaying errors. Ditto for _nodeapi('form_post') and _nodeapi('form_pre').
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 5fccde31e..eb0607dc2 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -146,13 +146,13 @@ function system_view_general() { // file system: if (!file_check_directory(variable_get('file_directory_path', 'files'))) { - $error['file_directory_path'] = theme('error', t('Directory does not exist, or is not writable.')); + form_set_error('file_directory_path', t('Directory does not exist, or is not writable.')); } if (!file_check_directory(variable_get('file_directory_temp', (PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp')))) { - $error['file_directory_temp'] = theme('error', t('Directory does not exist, or is not writable.')); + form_set_error('file_directory_temp', t('Directory does not exist, or is not writable.')); } - $group = form_textfield(t('File system path'), 'file_directory_path', variable_get('file_directory_path', 'files'), 70, 255, t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.') . $error['file_directory_path']); - $group .= form_textfield(t('Temporary directory'), 'file_directory_temp', variable_get('file_directory_temp', (PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp')), 70, 255, t('Location where files can be saved temporarily. This directory should not be accessible from the web.') . $error['file_directory_temp']); + $group = form_textfield(t('File system path'), 'file_directory_path', variable_get('file_directory_path', 'files'), 70, 255, t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.')); + $group .= form_textfield(t('Temporary directory'), 'file_directory_temp', variable_get('file_directory_temp', (PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp')), 70, 255, t('Location where files can be saved temporarily. This directory should not be accessible from the web.')); $group .= form_radios(t('Download method'), 'file_downloads', variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC), array(FILE_DOWNLOADS_PUBLIC => t('Public - files are available using http directly.'), FILE_DOWNLOADS_PRIVATE => t('Private - files are be transferred by Drupal.')), t('This setting can be changed at any time, however, all download URLs will change and there may be unexpected problems so it is not recommended.')); $output .= form_group(t('File system'), $group); |