Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
c4a386f1
Commit
c4a386f1
authored
7 years ago
by
Iain Hallam
Browse files
Options
Downloads
Patches
Plain Diff
Added return flags to breadcrumbs and you are here to allow later processing
parent
39f9a58e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/template.php
+36
-23
36 additions, 23 deletions
inc/template.php
with
36 additions
and
23 deletions
inc/template.php
+
36
−
23
View file @
c4a386f1
...
...
@@ -502,8 +502,10 @@ function tpl_link($url, $name, $more = '', $return = false) {
* @param string|null $name the name of the link
* @return bool true
*/
function
tpl_pagelink
(
$id
,
$name
=
null
)
{
print
'<bdi>'
.
html_wikilink
(
$id
,
$name
)
.
'</bdi>'
;
function
tpl_pagelink
(
$id
,
$name
=
null
,
$return
=
false
)
{
$out
=
'<bdi>'
.
html_wikilink
(
$id
,
$name
)
.
'</bdi>'
;
if
(
$return
)
return
$out
;
print
$out
;
return
true
;
}
...
...
@@ -882,33 +884,39 @@ function tpl_searchform($ajax = true, $autocomplete = true) {
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $sep Separator between entries
* @return bool
* @param bool $return return or print
* @return bool|string
*/
function
tpl_breadcrumbs
(
$sep
=
'•'
)
{
function
tpl_breadcrumbs
(
$sep
=
null
,
$return
=
false
)
{
global
$lang
;
global
$conf
;
//check if enabled
if
(
!
$conf
[
'breadcrumbs'
])
return
false
;
//set default
if
(
is_null
(
$sep
))
$sep
=
'•'
;
$out
=
''
;
$crumbs
=
breadcrumbs
();
//setup crumb trace
$crumbs_sep
=
' <span class="bcsep">'
.
$sep
.
'</span> '
;
//render crumbs, highlight the last one
print
'<span class="bchead">'
.
$lang
[
'breadcrumb'
]
.
'</span>'
;
$out
.
=
'<span class="bchead">'
.
$lang
[
'breadcrumb'
]
.
'</span>'
;
$last
=
count
(
$crumbs
);
$i
=
0
;
foreach
(
$crumbs
as
$id
=>
$name
)
{
$i
++
;
echo
$crumbs_sep
;
if
(
$i
==
$last
)
print
'<span class="curid">'
;
print
'<bdi>'
;
tpl_link
(
wl
(
$id
),
hsc
(
$name
),
'class="breadcrumbs" title="'
.
$id
.
'"'
);
print
'</bdi>'
;
if
(
$i
==
$last
)
print
'</span>'
;
$out
.
=
$crumbs_sep
;
if
(
$i
==
$last
)
$out
.
=
'<span class="curid">'
;
$out
.
=
'<bdi>'
.
tpl_link
(
wl
(
$id
),
hsc
(
$name
),
'class="breadcrumbs" title="'
.
$id
.
'"'
,
true
)
.
'</bdi>'
;
if
(
$i
==
$last
)
$out
.
=
'</span>'
;
}
return
true
;
if
(
$return
)
return
$out
;
print
$out
;
return
$out
?
true
:
false
;
}
/**
...
...
@@ -924,9 +932,10 @@ function tpl_breadcrumbs($sep = '•') {
* @todo May behave strangely in RTL languages
*
* @param string $sep Separator between entries
* @return bool
* @param bool $return return or print
* @return bool|string
*/
function
tpl_youarehere
(
$sep
=
' » '
)
{
function
tpl_youarehere
(
$sep
=
null
,
$return
=
false
)
{
global
$conf
;
global
$ID
;
global
$lang
;
...
...
@@ -934,15 +943,18 @@ function tpl_youarehere($sep = ' » ') {
// check if enabled
if
(
!
$conf
[
'youarehere'
])
return
false
;
//set default
if
(
is_null
(
$sep
))
$sep
=
' » '
;
$out
=
''
;
$parts
=
explode
(
':'
,
$ID
);
$count
=
count
(
$parts
);
echo
'<span class="bchead">'
.
$lang
[
'youarehere'
]
.
' </span>'
;
$out
.
=
'<span class="bchead">'
.
$lang
[
'youarehere'
]
.
' </span>'
;
// always print the startpage
echo
'<span class="home">'
;
tpl_pagelink
(
':'
.
$conf
[
'start'
]);
echo
'</span>'
;
$out
.
=
'<span class="home">'
.
tpl_pagelink
(
':'
.
$conf
[
'start'
],
null
,
true
)
.
'</span>'
;
// print intermediate namespace links
$part
=
''
;
...
...
@@ -952,8 +964,7 @@ function tpl_youarehere($sep = ' » ') {
if
(
$page
==
$conf
[
'start'
])
continue
;
// Skip startpage
// output
echo
$sep
;
tpl_pagelink
(
$page
);
$out
.
=
$sep
.
tpl_pagelink
(
$page
,
null
,
true
);
}
// print current page, skipping start page, skipping for namespace index
...
...
@@ -961,9 +972,11 @@ function tpl_youarehere($sep = ' » ') {
if
(
isset
(
$page
)
&&
$page
==
$part
.
$parts
[
$i
])
return
true
;
$page
=
$part
.
$parts
[
$i
];
if
(
$page
==
$conf
[
'start'
])
return
true
;
echo
$sep
;
tpl_pagelink
(
$page
);
return
true
;
$out
.
=
$sep
;
$out
.
=
tpl_pagelink
(
$page
,
null
,
true
);
if
(
$return
)
return
$out
;
print
$out
;
return
$out
?
true
:
false
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment