Created
March 14, 2013 15:59
-
-
Save opi/5162579 to your computer and use it in GitHub Desktop.
Drupal: Navigation 404
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_menu(). | |
*/ | |
function mymodule_menu() { | |
$items = array(); | |
// PUBLIC PAGES | |
$items['error404'] = array( | |
'title' => "Page not found", | |
'page callback' => 'mymodule_404_page', | |
'access arguments' => array('access content'), | |
'type' => MENU_SUGGESTED_ITEM, | |
); | |
$items['error403'] = array( | |
'title' => "Access denied", | |
'page callback' => 'mymodule_403_page', | |
'access arguments' => array('access content'), | |
'type' => MENU_SUGGESTED_ITEM, | |
); | |
return $items; | |
} | |
/** | |
* Callback for 404 | |
* Mimic navigation404 module. | |
*/ | |
function mymodule_404_page() { | |
drupal_set_title(t("Page not found")); | |
return t("The requested page could not be found."); | |
} | |
/** | |
* Callback for 403 | |
* Mimic navigation404 module. | |
*/ | |
function mymodule_403_page() { | |
drupal_set_title(t("Access denied")); | |
return t("You are not authorized to access this page."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment