As title says, I need to override few media module functions and add some extra conditions when selecting media. I wanted to create new module that extends media module and overrides those functions but without success.
I wanted to override function
function media_admin_list(&$parent_form)
and to add this line so media module will select media from logged in user
$query = db_select('file_managed', 'f')->extend('PagerDefault')->extend('TableSort');
$query->join('users', 'u', 'f.uid = u.uid');
$query->fields('f', array('fid'));
$query->fields('u', array('uid'));
$query->condition('f.status', FILE_STATUS_PERMANENT);
$query->condition('u.uid', $user_id, "=");
$query->limit($limit);
$query->orderByHeader($header);
As you can see in code above, we have condition for selecting media from specific user.
Please advise how to override this function in my own module.
Thanks.