-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbase.phtml
43 lines (39 loc) · 1.39 KB
/
base.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$modal_enabled = $modal_enabled ?? false;
if ($modal_enabled && $modal_requested) {
$layout_name = 'modal.phtml';
} elseif ($current_user && !$current_user->isBlocked()) {
$layout_name = 'connected.phtml';
} elseif ($current_user) {
$layout_name = 'connected_blocked.phtml';
} else {
$layout_name = 'not_connected.phtml';
}
$default_back_options = [
'title' => $title,
'reset' => false,
'track' => true,
];
$back_options = $back_options ?? [];
$back_options = array_merge($default_back_options, $back_options);
$default_search_options = [
'enabled' => false,
'query' => '',
];
$search_options = $search_options ?? [];
$search_options = array_merge($default_search_options, $search_options);
$this->layout($layout_name, [
// The title can be considered as safe since it's already sanitized in
// the calling view.
'title' => $this->safe('title'),
'current_tab' => $current_tab ?? null,
'current_page' => $current_page ?? null,
'canonical' => $this->safe('canonical'),
'alternates' => $alternates ?? [],
'open_graph' => $open_graph ?? [],
'back_options' => $back_options,
'search_options' => $search_options,
'has_errors' => $has_errors ?? false,
]);
echo $this->safe('content');
?>