Skip to content

Instantly share code, notes, and snippets.

@CashWilliams
Created July 19, 2012 19:20
Show Gist options
  • Save CashWilliams/3146126 to your computer and use it in GitHub Desktop.
Save CashWilliams/3146126 to your computer and use it in GitHub Desktop.
<?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