diff options
Diffstat (limited to 'modules/blog/blog.module')
-rw-r--r-- | modules/blog/blog.module | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 294dfb17f..5e9d894bb 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -134,6 +134,23 @@ function blog_menu() { } /** + * Implements hook_menu_local_tasks_alter(). + */ +function blog_menu_local_tasks_alter(&$data, $router_item, $root_path) { + // Add action link to 'node/add/blog' on 'blog' page. + if ($root_path == 'blog') { + $item = menu_get_item('node/add/blog'); + if ($item['access']) { + $item['title'] = t('Create new blog entry'); + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + } +} + +/** * Access callback for user blog pages. */ function blog_page_user_access($account) { |