'Drupal Goto', 'page callback' => 'common_test_drupal_goto_land', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); $items['common-test/drupal_goto/fail'] = array( 'title' => 'Drupal Goto', 'page callback' => 'common_test_drupal_goto_land_fail', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); $items['common-test/drupal_goto/redirect'] = array( 'title' => 'Drupal Goto', 'page callback' => 'common_test_drupal_goto_redirect', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); $items['common-test/drupal_goto/redirect_fail'] = array( 'title' => 'Drupal Goto Failure', 'page callback' => 'drupal_goto', 'page arguments' => array('common-test/drupal_goto/fail'), 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $items; } /** * Check that drupal_goto() exits once called. */ function common_test_drupal_goto_redirect() { drupal_goto('common-test/drupal_goto'); print t("Drupal goto failed to stop program"); } /** * Landing page for drupal_goto(). */ function common_test_drupal_goto_land() { print "drupal_goto"; } /** * Fail landing page for drupal_goto(). */ function common_test_drupal_goto_land_fail() { print "drupal_goto_fail"; } /** * Implement hook_drupal_goto_alter(). */ function common_test_drupal_goto_alter(&$args) { if ($args['path'] == 'common-test/drupal_goto/fail') { $args['path'] = 'common-test/drupal_goto/redirect'; } } /** * Implement hook_theme(). */ function common_test_theme() { return array( 'common_test_foo' => array( 'arguments' => array('foo' => 'foo', 'bar' => 'bar'), ), ); } /** * Theme function for testing drupal_render() theming. */ function theme_common_test_foo($variables) { return $variables['foo'] . $variables['bar']; } /** * Implementation of hook_library_alter(). */ function common_test_library_alter(&$libraries, $module) { if ($module == 'system' && isset($libraries['farbtastic'])) { // Change the title of Farbtastic to "Farbtastic: Altered Library". $libraries['farbtastic']['title'] = 'Farbtastic: Altered Library'; // Make Farbtastic depend on jQuery Form to test library dependencies. $libraries['farbtastic']['dependencies'][] = array('system', 'form'); } } /** * Implementation of hook_library(). * * Adds Farbtastic in a different version. */ function common_test_library() { $libraries['farbtastic'] = array( 'title' => 'Custom Farbtastic Library', 'website' => 'http://code.google.com/p/farbtastic/', 'version' => '5.3', 'js' => array( 'misc/farbtastic/farbtastic.js' => array(), ), 'css' => array( 'misc/farbtastic/farbtastic.css' => array(), ), ); return $libraries; }