Prevent 'personal files' tab appearing on users page.

phonydream2 - April 27, 2008 - 11:30
Project:IMCE
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I'd like to allow a user to use IMCE in conjunction with TinyMCE but I don't want the 'Personal Files' tab appearing on their user profile page. I know I can hide the tab using template.php, however the code is still being run and I think this is a bit inefficient.

Is there a way to only use IMCE with TinyMCE?

#1

nath - May 6, 2008 - 08:37

Subscribing

#2

nokes - March 6, 2009 - 19:35
Status:active» needs review

Hi...

I know this thread is pretty old, but I have a client that requested this same thing, so I looked into it briefly. I came up with the following (very basic) patch. It just adds another permissions flag ("access imce personal files") which is available in the Access Control area (like "access imce" and "administer imce"). If the permission is not granted, and the user does not have "administer imce", then they don't see the Personal files tab anymore.

I hope it still helps someone.

peace,
Nokes

AttachmentSize
personal_files.patch 992 bytes

#3

ao5357 - March 13, 2009 - 18:17

Can we get this for 6.x?

#4

ao5357 - March 16, 2009 - 20:13

Ok, so in D6 I got the tab to not show up by commenting out function imce_user_page_access() and

/* $items['user/%user/imce'] = array(
    'title' => 'File browser',
    'page callback' => 'imce_user_page',
    'page arguments' => array(1),
    'access callback' => 'imce_user_page_access',
    'access arguments' => array(1),
    'file' => 'inc/page.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  ); */

which can be found at the very end of imce_menu().
I make no claim to the effectiveness or reliability of this, but it made the thing go away while still letting me use the button through BUEditor. Just to let you know.

#5

wesley_2mpact - August 17, 2009 - 13:11

I would recommend making a small module to do this. If the IMCE module is updated the above won't work anymore since the code will be overwritten.

<?php
function mymodule_menu_alter(&$items)
{
  unset(
$items['user/%user/imce']);
}
?>

#6

askibinski - August 18, 2009 - 15:30

You can easily modify tabs in your template.php, but this may also be possible with this new module:
http://drupal.org/project/tabtamer

Haven't checked it out yet though.

#7

xurizaemon - September 23, 2009 - 22:20

#5 is a good workaround, but +1 for addition of an additional permission OR per-profile option to make this easily configurable sitewide without having to add custom code on each site.

I like that the implementation in #2 on this thread appears to check roles in a way which allows removing the tab from UID=1's user page also.

Can we bump this ticket to 6.x, or is this issue for 5.x hardcore folks? ;)

#8

crabcakes - November 5, 2009 - 15:57

This works, thanks!

#9

ufku - November 20, 2009 - 22:00
Version:5.x-1.x-dev» 6.x-1.x-dev

Thank you all for your interest.
Here is the patch for 6.x-1.x branch which makes File browser tab optional. It's now a profile option as suggested.

This patch also makes the tab link open as a standalone page(not embedded), which is a required step for solving many issues of theme js and css interference.

I regret to inform 5.x users that there won't be any new features for it.

ps: run update.php after applying the patch. otherwise all profiles(except user#1) will have the tab disabled, which is the only side effect of not updating immediately.

#10

ufku - November 20, 2009 - 22:01

the patch.

AttachmentSize
imce.user_.tab_.patch 3.63 KB

#11

ufku - November 20, 2009 - 22:09

this one retains Id texts.

AttachmentSize
imce.user_.tab_.patch 3.14 KB
 
 

Drupal is a registered trademark of Dries Buytaert.