| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: audio_import.pages.inc,v 1.2 2008/09/30 04:43:07 drewish Exp $ |
// $Id: audio_import.pages.inc,v 1.3 2008/12/21 22:23:41 drewish Exp $ |
| 4 |
|
|
| 5 |
|
|
| 6 |
function audio_import_validate_file($filepath) { |
function audio_import_validate_file($file) { |
| 7 |
$errors = array(); |
$errors = array(); |
| 8 |
// TODO add in some validation to ensure that we only import audio files... |
// TODO add in some validation to ensure that we only import audio files... |
| 9 |
return $errors; |
return $errors; |
| 86 |
); |
); |
| 87 |
|
|
| 88 |
// If there were problems don't let them import it |
// If there were problems don't let them import it |
| 89 |
$problems = audio_import_validate_file($file->filename); |
$problems = audio_import_validate_file($file); |
| 90 |
if (count($problems)) { |
if (count($problems)) { |
| 91 |
$form['files']['import'][$index]['#type'] = 'item'; |
$form['files']['import'][$index]['#type'] = 'item'; |
| 92 |
$form['files']['errors'][$index] = array( |
$form['files']['errors'][$index] = array( |
| 94 |
'#value' => '<em>'. implode(' ', $problems) .'</em>', |
'#value' => '<em>'. implode(' ', $problems) .'</em>', |
| 95 |
); |
); |
| 96 |
unset($form['files']['title'][$index]); |
unset($form['files']['title'][$index]); |
| 97 |
unset($form['files']['caption'][$index]); |
unset($form['files']['body'][$index]); |
| 98 |
} |
} |
| 99 |
} |
} |
| 100 |
|
|