function _gd_image_chart_settings_page_validate in Charts 6
Module settings page. Users can set the default filepath and setup cleaning instructions of their gd image charts.
File
- gd_image_chart/
gd_image_chart.admin.inc, line 55 - @author Mads Peter Henderson http://drupal.org/user/421971
Code
function _gd_image_chart_settings_page_validate(&$form, &$form_state) {
$desired_path = check_plain($form_state['values']['path']);
$final_path = file_directory_path() . "/" . $desired_path;
if (!file_check_directory($final_path, FILE_CREATE_DIRECTORY)) {
form_set_error('path', '"' . $desired_path . t('" is not a valid file path. System must be able to write to #full_path', array(
'#full_path' => $final_path,
)));
}
}