public static function ScaldAtomController::getThumbnailPath in Scald: Media Management made easy 7
Prepares and returns the default thumbnail path for an atom type.
3 calls to ScaldAtomController::getThumbnailPath()
- scald_atom_thumbnail_path in ./
scald.module - Prepares and returns the default thumbnail path for an atom type.
- scald_audio_scald_add_form_fill in modules/
providers/ scald_audio/ scald_audio.module - Implements hook_scald_add_form_fill().
- scald_image_scald_add_form in modules/
providers/ scald_image/ scald_image.module - Implements hook_scald_add_form().
File
- includes/
ScaldAtomController.inc, line 28 - This file contains the Scald Atom controller.
Class
- ScaldAtomController
- Controller class for Scald Atoms.
Code
public static function getThumbnailPath($type) {
$field = field_info_field('scald_thumbnail');
$instance = field_info_instance('scald_atom', 'scald_thumbnail', $type);
if ($field && $instance) {
$directory = file_field_widget_uri($field, $instance);
if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
return $directory;
}
drupal_set_message(t('The directory "@directory" must be writable by the webserver. Your upload will not be saved. Please contact your server administrator to configure permissions.', array(
'@directory' => $directory,
)), 'error', FALSE);
}
}