You are here

function ml_image_get_metadata in Media Library 6

Get all metadata items to relate do an image. TODO: add flexibility to metadata items to allow modules to add their own

6 calls to ml_image_get_metadata()
ml_flickr_flickr_source_form in ml_image/ml_flickr/ml_flickr.module
Form for checking flickr images.
ml_image_basic_existing_options_form in ml_image/ml_image_basic/ml_image_basic.module
Image selection stage
ml_image_basic_existing_source_form in ml_image/ml_image_basic/ml_image_basic.module
Form for checking existing images.
ml_image_basic_upload_options_form in ml_image/ml_image_basic/ml_image_basic.module
Function for upload options (second step) {
ml_image_basic_upload_options_form_submit in ml_image/ml_image_basic/ml_image_basic.module
Submit callback for ml_image_basic_upload_options_form()

... See full list

File

ml_image/ml_image.module, line 509
Media Library Image module.

Code

function ml_image_get_metadata() {
  $metadata = array(
    'title' => array(
      'type' => 'textfield',
      'label' => t('Title'),
      'description' => t('Descriptive short title'),
    ),
    'copyright' => array(
      'type' => 'textfield',
      'label' => t('Copyright'),
      'description' => t('Copyright information.'),
    ),
    'author' => array(
      'type' => 'textfield',
      'label' => t('Photographer'),
      'description' => t('Picture author name.'),
    ),
  );
  if ($vid = variable_get('ml_image_vocabulary', 0)) {
    $vocab = taxonomy_vocabulary_load($vid);
    $metadata['tags'] = array(
      'type' => 'term',
      'label' => $vocab->name,
      'description' => $vocab->description,
      'vocabulary' => $vocab,
    );
  }
  return $metadata;
}