Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
anchor-theme
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
tetras-libre
anchor-theme
Commits
172ceb69
Verified
Commit
172ceb69
authored
6 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
New menu
parent
6f997a33
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
css/reset.css
+1
-1
1 addition, 1 deletion
css/reset.css
css/style.css
+1
-1
1 addition, 1 deletion
css/style.css
functions.php
+43
-0
43 additions, 0 deletions
functions.php
header.php
+1
-9
1 addition, 9 deletions
header.php
with
46 additions
and
11 deletions
css/reset.css
+
1
−
1
View file @
172ceb69
...
...
@@ -83,7 +83,7 @@ a {
*/
.wrap
{
min-width
:
280px
;
max-width
:
75
0px
;
max-width
:
90
0px
;
width
:
60%
;
margin
:
0
auto
;
...
...
This diff is collapsed.
Click to expand it.
css/style.css
+
1
−
1
View file @
172ceb69
...
...
@@ -148,10 +148,10 @@ h2{
/**
* Give some extra space to single-page wrappers
*/
.content {
padding: 50px 0px;
}
*/
.content
ul
,
.content
ol
,
.items
li
ul
{
padding
:
20px
30px
;
}
...
...
This diff is collapsed.
Click to expand it.
functions.php
+
43
−
0
View file @
172ceb69
...
...
@@ -120,3 +120,46 @@ function article_img($slug){
echo
'<img class="odd" width="300px" src="'
.
article_img_url
(
$slug
)
.
'.'
.
$ext
.
'" />'
;
}
}
function
print_item
(
$item
,
$class
){
echo
'<li '
.
$class
.
'>'
;
echo
'<a href="'
.
menu_url
(
$item
)
.
'" title="'
.
menu_title
(
$item
)
.
'">'
;
echo
menu_name
(
$item
)
.
' </a></li>'
;
}
function
build_menu
(
$parent
,
$tree
){
foreach
(
$tree
[
$parent
]
as
$i
=>
$item
){
if
(
menu_active
(
$item
)){
$class
=
'class="active"'
;
$expand
=
"true"
;
$collapse
=
"collapse in"
;
}
else
{
$class
=
''
;
$expand
=
'false'
;
$collapse
=
"collapse"
;
}
if
(
array_key_exists
(
$item
->
id
,
$tree
)){
echo
'<li '
.
$class
.
' id="btn'
.
$item
->
id
.
'" data-toggle="collapse" data-target="#submenu'
.
$item
->
id
.
'" aria-expanded="'
.
$expand
.
'"><a href="#" >'
.
menu_name
(
$item
)
.
'</a>'
;
echo
'<ul class="nav navbar-nav '
.
$collapse
.
'" id="submenu'
.
$item
->
id
.
'" role="menu" aria-labelledby="btn'
.
$item
->
id
.
'" >'
;
build_menu
(
$item
->
id
,
$tree
);
echo
'</ul>'
;
echo
'</li>'
;
}
else
{
print_item
(
$item
,
$class
);
}
}
}
function
menu_tree
(){
$tree
=
array
();
while
(
menu_items
()){
$item
=
Registry
::
get
(
'menu_item'
);
$parent
=
$item
->
parent
;
if
(
!
array_key_exists
(
$parent
,
$tree
)){
$tree
[
$parent
]
=
array
();
}
array_push
(
$tree
[
$parent
],
$item
);
}
return
build_menu
(
0
,
$tree
);
}
This diff is collapsed.
Click to expand it.
header.php
+
1
−
9
View file @
172ceb69
...
...
@@ -67,15 +67,7 @@
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav"
>
<?php
if
(
has_menu_items
())
:
while
(
menu_items
())
:
?>
<li
<?php
echo
(
menu_active
()
?
'class="active"'
:
''
);
?>
>
<a
href=
"
<?php
echo
menu_url
();
?>
"
title=
"
<?php
echo
menu_title
();
?>
"
>
<?php
echo
menu_name
();
?>
</a>
</li>
<?php
endwhile
;
endif
;
?>
<?php
echo
menu_tree
();
?>
<li>
<form
id=
"search"
action=
"/search"
method=
"post"
class=
"navbar-form navbar-left"
>
...
...
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