Created
September 24, 2013 12:09
-
-
Save DuaelFr/6683792 to your computer and use it in GitHub Desktop.
Hide drupal tabs using a permission
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_permission(). | |
*/ | |
function MYMODULE_permission() { | |
return array( | |
'view contextual tabs' => array( | |
'title' => t('View contextual tabs'), | |
'restrict access' => TRUE, | |
), | |
); | |
} | |
/** | |
* Implements hook_preprocess_HOOK(). | |
*/ | |
function MYMODULE_preprocess_page(&$variables, $hook) { | |
if (!user_access('view contextual tabs')) { | |
$variables['tabs'] = array(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment