function social_book_social_user_account_header_create_links in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 8.5 modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 8.6 modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 8.7 modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 8.8 modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 10.3.x modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 10.0.x modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 10.1.x modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
- 10.2.x modules/social_features/social_book/social_book.module \social_book_social_user_account_header_create_links()
Implements hook_social_user_account_header_create_links().
Adds the "Create Book" link to the content creation menu if the user is allowed to create new books.
File
- modules/
social_features/ social_book/ social_book.module, line 37 - The Social book module.
Code
function social_book_social_user_account_header_create_links($context) {
return [
'add_book' => [
'#type' => 'link',
'#attributes' => [
'title' => new TranslatableMarkup('Create New Book Page'),
],
'#title' => new TranslatableMarkup('New Book Page'),
] + Url::fromRoute('node.add', [
'node_type' => 'book',
])
->toRenderArray(),
];
}