2008-09-02 19:23:02 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2009-02-05 01:05:17 +00:00
|
|
|
* Dummy module implementing hook menu.
|
2008-09-02 19:23:02 +00:00
|
|
|
*/
|
|
|
|
|
2009-02-05 01:05:17 +00:00
|
|
|
/**
|
|
|
|
* Implementation of hook_menu().
|
2008-09-02 19:23:02 +00:00
|
|
|
*/
|
2008-12-28 18:27:14 +00:00
|
|
|
function menu_test_menu() {
|
2009-02-05 01:05:17 +00:00
|
|
|
// The name of the menu changes during the course of the test. Using a $_GET.
|
2008-09-02 19:23:02 +00:00
|
|
|
$items['menu_name_test'] = array(
|
2009-02-05 01:05:17 +00:00
|
|
|
'title' => 'Test menu_name router item',
|
2008-09-02 19:23:02 +00:00
|
|
|
'page callback' => 'node_save',
|
|
|
|
'menu_name' => isset($_GET["hook_menu_name"]) ? $_GET["hook_menu_name"] : 'original',
|
|
|
|
);
|
2009-02-05 01:05:17 +00:00
|
|
|
// Use FALSE as 'title callback' to bypass t().
|
|
|
|
$items['menu_no_title_callback'] = array(
|
|
|
|
'title' => 'A title with @placeholder',
|
|
|
|
'title callback' => FALSE,
|
|
|
|
'title arguments' => array('@placeholder' => 'some other text'),
|
|
|
|
'page callback' => 'menu_test_callback',
|
|
|
|
'access arguments' => array('access content'),
|
|
|
|
);
|
2009-03-14 20:56:06 +00:00
|
|
|
|
2009-04-13 12:18:52 +00:00
|
|
|
// Hidden link for menu_link_maintain tests
|
|
|
|
$items['menu_test_maintain/%'] = array(
|
|
|
|
'title' => 'Menu maintain test',
|
|
|
|
'page callback' => 'node_page_default',
|
|
|
|
'access arguments' => array('access content'),
|
|
|
|
);
|
2009-03-14 20:56:06 +00:00
|
|
|
// Hierarchical tests.
|
|
|
|
$items['menu-test/hierarchy/parent'] = array(
|
|
|
|
'title' => 'Parent menu router',
|
|
|
|
'page callback' => 'node_page_default',
|
|
|
|
);
|
|
|
|
$items['menu-test/hierarchy/parent/child'] = array(
|
|
|
|
'title' => 'Child menu router',
|
|
|
|
'page callback' => 'node_page_default',
|
|
|
|
);
|
|
|
|
$items['menu-test/hierarchy/parent/child2/child'] = array(
|
|
|
|
'title' => 'Unattached subchild router',
|
|
|
|
'page callback' => 'node_page_default',
|
|
|
|
);
|
2008-09-02 19:23:02 +00:00
|
|
|
return $items;
|
2009-02-05 01:05:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dummy callback for hook_menu() to point to.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* A random string.
|
|
|
|
*/
|
|
|
|
function menu_test_callback() {
|
|
|
|
return $this->randomName();
|
|
|
|
}
|