Skip to content

Commit

Permalink
Merge pull request #3795 from Spuds/linktree
Browse files Browse the repository at this point in the history
Finish rename linktree to breadcrumbs
  • Loading branch information
Spuds committed Apr 27, 2024
2 parents 5482d27 + 796ece4 commit 9758e91
Show file tree
Hide file tree
Showing 47 changed files with 176 additions and 176 deletions.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public function ssi_main()

// Get rid of $board and $topic... do stuff loadBoard would do.
unset($board, $topic);
$context['linktree'] = array();
$context['breadcrumbs'] = [];

// Load the user and their cookie, as well as their settings.
User::load(true);
Expand Down
16 changes: 8 additions & 8 deletions sources/ElkArte/AdminController/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function action_index()

// Actually create the menu!
$admin_include_data = $this->loadMenu();
$this->buildLinktree($admin_include_data);
$this->buildBreadCrumbs($admin_include_data);

// And off we go, only one action, the chosen menu area
$action = new Action();
Expand Down Expand Up @@ -573,22 +573,22 @@ private function loadMenu()
*
* @param array $admin_include_data
*/
private function buildLinktree($admin_include_data)
private function buildBreadCrumbs($admin_include_data)
{
global $txt, $context;

// Build the link tree.
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('admin', ['action' => 'admin']),
'name' => $txt['admin_center'],
);
];

if (isset($admin_include_data['current_area']) && $admin_include_data['current_area'] !== 'index')
{
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('admin', ['action' => 'admin', 'area' => $admin_include_data['current_area'], '{session_data}']),
'name' => $admin_include_data['label'],
);
];
}

if (!isset($admin_include_data['current_subsection'], $admin_include_data['subsections'][$admin_include_data['current_subsection']]))
Expand All @@ -601,10 +601,10 @@ private function buildLinktree($admin_include_data)
return;
}

$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('admin', ['action' => 'admin', 'area' => $admin_include_data['current_area'], 'sa' => $admin_include_data['current_subsection'], '{session_data}']),
'name' => $admin_include_data['subsections'][$admin_include_data['current_subsection']]['label'],
);
];
}

/**
Expand Down
6 changes: 3 additions & 3 deletions sources/ElkArte/AdminController/ManageMaillist.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ public function action_edit_filters()
$title = empty($this->_req->query->saved) ? ($context['editing'] === true ? 'edit_filter' : 'add_filter') : ('saved_filter');
$context['post_url'] = getUrl('admin', ['action' => 'admin', 'area' => 'maillist', 'sa' => 'editfilter', 'edit' => $context['editing'] ? $modSettings['id_filter'] : 'new', 'save']);
$context['settings_title'] = $txt[$title];
$context['linktree'][] = array(
$context['breadcrumbs'][] = array(
'url' => getUrl('admin', ['action' => 'admin', 'area' => 'maillist', 'sa' => 'editfilter']),
'name' => ($context['editing']) ? $txt['edit_filter'] : $txt['add_filter'],
);
Expand Down Expand Up @@ -1434,10 +1434,10 @@ public function action_edit_parsers()
$title = ((isset($this->_req->query->saved) && $this->_req->query->saved == '1') ? 'saved_parser' : ($context['editing'] === true ? 'edit_parser' : 'add_parser'));
$context['settings_title'] = $txt[$title];
$context['post_url'] = getUrl('admin', ['action' => 'admin', 'area' => 'maillist', 'sa' => 'editparser', 'edit' => $context['editing'] ? $modSettings['id_filter'] : 'new', 'save']);
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('admin', ['action' => 'admin', 'area' => 'maillist', 'sa' => 'editparser']),
'name' => ($context['editing']) ? $txt['edit_parser'] : $txt['add_parser'],
);
];

// prep it, load it, show it
$settingsForm->prepare();
Expand Down
8 changes: 4 additions & 4 deletions sources/ElkArte/Controller/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public function action_login()
$context['never_expire'] = false;

// Add the login chain to the link tree.
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'login']),
'name' => $txt['login'],
);
];

// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).
if (isset($_SESSION['old_url']) && validLoginUrl($_SESSION['old_url'], true))
Expand Down Expand Up @@ -180,10 +180,10 @@ public function action_login2()
$context['page_title'] = $txt['login'];

// Add the login chain to the link tree.
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'login']),
'name' => $txt['login'],
);
];

// You forgot to type your username, dummy!
if (!isset($_POST['user']) || $_POST['user'] === '')
Expand Down
20 changes: 10 additions & 10 deletions sources/ElkArte/Controller/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,25 @@ public function action_calendar()
// Set the page title to mention the month or week, too
$context['page_title'] .= ' - ' . ($context['view_week'] ? sprintf($txt['calendar_week_title'], $context['calendar_grid_main']['week_number'], ($context['calendar_grid_main']['week_number'] == 53 ? $context['current_year'] - 1 : $context['current_year'])) : $txt['months'][$context['current_month']] . ' ' . $context['current_year']);

// Load up the linktree!
$context['linktree'][] = array(
// Load up the breadcrumbs!
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'calendar']),
'name' => $txt['calendar']
);
];

// Add the current month to the linktree.
$context['linktree'][] = array(
// Add the current month to the breadcrumbs.
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'calendar', 'year' => $context['current_year'], 'month' => $context['current_month']]),
'name' => $txt['months'][$context['current_month']] . ' ' . $context['current_year']
);
];

// If applicable, add the current week to the linktree.
// If applicable, add the current week to the breadcrumbs.
if ($context['view_week'])
{
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'calendar', 'year' => $context['current_year'], 'month' => $context['current_month'], 'day' => $context['current_day'], 'viewweek']),
'name' => $txt['calendar_week'] . ' ' . $context['calendar_grid_main']['week_number']
);
];
}

// Build the calendar button array.
Expand Down Expand Up @@ -274,7 +274,7 @@ public function action_post()
$context['cal_minyear'] = $modSettings['cal_minyear'];
$context['cal_maxyear'] = (int) date('Y') + $modSettings['cal_limityear'];
$context['page_title'] = $event->isNew() ? $txt['calendar_edit'] : $txt['calendar_post_event'];
$context['linktree'][] = [
$context['breadcrumbs'][] = [
'name' => $context['page_title'],
];
}
Expand Down
4 changes: 2 additions & 2 deletions sources/ElkArte/Controller/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,10 @@ public function setMessageContext()
$context['messages_per_page'] = $this->messages_per_page;

// Build the link tree.
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('topic', ['topic' => $this->topicinfo['id_topic'], 'start' => '0', 'subject' => $this->topicinfo['subject']]),
'name' => $this->topicinfo['subject'],
);
];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions sources/ElkArte/Controller/Draft.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ public function action_showPMDrafts()
// Off to the template we go
$context['page_title'] = $txt['drafts'];
$context['sub_template'] = 'showPMDrafts';
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'pm', 'sa' => 'showpmdrafts']),
'name' => $txt['drafts'],
);
];
}
}
8 changes: 4 additions & 4 deletions sources/ElkArte/Controller/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public function pre_dispatch()
{
isAllowedTo('view_mlist');

$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('group', ['action' => 'groups']),
'name' => $txt['groups'],
);
];
}
}

Expand Down Expand Up @@ -273,10 +273,10 @@ public function action_members()
$context['group']['can_moderate'] = allowedTo('manage_membergroups') && (allowedTo('admin_forum') || $context['group']['group_type'] != 1);

// The template is very needy
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('group', ['action' => 'groups', 'sa' => 'members', 'group' => $context['group']['id'], 'name' => $context['group']['name']]),
'name' => $context['group']['name'],
);
];
$context['can_send_email'] = allowedTo('send_email_to_members');
$context['sort_direction'] = isset($this->_req->query->desc) ? 'down' : 'up';
$context['start'] = $this->_req->query->start;
Expand Down
12 changes: 6 additions & 6 deletions sources/ElkArte/Controller/Memberlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ public function action_index()
$context['colspan'] += $column['colspan'] ?? 1;
}

$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => $scripturl . '?action=memberlist',
'name' => $txt['members_list']
);
];

$context['can_send_pm'] = allowedTo('pm_send');

Expand Down Expand Up @@ -364,11 +364,11 @@ public function action_mlall()
$context['end'] = min($start + $modSettings['defaultMaxMembers'], $context['num_members']);
$context['can_moderate_forum'] = allowedTo('moderate_forum');
$context['page_title'] = sprintf($txt['viewing_members'], $context['start'], $context['end']);
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => $scripturl . '?action=memberlist;sort=' . $sort . ';start=' . $start,
'name' => &$context['page_title'],
'extra_after' => ' (' . sprintf($txt['of_total_members'], $context['num_members']) . ')'
);
];

$limit = $start;
$where = '';
Expand Down Expand Up @@ -607,10 +607,10 @@ public function action_mlsearch()
redirectexit('action=memberlist');
}

$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => $scripturl . '?action=memberlist;sa=search',
'name' => &$context['page_title']
);
];

// Highlight the correct button, too!
unset($context['memberlist_buttons']['view_all_members']['active']);
Expand Down
4 changes: 2 additions & 2 deletions sources/ElkArte/Controller/Mentions.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ public function action_list()
createList($list_options);

$context['page_title'] = $txt['my_mentions'] . (empty($this->_page) ? '' : ' - ' . sprintf($txt['my_mentions_pages'], $this->_page));
$context['linktree'][] = [
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'mentions']),
'name' => $txt['my_mentions'],
];

if (!empty($this->_type))
{
$context['linktree'][] = [
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'mentions', 'type' => $this->_type]),
'name' => $txt['mentions_type_' . $this->_type],
];
Expand Down
6 changes: 3 additions & 3 deletions sources/ElkArte/Controller/ModerationCenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ public function prepareModcenter()
$context['admin_area'] = $mod_include_data['current_area'];

// Build the link tree.
$context['linktree'][] = array(
$context['breadcrumbs'][] = array(
'url' => getUrl('action', ['action' => 'moderate']),
'name' => $txt['moderation_center'],
);

if (isset($mod_include_data['current_area']) && $mod_include_data['current_area'] !== 'index')
{
$context['linktree'][] = [
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'moderate', 'area' => $mod_include_data['current_area']]),
'name' => $mod_include_data['label'],
];
Expand All @@ -305,7 +305,7 @@ public function prepareModcenter()
if (!empty($mod_include_data['current_subsection']) && isset($mod_include_data['subsections'][$mod_include_data['current_subsection']]['label'])
&& $mod_include_data['subsections'][$mod_include_data['current_subsection']]['label'] !== $mod_include_data['label'])
{
$context['linktree'][] = [
$context['breadcrumbs'][] = [
'url' => getUrl('action', ['action' => 'moderate', 'area' => $mod_include_data['current_area'], 'sa' => $mod_include_data['current_subsection']]),
'name' => $mod_include_data['subsections'][$mod_include_data['current_subsection']]['label'],
];
Expand Down
8 changes: 4 additions & 4 deletions sources/ElkArte/Controller/MoveTopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ private function _prep_template()
$context['sub_template'] = 'move_topic';

// Breadcrumbs
$context['linktree'][] = array(
$context['breadcrumbs'][] = [
'url' => getUrl('topic', ['topic' => $this->_topic, 'start' => 0, 'subject' => $context['subject']]),
'name' => $context['subject'],
);
$context['linktree'][] = array(
];
$context['breadcrumbs'][] = [
'url' => '#',
'name' => $txt['move_topic'],
);
];

$context['back_to_topic'] = isset($this->_req->post->goback);

Expand Down
Loading

0 comments on commit 9758e91

Please sign in to comment.