1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-17 14:18:24 +01:00

[ticket/12591] Improve breadcrumb naming and extend it's usage

PHPBB3-12591
This commit is contained in:
Jakub Senko 2018-06-18 19:46:37 +02:00 committed by Marc Alexander
parent 139eb17bb7
commit 9f20ff7b9e
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
10 changed files with 50 additions and 45 deletions

View File

@ -783,25 +783,25 @@ function generate_forum_nav(&$forum_data_ary)
}
$navlinks_parents[] = array(
'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false,
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
'FORUM_NAME' => $parent_name,
'FORUM_ID' => $parent_forum_id,
'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id),
'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false,
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
'BREADCRUMB_NAME' => $parent_name,
'FORUM_ID' => $parent_forum_id,
'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"',
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id),
);
}
}
$navlinks = array(
'S_IS_CAT' => ($forum_data_ary['forum_type'] == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($forum_data_ary['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($forum_data_ary['forum_type'] == FORUM_POST) ? true : false,
'FORUM_NAME' => $forum_data_ary['forum_name'],
'FORUM_ID' => $forum_data_ary['forum_id'],
'MICRODATA' => $microdata_attr . '="' . $forum_data_ary['forum_id'] . '"',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data_ary['forum_id']),
'S_IS_CAT' => ($forum_data_ary['forum_type'] == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($forum_data_ary['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($forum_data_ary['forum_type'] == FORUM_POST) ? true : false,
'BREADCRUMB_NAME' => $forum_data_ary['forum_name'],
'FORUM_ID' => $forum_data_ary['forum_id'],
'MICRODATA' => $microdata_attr . '="' . $forum_data_ary['forum_id'] . '"',
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data_ary['forum_id']),
);
$forum_template_data = array(

View File

@ -936,8 +936,8 @@ class p_master
if (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id)
{
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $item_ary['lang'],
'U_VIEW_FORUM' => $u_title,
'BREADCRUMB_NAME' => $item_ary['lang'],
'U_BREADCRUMB' => $u_title,
));
}

View File

@ -309,8 +309,8 @@ $vars = array(
extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars)));
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $user->lang('MCP'),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}mcp.$phpEx"),
'BREADCRUMB_NAME' => $user->lang('MCP'),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}mcp.$phpEx"),
));
// Load and execute the relevant module

View File

@ -365,8 +365,8 @@ switch ($mode)
}
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $page_title,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=team"),
'BREADCRUMB_NAME' => $page_title,
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=team"),
));
$template->assign_vars(array(
@ -467,8 +467,8 @@ switch ($mode)
}
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $page_title,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"),
'BREADCRUMB_NAME' => $page_title,
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"),
));
// Send vars to the template
@ -876,12 +876,12 @@ switch ($mode)
$template_html = 'memberlist_view.html';
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $user->lang('MEMBERLIST'),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
'BREADCRUMB_NAME' => $user->lang('MEMBERLIST'),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
));
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $member['username'],
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$user_id"),
'BREADCRUMB_NAME' => $member['username'],
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$user_id"),
));
break;
@ -950,8 +950,8 @@ switch ($mode)
generate_forum_nav($topic_data);
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $topic_data['topic_title'],
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id"),
'BREADCRUMB_NAME' => $topic_data['topic_title'],
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id"),
));
$navlink_name = $user->lang('EMAIL_TOPIC');
@ -964,8 +964,8 @@ switch ($mode)
}
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $navlink_name,
'U_VIEW_FORUM' => $navlink_url,
'BREADCRUMB_NAME' => $navlink_name,
'U_BREADCRUMB' => $navlink_url,
));
break;
@ -1006,8 +1006,8 @@ switch ($mode)
$template_html = 'memberlist_body.html';
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $page_title,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
'BREADCRUMB_NAME' => $page_title,
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx"),
));
/* @var $pagination \phpbb\pagination */
@ -1316,8 +1316,8 @@ switch ($mode)
}
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $group_helper->get_name($group_row['group_name']),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g=$group_id"),
'BREADCRUMB_NAME' => $group_helper->get_name($group_row['group_name']),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g=$group_id"),
));
$template->assign_vars(array(

View File

@ -26,8 +26,8 @@ class bbcode extends controller
$this->language->add_lang('help/bbcode');
$this->template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $this->language->lang('BBCODE_GUIDE'),
'U_VIEW_FORUM' => $this->helper->route('phpbb_help_bbcode_controller'),
'BREADCRUMB_NAME' => $this->language->lang('BBCODE_GUIDE'),
'U_BREADCRUMB' => $this->helper->route('phpbb_help_bbcode_controller'),
));
$this->manager->add_block(

View File

@ -26,8 +26,8 @@ class faq extends controller
$this->language->add_lang('help/faq');
$this->template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $this->language->lang('FAQ_EXPLAIN'),
'U_VIEW_FORUM' => $this->helper->route('phpbb_help_faq_controller'),
'BREADCRUMB_NAME' => $this->language->lang('FAQ_EXPLAIN'),
'U_BREADCRUMB' => $this->helper->route('phpbb_help_faq_controller'),
));
$this->manager->add_block(

View File

@ -130,8 +130,8 @@ $phpbb_content_visibility = $phpbb_container->get('content.visibility');
$pagination = $phpbb_container->get('pagination');
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $user->lang('SEARCH'),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}search.$phpEx"),
'BREADCRUMB_NAME' => $user->lang('SEARCH'),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}search.$phpEx"),
));
/**
@ -516,6 +516,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$l_search_title = $user->lang['SEARCH_SELF'];
break;
}
$template->assign_block_vars('navlinks', array(
'BREADCRUMB_NAME' => $l_search_title,
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}search.$phpEx", "search_id=$search_id"),
));
}
/**

View File

@ -190,7 +190,7 @@
<!-- BEGIN navlinks -->
<!-- EVENT overall_header_navlink_prepend -->
<span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemtype="https://schema.org/Thing" itemprop="item"><span itemprop="name">{navlinks.FORUM_NAME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span>
<span class="crumb" {$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_BREADCRUMB}" itemtype="https://schema.org/Thing" itemprop="item"><span itemprop="name">{navlinks.BREADCRUMB_NAME}</span></a><meta itemprop="position" content="{{ navlink_position }}{% set navlink_position = navlink_position + 1 %}" /></span>
<!-- EVENT overall_header_navlink_append -->
<!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append -->

View File

@ -394,8 +394,8 @@ $vars = array('module', 'id', 'mode');
extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars)));
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $user->lang('UCP'),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}ucp.$phpEx"),
'BREADCRUMB_NAME' => $user->lang('UCP'),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}ucp.$phpEx"),
));
// Select the active module

View File

@ -488,8 +488,8 @@ $base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&a
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start);
$template->assign_block_vars('navlinks', array(
'FORUM_NAME' => $user->lang('WHO_IS_ONLINE'),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewonline.$phpEx"),
'BREADCRUMB_NAME' => $user->lang('WHO_IS_ONLINE'),
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}viewonline.$phpEx"),
));
// Send data to template