summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-27 14:03:37 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-27 14:03:37 +0000
commit34afaf8f2892d5188a72e200b198fa8b9a2ef247 (patch)
tree18188a7cacc77536a12bfec7ba9d350810b42415 /modules
parent2d128fc080f4729e93698e8865b7940d208dd8b5 (diff)
downloadbrdo-34afaf8f2892d5188a72e200b198fa8b9a2ef247.tar.gz
brdo-34afaf8f2892d5188a72e200b198fa8b9a2ef247.tar.bz2
#176748 follow up by pwolanin: fix bad breadcrumbs and missing/wrong titles
Diffstat (limited to 'modules')
-rw-r--r--modules/filter/filter.admin.inc5
-rw-r--r--modules/filter/filter.module9
-rw-r--r--modules/node/node.pages.inc1
-rw-r--r--modules/user/user.module12
4 files changed, 23 insertions, 4 deletions
diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc
index 96e010d44..03b98be7b 100644
--- a/modules/filter/filter.admin.inc
+++ b/modules/filter/filter.admin.inc
@@ -74,16 +74,13 @@ function theme_filter_admin_overview($form) {
}
/**
- * Display a filter format form.
+ * Menu callback; Display a filter format form.
*/
function filter_admin_format_page($format = NULL) {
if (!isset($format->name)) {
drupal_set_title(t("Add input format"));
$format = (object)array('name' => '', 'roles' => '', 'format' => '');
}
- else {
- drupal_set_title(t("%format input format", array('%format' => $format->name)));
- }
return drupal_get_form('filter_admin_format_form', $format);
}
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index a8106a709..ed3eddcb2 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -102,6 +102,8 @@ function filter_menu() {
);
$items['admin/settings/filters/%filter_format'] = array(
'type' => MENU_CALLBACK,
+ 'title callback' => 'filter_admin_format_title',
+ 'title arguments' => array(3),
'page callback' => 'filter_admin_format_page',
'page arguments' => array(3),
'access arguments' => array('administer filters'),
@@ -138,6 +140,13 @@ function filter_format_load($arg) {
}
/**
+ * Display a filter format form title.
+ */
+function filter_admin_format_title($format) {
+ return $format->name;
+}
+
+/**
* Implementation of hook_perm().
*/
function filter_perm() {
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index e608dc922..66f781aee 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -11,6 +11,7 @@
* Menu callback; presents the node editing form, or redirects to delete confirmation.
*/
function node_page_edit($node) {
+ drupal_set_title($node->title);
return drupal_get_form($node->type .'_node_form', $node);
}
diff --git a/modules/user/user.module b/modules/user/user.module
index 786443e12..fcc8af2f3 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1029,6 +1029,8 @@ function user_menu() {
$items['user/%user_current'] = array(
'title' => 'My account',
+ 'title callback' => 'user_page_title',
+ 'title arguments' => array(1),
'page callback' => 'user_view',
'page arguments' => array(1),
'access callback' => 'user_view_access',
@@ -1152,6 +1154,16 @@ function user_current_to_arg($arg) {
}
/**
+ * Menu item title callback - use the user name if it's not the current user.
+ */
+function user_page_title($account) {
+ if ($account->uid == $GLOBALS['user']->uid) {
+ return t('My account');
+ }
+ return $account->name;
+}
+
+/**
* Accepts an user object, $account, or a DA name and returns an associative
* array of modules and DA names. Called at external login.
*/