You are here

function media_media_mover_user_files in D7 Media 6

Retrives users media mover files

Parameters

unknown_type $node_type:

unknown_type $field:

unknown_type $uid:

Return value

unknown

1 string reference to 'media_media_mover_user_files'
media_media_mover_media_register in media_media_mover/media_media_mover.module
Implementation of hook_media_register

File

media_media_mover/media_media_mover.module, line 95
This module provides integration for Media Mover module with the Media module

Code

function media_media_mover_user_files($node_type, $field, $uid) {
  global $user;
  $files = array();
  $results = db_query('SELECT complete_file FROM {media_mover_files} mmf LEFT JOIN {node} n ON mmf.nid = n.nid LEFT JOIN {users} u ON u.uid = n.uid WHERE u.uid = %d ORDER BY n.created DESC', $user->uid);
  while ($file = db_fetch_array($results)) {
    $files[] = array(
      'uri' => $file['complete_file'],
      'filename' => basename($file['complete_file']),
      'meta' => '',
    );
  }
  return array(
    t('My files') => array(
      t('Media Mover files') => media_resource_display_user_files_form($files, t('My Media Mover files')),
    ),
  );
}