Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
valencia
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
valencia
Commits
8e3dc772
Commit
8e3dc772
authored
Jun 02, 2014
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function to manage header menu
parent
ed30fd02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
30 deletions
+54
-30
template.php
template.php
+23
-0
tpl/page.tpl.php
tpl/page.tpl.php
+31
-30
No files found.
template.php
View file @
8e3dc772
...
...
@@ -126,11 +126,34 @@ function valencia_preprocess_page( &$vars ) {
*/
function
valencia_links__system_main_menu
(
$vars
)
{
switch
(
$vars
[
'id'
])
{
case
'header'
:
return
valencia_header_menu
(
$vars
);
case
'footer'
:
return
valencia_footer_menu
(
$vars
);
}
}
/**
* Custom links for header menu
* Follows http://design.ubuntu.com/web-style-guide/scaffolding#navigation
*/
function
valencia_header_menu
(
$vars
)
{
// Var with all HTML of the menu
$html
=
'<ul>'
;
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
// To print every menu voice only one, see Drupal API
if
(
is_numeric
(
$key
))
{
$link_title
=
$link
[
'#title'
];
$link_href
=
$link
[
'#href'
];
$html
.=
'<li>'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
'</li>'
;
}
}
$html
.=
'</ul>'
;
return
$html
;
}
/**
* Custom links for footer menu
* Follows http://design.ubuntu.com/web-style-guide/scaffolding#footer
...
...
tpl/page.tpl.php
View file @
8e3dc772
...
...
@@ -77,37 +77,38 @@
?>
<?php
if
(
$logo
)
:
?>
<div
class=
"logo"
>
<a
class=
"logo-ubuntu"
href=
"
<?php
print
$front_page
;
?>
"
title=
"
<?php
print
t
(
'Home'
);
?>
"
rel=
"home"
id=
"logo"
>
<img
src=
"
<?php
print
$logo
;
?>
"
width=
"134"
height=
"96"
alt=
"
<?php
print
t
(
'Home'
);
?>
"
>
</a>
</div>
<div
class=
"logo"
>
<a
class=
"logo-ubuntu"
href=
"
<?php
print
$front_page
;
?>
"
title=
"
<?php
print
t
(
'Home'
);
?>
"
rel=
"home"
id=
"logo"
>
<img
src=
"
<?php
print
$logo
;
?>
"
width=
"134"
height=
"96"
alt=
"
<?php
print
t
(
'Home'
);
?>
"
>
</a>
</div>
<?php
endif
;
?>
<header
class=
"banner global"
role=
"banner"
>
<nav
class=
"nav-primary"
role=
"navigation"
>
<ul>
<li><a
href=
"#"
>
Something
</a></li>
</ul>
<div
class=
"site-name"
>
<a
class=
"logo-ubuntuit"
href=
"
<?php
print
$front_page
;
?>
"
>
<span>
ubuntu-it
</span>
</a>
</div>
</nav>
</header>
<header
class=
"banner global inverted"
role=
"banner"
>
<nav
class=
"nav-primary nav-left"
role=
"navigation"
>
<ul>
<li><a
href=
"#"
>
Somewhere
</a></li>
</ul>
<form
action=
"/search"
id=
"search-form"
class=
"header-search"
>
<input
type=
"search"
maxlength=
"255"
name=
"q"
id=
"edit-keys"
class=
"form-text"
placeholder=
"Cerca…"
value=
""
/>
<button
type=
"submit"
>
<img
src=
"http://assets.ubuntu.com/sites/ubuntu/1044/u/img/search-black.svg"
alt=
"Search"
height=
"28"
/>
</button>
</form>
</nav>
</header>
<header
class=
"banner global"
role=
"banner"
>
<nav
class=
"nav-primary"
role=
"navigation"
>
<?php
print
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$valencia_menu
,
'id'
=>
'header'
));
?>
<div
class=
"site-name"
>
<a
class=
"logo-ubuntuit"
href=
"
<?php
print
$front_page
;
?>
"
>
<span>
ubuntu-it
</span>
</a>
</div>
</nav>
</header>
<header
class=
"banner global inverted"
role=
"banner"
>
<nav
class=
"nav-primary nav-left"
role=
"navigation"
>
<ul>
<li><a
href=
"#"
>
Somewhere
</a></li>
</ul>
<form
action=
"/search"
id=
"search-form"
class=
"header-search"
>
<input
type=
"search"
maxlength=
"255"
name=
"q"
id=
"edit-keys"
class=
"form-text"
placeholder=
"Cerca…"
value=
""
/>
<button
type=
"submit"
>
<img
src=
"http://assets.ubuntu.com/sites/ubuntu/1044/u/img/search-black.svg"
alt=
"Search"
height=
"28"
/>
</button>
</form>
</nav>
</header>
<div
class=
"wrapper"
><div
id=
"page"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment