Community

I want to remove upload tab from media browser window

I want to remove upload tab from media browser window and want to show only two tabs(web, library) on it.
And how can set the default selected tab for browser window.

Comments

add hook function!

Hi,
you have to create a module and add function
function MODULENAME_media_browser_plugins_alter(&$plugins)
{
unset($plugins['upload']);
}

Perfect solution !!! It

Perfect solution !!! It really works for me.
Thanks ephy :) :) You have saved my time :)

Thanks, it is working

Thanks, it is working great.... :)

Hi ephy,The code is working

Hi ephy,

The code is working fine Thank you.,But here is there any option to disable it from Media Configuration.Actually I want to give option to client disable it.Disable upload functionality of vidoes for the initial start of the site like that after that client will enable it.
For that
1. Checked permissions:
Actually I checked the permissions for Media module.There I found a option like "Import media files from the local filesystem - unchecked it for all roles."

2. Checked content type Media field settings:
Allowed URI schemes : Public (Unchecked it)

But no luck..

Thanks,
Ramesh Babu G.

r@mmi

Alter media configurations

Alter media configurations form and add checkbox "Disable upload tab"
Save it: variable_set('disable_media_upload', $form_state['values']['your_checkbox'])
And change function from above

<?php
function MODULENAME_media_browser_plugins_alter(&$plugins) {
if (
variable_get('disable_media_upload', 0)) {
  unset(
$plugins['upload']);
}
}
?>