public function LocalFolderProvider::settingsFormValidate in Devel images provider 8
Same name and namespace in other branches
- 7 plugins/devel_image_provider/provider/LocalFolderProvider.class.php \LocalFolderProvider::settingsFormValidate()
Generates a settings form validate function for this handler.
Overrides DevelImagesProviderBase::settingsFormValidate
File
- plugins/
devel_image_provider/ provider/ LocalFolderProvider.class.php, line 33 - Local folder support class.
Class
- LocalFolderProvider
- Add support for local images.
Code
public function settingsFormValidate(&$form, &$form_state) {
if (empty($form_state['values']['config_providers']['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_path'])) {
form_error($form['config_providers']['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_path'], t('Path cannot be empty'));
return FALSE;
}
if (!is_readable($form_state['values']['config_providers']['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_path'])) {
form_error($form['config_providers']['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_path'], t('Specified folder is not valid or not readable'));
}
}