I'm using 2.x dev as of Oct 2nd. I have tabs coming from views and ajax is enabled. When a view is set for access only by authenticated users, the tabs still show for anonymous. I don't see anything in the QT block building for setting access control. Is there any way I can make it inherit it from the setting on the view?

Thanks,

Michelle

Comments

pasqualle’s picture

The simple answer is no, the empty or inaccessible tab cannot be hidden, and this is the issue: #292150: Hide empty tabs

The long answer is #332895: render quicktab programatically If you not afraid of some php code you can do it.

if you add a simple condition to your code, then the given tab won't be visible (won't be created) for anonymous users..
for example like this:

  $global user;
  if ($user->uid) {
    $tabs['first'] = array(
     'title' => t('One'),
     'type' => 'view',
     'vid' => 'my_view_id',
     'display' => 'my_display',
     'args' => 'my_arguments',
    );
  }
michelle’s picture

Status: Active » Fixed

Thanks for the quick response. I did search but I was looking for access control, not empty, so totally missed the existing issue.

I'm not afraid of a little PHP. ;) Thanks for the example. I can take it from here, I think, so setting this fixed.

Michelle

michelle’s picture

Category: support » feature
Status: Fixed » Active

Actually... I can do this no problem but I'm sure I'm not the only one in this boat. I was just thinking that a feature request could be to simply put an access control option on each tab. Rather than worrying about what the view is doing, simply set the tab to be viewable by authenticated users only.

Just tossing the idea out there. If it's not possible, that's fine.

Michelle

netw3rker’s picture

Issue summary: View changes
Status: Active » Closed (fixed)