Created
July 19, 2012 19:20
-
-
Save CashWilliams/3146126 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 | |
function example_menu() { | |
$items[] = array(); | |
$items['some/pointless/url'] = array( | |
'title' => t('Some Pointless Title'), | |
'page callback' => 'pointless_navigator', | |
'access arguments' => array('access content'), | |
'type' => MENU_CALLBACK, | |
); | |
return $items; | |
} | |
function pointless_navigator() { | |
global $user; | |
if (user_access('view example') && user_access('view all example')) { | |
drupal_goto("some/other/url/a"); | |
} else { | |
drupal_goto("some/other/url/b"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment