Created
March 22, 2011 17:07
-
-
Save msonnabaum/881595 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Implementation of hook_views_query_substitutions(). | |
*/ | |
function welcom_core_views_query_substitutions($view) { | |
$roles = user_roles(); | |
$subs = array(); | |
foreach ($roles as $rid => $role) { | |
$subs['***ROLE_' . strtoupper(str_replace(array('-',' '), '_', $role)) . '***'] = $rid; | |
} | |
return $subs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment