I have created a small module (which I'll call "mymodule" here, names changed to protect the innocent) which shows a custom page. In this simplified example of what I'm attempting to accomplish, once the module is installed and enabled, a new "My Module Page" link shows up on the Navigation menu, and when it's clicked, a page is displayed with some dynamically-generated content, with "My Module Page" as the page header. But in the settings of my module, I allow the site admin to change the title of this page. How? Here is the hook_menu code for my module:
function mymodule_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'mymodule',
'title' => variable_get('mymodule_title_of_page', t('My Module Page')),
'access' => user_access('access content'),
'callback' => 'show_mymodule_page'
);
$items[] = array(
'path' => 'admin/settings/mymodule',
'title' => t('My Module Settings'),
'description' => t('Settings for My Module.'),
'callback' => 'drupal_get_form',
'callback arguments' => array('mymodule_admin_settings'),
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM
);
}
return $items;
}