diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-03 20:21:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-03 20:21:50 +0000 |
commit | ca8416e03637b99cf5846e6e3116ce4d2fcee5a0 (patch) | |
tree | c3017e25fa39d3f6caa46bc23fa2e7dd011412f3 /modules/blog | |
parent | d1a2de607e23da467c1366aca04ac5f61328a37a (diff) | |
download | brdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.gz brdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.bz2 |
- Patch #542658 by sun: follow-up on move action 'tabs' out of local tasks.
Diffstat (limited to 'modules/blog')
-rw-r--r-- | modules/blog/blog.module | 17 | ||||
-rw-r--r-- | modules/blog/blog.pages.inc | 9 | ||||
-rw-r--r-- | modules/blog/blog.test | 2 |
3 files changed, 18 insertions, 10 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) { diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc index a605cfa1c..b12904bf1 100644 --- a/modules/blog/blog.pages.inc +++ b/modules/blog/blog.pages.inc @@ -70,15 +70,6 @@ function blog_page_last() { global $user; $build = array(); - if (user_access('create blog content')) { - $items[] = l(t('Create new blog entry.'), "node/add/blog"); - $build['blog_actions'] = array( - '#items' => $items, - '#theme' => 'item_list', - '#weight' => -1, - ); - } - $query = db_select('node', 'n')->extend('PagerDefault'); $nids = $query ->fields('n', array('nid', 'sticky', 'created')) diff --git a/modules/blog/blog.test b/modules/blog/blog.test index 9a3734d4d..09d51a9fe 100644 --- a/modules/blog/blog.test +++ b/modules/blog/blog.test @@ -187,7 +187,7 @@ class BlogTestCase extends DrupalWebTestCase { $this->assertResponse(200); $this->assertTitle('Blogs | Drupal', t('Blog page was displayed')); $this->assertText(t('Home'), t('Breadcrumbs were displayed')); - $this->assertLink(t('Create new blog entry.')); + $this->assertLink(t('Create new blog entry')); // Confirm a blog page was displayed per user. $this->drupalGet('blog/' . $user->uid); |