Commit 99080ceb authored by Pietro Albini's avatar Pietro Albini

A consistent indentation isn't such a bad thing...

parent dd5f9e65
...@@ -3,23 +3,23 @@ ...@@ -3,23 +3,23 @@
//-------------------------------------------------- //--------------------------------------------------
.page-description { .page-description {
background: none repeat scroll 0 0 $light-grey; background: none repeat scroll 0 0 $light-grey;
border: 1px solid $warm-grey; border: 1px solid $warm-grey;
padding: em-calc(10 10 12); padding: em-calc(10 10 12);
@include rounded-corners; @include rounded-corners;
@include font-size; @include font-size;
line-height: em-calc(22); line-height: em-calc(22);
} }
.middleinfo { .middleinfo {
padding: em-calc(8); padding: em-calc(8);
margin-bottom: em-calc(6); margin-bottom: em-calc(6);
@include rounded-corners; @include rounded-corners;
&.gray { &.gray {
background: $warm-grey; background: $warm-grey;
border: 1px solid $light-grey; border: 1px solid $light-grey;
} }
} }
//-------------------------------------------------- //--------------------------------------------------
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
// Strip unit. // Strip unit.
@function strip-unit( $num ) { @function strip-unit( $num ) {
@return $num / ($num * 0 + 1); @return $num / ($num * 0 + 1);
} }
// Convert to em. // Convert to em.
@function convert-to-em( $value ) { @function convert-to-em( $value ) {
$value: strip-unit( $value ) / strip-unit( $em-base ) * 1em; $value: strip-unit( $value ) / strip-unit( $em-base ) * 1em;
@if ( $value == 0em ) { @if ( $value == 0em ) {
$value: 0; // Turn 0em to 0 $value: 0; // Turn 0em to 0
} }
@return $value; @return $value;
} }
//-------------------------------------------------- //--------------------------------------------------
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
//-------------------------------------------------- //--------------------------------------------------
@function em-calc($values) { @function em-calc($values) {
$max: length($values); $max: length($values);
@if $max == 1 { @if $max == 1 {
@return convert-to-em( nth( $values, 1 ) ); @return convert-to-em( nth( $values, 1 ) );
} }
$em-values: (); $em-values: ();
@for $i from 1 through $max { @for $i from 1 through $max {
$em-values: append( $em-values, convert-to-em( nth( $values, $i ) ) ); $em-values: append( $em-values, convert-to-em( nth( $values, $i ) ) );
} }
@return $em-values; @return $em-values;
} }
\ No newline at end of file
...@@ -5,24 +5,24 @@ ...@@ -5,24 +5,24 @@
*/ */
@mixin transition($transition: all .5s) { @mixin transition($transition: all .5s) {
-webkit-transition:$transition; -webkit-transition:$transition;
-moz-transition:$transition; -moz-transition:$transition;
transition:$transition; transition:$transition;
} }
@mixin placeholder($color) { @mixin placeholder($color) {
&::-webkit-input-placeholder { &::-webkit-input-placeholder {
color: $color; color: $color;
} }
&:-moz-placeholder { // Firefox 18- &:-moz-placeholder { // Firefox 18-
color: $color; color: $color;
} }
&::-moz-placeholder { // Firefox 19+ &::-moz-placeholder { // Firefox 19+
color: $color; color: $color;
} }
&:-ms-input-placeholder { &:-ms-input-placeholder {
color: $color; color: $color;
} }
} }
@mixin box-shadow($shadow) { @mixin box-shadow($shadow) {
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
// Override default text selection color // Override default text selection color
::selection { ::selection {
background:lighten($ubuntu-orange, 10%); background:lighten($ubuntu-orange, 10%);
} }
a { a {
&::selection, &::selection,
& *::selection { & *::selection {
background:$warm-grey; background:$warm-grey;
} }
} }
// Remove unwanted "x"es from search box (webkit and ie) // Remove unwanted "x"es from search box (webkit and ie)
...@@ -26,14 +26,14 @@ input[type="search"]::-webkit-search-results-button, ...@@ -26,14 +26,14 @@ input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; } input[type="search"]::-webkit-search-results-decoration { display: none; }
.logo { .logo {
position:absolute; position:absolute;
top:0; top:0;
left:0; left:0;
z-index:10; z-index:10;
body.toolbar & { body.toolbar & {
top:30px; top:30px;
} }
} }
// Custom background for community pages // Custom background for community pages
...@@ -42,7 +42,7 @@ body.node-type-community-page { ...@@ -42,7 +42,7 @@ body.node-type-community-page {
} }
header.banner { header.banner {
margin-bottom:0; margin-bottom:0;
.nav-primary { .nav-primary {
ul { ul {
li { li {
...@@ -52,94 +52,94 @@ header.banner { ...@@ -52,94 +52,94 @@ header.banner {
} }
} }
&.inverted { &.inverted {
background: $light-grey; background: $light-grey;
margin-bottom:20px; margin-bottom:20px;
margin-top:-4px; // Ugly fix for gap between navbar margin-top:-4px; // Ugly fix for gap between navbar
.nav-primary { .nav-primary {
ul { ul {
border-color:lighten($light-grey, 10%); border-color:lighten($light-grey, 10%);
margin-top:1px; margin-top:1px;
li { li {
&, &:last-child { &, &:last-child {
border-color:darken($light-grey, 5%); border-color:darken($light-grey, 5%);
} }
a { a {
&:link, &:link,
&:visited { &:visited {
border-color:lighten($light-grey, 7%); border-color:lighten($light-grey, 7%);
color:darken($warm-grey, 10%); color:darken($warm-grey, 10%);
} }
&:hover { &:hover {
background:darken($light-grey, 5%); background:darken($light-grey, 5%);
color:lighten($cool-grey, 7%); color:lighten($cool-grey, 7%);
} }
} }
} }
} }
a { a {
&.active, &.active,
&:active { &:active {
border-color:darken($light-grey, 5%); border-color:darken($light-grey, 5%);
background:darken($light-grey, 5%); background:darken($light-grey, 5%);
} }
} }
} }
.header-search { .header-search {
overflow:hidden; overflow:hidden;
// padding:7px 0 7px 14px; // padding:7px 0 7px 14px;
max-width:240px; max-width:240px;
float:right; float:right;
input[type="search"] { input[type="search"] {
@include box-sizing(border-box); @include box-sizing(border-box);
-webkit-appearance:none; -webkit-appearance:none;
float:left; float:left;
display:block; display:block;
@include font-size(16); @include font-size(16);
height:2.1em; height:2.1em;
@include rounded-corners(4px); @include rounded-corners(4px);
width:100%; width:100%;
border:none; border:none;
margin-bottom:0; margin-bottom:0;
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
@include box-shadow(inset 0 1px 4px rgba(0,0,0,.2)); @include box-shadow(inset 0 1px 4px rgba(0,0,0,.2));
@include transition(); // Use defaults @include transition(); // Use defaults
padding:.5em 2.5em .5em .5em; padding:.5em 2.5em .5em .5em;
color:#555; color:#555;
&:focus { &:focus {
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
} }
@include placeholder(#555); @include placeholder(#555);
} }
button[type="submit"] { button[type="submit"] {
padding:3px 2px; padding:3px 2px;
line-height:0; line-height:0;
float:left; float:left;
margin-left:-40px; margin-left:-40px;
display:block; display:block;
background:none; background:none;
overflow:visible; overflow:visible;
} }
} }
} }
.site-name { .site-name {
float:right; float:right;
.logo-ubuntuit { .logo-ubuntuit {
@include font-size(36); @include font-size(36);
margin-bottom:0; margin-bottom:0;
position:relative; position:relative;
text-transform:lowercase; text-transform:lowercase;
margin:0; margin:0;
display:inline-block; display:inline-block;
margin-left:20px; margin-left:20px;
font-weight:300; font-weight:300;
} }
} }
} }
...@@ -28,128 +28,128 @@ ...@@ -28,128 +28,128 @@
* @uses drupal_add_css() * @uses drupal_add_css()
*/ */
function valencia_preprocess_html( &$variables ) { function valencia_preprocess_html( &$variables ) {
/** /**
* Add a cascading stylesheet to the stylesheet queue. * Add a cascading stylesheet to the stylesheet queue.
* *
* Calling drupal_static_reset('drupal_add_css') will clear all cascading stylesheets added so far. * Calling drupal_static_reset('drupal_add_css') will clear all cascading stylesheets added so far.
* *
* If CSS aggregation/compression is enabled, all cascading stylesheets added with $options['preprocess'] * If CSS aggregation/compression is enabled, all cascading stylesheets added with $options['preprocess']
* set to TRUE will be merged into one aggregate file and compressed. Preprocessed inline stylesheets * set to TRUE will be merged into one aggregate file and compressed. Preprocessed inline stylesheets
* will not be aggregated into this single file; instead, they are just compressed upon output on the page. * will not be aggregated into this single file; instead, they are just compressed upon output on the page.
* Externally hosted stylesheets are never aggregated or compressed. * Externally hosted stylesheets are never aggregated or compressed.
* *
* @see drupal_get_css() * @see drupal_get_css()
* @since 1.0.0 * @since 1.0.0
* *
* @param string $data Optional. Stylesheet data to be added, depending on what is passed through the * @param string $data Optional. Stylesheet data to be added, depending on what is passed through the
* $options['type'] parameter. * $options['type'] parameter.
* @param string|array $options { * @param string|array $options {
* String defining the 'type' of CSS that is being added in the $data parameter or an array which can * String defining the 'type' of CSS that is being added in the $data parameter or an array which can
* have any or all the following keys. Optional. * have any or all the following keys. Optional.
* *
* @type string $type The type of stylesheet being added. Default <file>. Accepts <file>, <inline>, <external>. * @type string $type The type of stylesheet being added. Default <file>. Accepts <file>, <inline>, <external>.
* @type string $basename Force a basename for the file being added. * @type string $basename Force a basename for the file being added.
* @type integer $group Number identifying the group in which to add the stylesheet. CSS within higher * @type integer $group Number identifying the group in which to add the stylesheet. CSS within higher
* number group take precedence over CSS within lower number groups. * number group take precedence over CSS within lower number groups.
* Accepts <CSS_SYSTEM>, <CSS_DEFAULT>, <CSS_THEME>. * Accepts <CSS_SYSTEM>, <CSS_DEFAULT>, <CSS_THEME>.
* @type bool $every_page Should be set to TRUE if the stylesheet is present on every page of the website. * @type bool $every_page Should be set to TRUE if the stylesheet is present on every page of the website.
* Default <FALSE>. * Default <FALSE>.
* @type integer $weight CSS order relative to the same group and $every_page. * @type integer $weight CSS order relative to the same group and $every_page.
* @type string $media Media type for the stylesheet. Default <all>. * @type string $media Media type for the stylesheet. Default <all>.
* @type bool $preprocess If TRUE and CSS aggregation/compression is enabled, the styles * @type bool $preprocess If TRUE and CSS aggregation/compression is enabled, the styles
* will be aggregated and compressed. Default <TRUE>. * will be aggregated and compressed. Default <TRUE>.
* @type array $browsers Info specifying which browsers should load the CSS item. * @type array $browsers Info specifying which browsers should load the CSS item.
* @link https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_pre_render_conditional_comments/7 * @link https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_pre_render_conditional_comments/7
* } * }
* @return array Queued cascading stylesheets. * @return array Queued cascading stylesheets.
*/ */
//drupal_add_css('http://assets.ubuntu.com/sites/guidelines/css/responsive/latest/ubuntu-styles.css', array( //drupal_add_css('http://assets.ubuntu.com/sites/guidelines/css/responsive/latest/ubuntu-styles.css', array(
// 'type' => 'external', // 'type' => 'external',
// 'group' => CSS_DEFAULT, // 'group' => CSS_DEFAULT,
// 'every_page' => true // 'every_page' => true
//)); //));
//drupal_add_css('http://assets.ubuntu.com/sites/ubuntu/1160/u/css/styles.css', array( //drupal_add_css('http://assets.ubuntu.com/sites/ubuntu/1160/u/css/styles.css', array(
// 'type' => 'external', // 'type' => 'external',
// 'group' => CSS_DEFAULT, // 'group' => CSS_DEFAULT,
// 'every_page' => true // 'every_page' => true
//)); //));
drupal_add_css( drupal_get_path( 'theme', 'valencia' ) . '/css/style.css', array( drupal_add_css( drupal_get_path( 'theme', 'valencia' ) . '/css/style.css', array(
'type' => 'file', 'type' => 'file',
'group' => CSS_THEME, 'group' => CSS_THEME,
'every_page' => true 'every_page' => true
)); ));
/** /**
* Add JavaScript file, setting, or inline code to the page. * Add JavaScript file, setting, or inline code to the page.
* *
* The behaviour of this function depends on the parameters it is called with. * The behaviour of this function depends on the parameters it is called with.
* Generally, it handles the addition of JavaScript to the page, either as reference * Generally, it handles the addition of JavaScript to the page, either as reference
* to an existing file or as inline code. You can: * to an existing file or as inline code. You can:
* - Add a file ('file') * - Add a file ('file')
* - Add inline JavaScript code ('inline'). Make sure to wrap code in `(function($){})(jQuery);` * - Add inline JavaScript code ('inline'). Make sure to wrap code in `(function($){})(jQuery);`
* - Add external JavaScript ('external') * - Add external JavaScript ('external')
* - Add settings ('setting'). Will be accessible at Drupal.settings * - Add settings ('setting'). Will be accessible at Drupal.settings
* *
* If JavaScript aggregation is enabled, all JavaScript files added with $options['preprocess'] * If JavaScript aggregation is enabled, all JavaScript files added with $options['preprocess']
* set to TRUE will be merged into one aggregate file. Preprocessed inline JavaScript will not be * set to TRUE will be merged into one aggregate file. Preprocessed inline JavaScript will not be
* aggregated into this single file. Externally hosted JavaScripts are never aggregated. * aggregated into this single file. Externally hosted JavaScripts are never aggregated.
* *
* @see drupal_get_js() * @see drupal_get_js()
* @since 1.0.0 * @since 1.0.0
* *
* @param string $data Optional. If given, the value depends on the $options or $options['type'] parameter. * @param string $data Optional. If given, the value depends on the $options or $options['type'] parameter.
* @param string|array $options { * @param string|array $options {
* String defining the type of JavaScript that is being added in the $data parameter (<file>, * String defining the type of JavaScript that is being added in the $data parameter (<file>,
* <setting>, <inline>, <external>), or an associative array. JavaScript settings should always * <setting>, <inline>, <external>), or an associative array. JavaScript settings should always
* pass the string 'setting' only. Other types can have the following elements in the array. Optional. * pass the string 'setting' only. Other types can have the following elements in the array. Optional.
* *
* @type string $type Type of JavaScript. Default <file>. Accepts <file>, <inline>, <external>, <setting>. * @type string $type Type of JavaScript. Default <file>. Accepts <file>, <inline>, <external>, <setting>.
* @type string $scope Location of the script. Can use custom regions. Default <header>. Accepts <header>, <footer>. * @type string $scope Location of the script. Can use custom regions. Default <header>. Accepts <header>, <footer>.
* @type integer $group Number of the JS group. Defines priority (higher first). Accepts <JS_LIBRARY>, <JS_DEFAULT>, * @type integer $group Number of the JS group. Defines priority (higher first). Accepts <JS_LIBRARY>, <JS_DEFAULT>,
* <JS_THEME>. * <JS_THEME>.
* @type bool $every_page If present in every page of the website. Default <FALSE>. * @type bool $every_page If present in every page of the website. Default <FALSE>.
* @type integer $weight Priority relative to the scope, group, and every_page. Higher first. * @type integer $weight Priority relative to the scope, group, and every_page. Higher first.
* @type bool $defer If TRUE, defer attribute is set on the script tag. Default <FALSE>. * @type bool $defer If TRUE, defer attribute is set on the script tag. Default <FALSE>.
* @type bool $cache Cache JS file. Used only when $type references a JS file. Default <TRUE>. * @type bool $cache Cache JS file. Used only when $type references a JS file. Default <TRUE>.
* @type bool $preprocess If TRUE and aggregation is enabled, script file will be aggregated. Default <TRUE>. * @type bool $preprocess If TRUE and aggregation is enabled, script file will be aggregated. Default <TRUE>.
* } * }
* @return array JavaScript file, settings, and inline code, including Drupal defaults. * @return array JavaScript file, settings, and inline code, including Drupal defaults.
*/ */
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/modernizr.2.7.1.js', array( drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/modernizr.2.7.1.js', array(
'type' => 'external', 'type' => 'external',
'group' => JS_LIBRARY, 'group' => JS_LIBRARY,
'every_page' => 'TRUE' 'every_page' => 'TRUE'
)); ));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/yui-combined.min.js', array( drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/yui-combined.min.js', array(
'type' => 'external', 'type' => 'external',
'group' => JS_DEFAULT, 'group' => JS_DEFAULT,
'every_page' => 'TRUE', 'every_page' => 'TRUE',
'scope' => 'footer' 'scope' => 'footer'
)); ));
drupal_add_js("if(!core){ var core = {}; } core.globalPrepend = 'body';", array( drupal_add_js("if(!core){ var core = {}; } core.globalPrepend = 'body';", array(
'type' => 'inline', 'type' => 'inline',
'group' => JS_DEFAULT, 'group' => JS_DEFAULT,
'every_page' => 'TRUE', 'every_page' => 'TRUE',
'scope' => 'footer' 'scope' => 'footer'
)); ));
drupal_add_js('http://assets.ubuntu.com/sites/guidelines/js/responsive/core.js', array( drupal_add_js('http://assets.ubuntu.com/sites/guidelines/js/responsive/core.js', array(
'type' => 'external', 'type' => 'external',
'group' => JS_THEME, 'group' => JS_THEME,
'every_page' => 'TRUE', 'every_page' => 'TRUE',
'scope' => 'footer' 'scope' => 'footer'
)); ));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/respond.min.js', array( drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/respond.min.js', array(
'type' => 'external', 'type' => 'external',
'group' => JS_THEME, 'group' => JS_THEME,
'every_page' => 'TRUE', 'every_page' => 'TRUE',
'scope' => 'footer' 'scope' => 'footer'
)); ));
} }
/** /**
...@@ -185,45 +185,45 @@ function valencia_preprocess_page( &$vars ) { ...@@ -185,45 +185,45 @@ function valencia_preprocess_page( &$vars ) {
* http://drupalcontrib.org/api/drupal/contributions!menu_block!menu_block.module/function/menu_tree_add_active_path/7 * http://drupalcontrib.org/api/drupal/contributions!menu_block!menu_block.module/function/menu_tree_add_active_path/7
*/ */
function menu_tree_add_active_path(&$tree) { function menu_tree_add_active_path(&$tree) {
// Grab any menu item to find the menu_name for this tree. // Grab any menu item to find the menu_name for this tree.
$menu_item = current($tree); $menu_item = current($tree);
$tree_with_trail = menu_tree_page_data($menu_item['link']['menu_name']); $tree_with_trail = menu_tree_page_data($menu_item['link']['menu_name']);
// To traverse the original tree down the active trail, we use a pointer. // To traverse the original tree down the active trail, we use a pointer.
$subtree_pointer = &$tree; $subtree_pointer = &$tree;
// Find each key in the active trail. // Find each key in the active trail.
while ($tree_with_trail) { while ($tree_with_trail) {
foreach ($tree_with_trail as $key => &$value) { foreach ($tree_with_trail as $key => &$value) {
if ($tree_with_trail[$key]['link']['in_active_trail']) { if ($tree_with_trail[$key]['link']['in_active_trail']) {
// Set the active trail info in the original tree. // Set the active trail info in the original tree.
$subtree_pointer[$key]['link']['in_active_trail'] = TRUE; $subtree_pointer[$key]['link']['in_active_trail'] = TRUE;
// Continue in the subtree, if it exists. // Continue in the subtree, if it exists.
$tree_with_trail = &$tree_with_trail[$key]['below']; $tree_with_trail = &$tree_with_trail[$key]['below'];
$subtree_pointer = &$subtree_pointer[$key]['below']; $subtree_pointer = &$subtree_pointer[$key]['below'];
break; break;
} }
else { else {
unset($tree_with_trail[$key]); unset($tree_with_trail[$key]);
} }
} }
} }
} }
/** /**
* Choose which menu create basing on the id * Choose which menu create basing on the id
*/ */
function valencia_links__system_main_menu($vars) { function valencia_links__system_main_menu($vars) {
switch ($vars['id']) { switch ($vars['id']) {
case 'header': case 'header':
return valencia_header_menu($vars); return valencia_header_menu($vars);
case 'subheader': case 'subheader':
return valencia_subheader_menu($vars); return valencia_subheader_menu($vars);
case 'breadcrumb': case 'breadcrumb':
return valencia_breadcrumb_menu($vars); return valencia_breadcrumb_menu($vars);
case 'footer': case 'footer':
return valencia_footer_menu($vars); return valencia_footer_menu($vars);
} }
} }
/** /**
...@@ -265,27 +265,27 @@ function valencia_header_menu($vars) { ...@@ -265,27 +265,27 @@ function valencia_header_menu($vars) {
* We need to print only the submenu of active menu * We need to print only the submenu of active menu
*/ */
function valencia_subheader_menu($vars) { function valencia_subheader_menu($vars) {
// Var with all HTML of the menu // Var with all HTML of the menu
$html = ''; $html = '';
foreach ($vars['links'] as $key => $link) { foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API // To print every menu voice only one, see Drupal API
if (is_numeric($key)) { if (is_numeric($key)) {
// Check for submenu, but only if they are of first level and this // Check for submenu, but only if they are of first level and this
// is the active link // is the active link
if (!empty($link['#below']) && $link['#original_link']['depth'] === '1' && $link['#original_link']['in_active_trail']) { if (!empty($link['#below']) && $link['#original_link']['depth'] === '1' && $link['#original_link']['in_active_trail']) {
// If there is a submenu create it using the header function, // If there is a submenu create it using the header function,
// because they have the same struct // because they have the same struct
$sub_menu = theme('links__system_main_menu', array( $sub_menu = theme('links__system_main_menu', array(
'links' => $link['#below'], 'links' => $link['#below'],
'id' => 'header' 'id' => 'header'
)); ));
$html .= $sub_menu; $html .= $sub_menu;
} }
} }
} }
return $html; return $html;
} }
/** /**
...@@ -371,31 +371,31 @@ function valencia_breadcrumb_menu($vars) { ...@@ -371,31 +371,31 @@ function valencia_breadcrumb_menu($vars) {
* active link, the second element is the html of third level menu * active link, the second element is the html of third level menu
*/ */
function valencia_third_level_menu($vars) { function valencia_third_level_menu($vars) {
// Var with all HTML // Var with all HTML
$html = '<ul class="third-level">'; $html = '<ul class="third-level">';
// This becomes TRUE if there is an active link // This becomes TRUE if there is an active link
$has_active_link = FALSE; $has_active_link = FALSE;
foreach ($vars as $key => $link) { foreach ($vars as $key => $link) {
// See Drupal API, is to print every menu voice only one // See Drupal API, is to print every menu voice only one
if (is_numeric($key)) { if (is_numeric($key)) {
if ($link['#original_link']['in_active_trail']) { if ($link['#original_link']['in_active_trail']) {
$has_active_link = TRUE; $has_active_link = TRUE;
$link_title = $link['#title']; $link_title = $link['#title'];
$link_href = $link['#href']; $link_href = $link['#href'];
$html .= '<li class="active">' . l($link_title, $link_href, array('html' => 'true')) . '</li>'; $html .= '<li class="active">' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
} }
else { else {
$link_title = $link['#title']; $link_title = $link['#title'];
$link_href = $link['#href']; $link_href = $link['#href'];
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>'; $html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
} }
} }
} }
$html .= '</ul>'; $html .= '</ul>';
return array($has_active_link, $html); return array($has_active_link, $html);
} }
/** /**
...@@ -471,34 +471,34 @@ if ( !function_exists( 'region_empty' ) ) : ...@@ -471,34 +471,34 @@ if ( !function_exists( 'region_empty' ) ) :
* @return bool. True if empty, false otherwise. * @return bool. True if empty, false otherwise.
*/ */
function region_empty( $region ) { function region_empty( $region ) {
$empty = 1; $empty = 1;
$result = db_query_range( 'SELECT n.pages, n.visibility FROM {blocks} n WHERE n.region="%s" AND n.theme="%s"', $region, $GLOBALS['theme'], 0, 10 ); $result = db_query_range( 'SELECT n.pages, n.visibility FROM {blocks} n WHERE n.region="%s" AND n.theme="%s"', $region, $GLOBALS['theme'], 0, 10 );
if ( count($result) > 0 ) { if ( count($result) > 0 ) {
while ( $node = db_fetch_object($result) ) { while ( $node = db_fetch_object($result) ) {
if ( $node->visibility < 2 ) { if ( $node->visibility < 2 ) {
$path = drupal_get_path_alias($_GET['q']); $path = drupal_get_path_alias($_GET['q']);
// Compare with the internal and path alias (if any) // Compare with the internal and path alias (if any)
$page_match = drupal_match_path($path, $node->pages); $page_match = drupal_match_path($path, $node->pages);
if ( $path != $_GET['q'] ) if ( $path != $_GET['q'] )
$page_match = $page_match || drupal_match_path( $_GET['q'], $node->pages ); $page_match = $page_match || drupal_match_path( $_GET['q'], $node->pages );
/** /**
* When $block->visibility has a value of 0, the block is displayed on * When $block->visibility has a value of 0, the block is displayed on
* all pages except those listed in $block->pages. When set to 1, it * all pages except those listed in $block->pages. When set to 1, it
* is displayed only on those pages listed in $block->pages. * is displayed only on those pages listed in $block->pages.
*/ */
$page_match = !( $node->visibility xor $page_match ); $page_match = !( $node->visibility xor $page_match );
} else { } else {
$page_match = drupal_eval( $block->pages ); $page_match = drupal_eval( $block->pages );
} }
if ( $page_match ) if ( $page_match )
$empty = 0; $empty = 0;
} }
} }
return $empty; return $empty;
} }
endif; endif;
...@@ -42,21 +42,24 @@ ...@@ -42,21 +42,24 @@
* *
* @ingroup themeable * @ingroup themeable
*/ */
?><!DOCTYPE html> ?>
<!DOCTYPE html>
<html lang="<?php print $language->language; ?>"> <html lang="<?php print $language->language; ?>">
<head profile="<?php print $grddl_profile; ?>"> <head profile="<?php print $grddl_profile; ?>">
<?php print $head; ?> <?php print $head; ?>
<title><?php print $head_title; ?></title> <title><?php print $head_title; ?></title>
<?php print $styles; ?> <?php print $styles; ?>
<?php print $scripts; ?> <?php print $scripts; ?>
</head> </head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<div id="skip-link"> <body class="<?php print $classes; ?>" <?php print $attributes;?>>
<a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a> <div id="skip-link">
</div> <a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a>
<?php print $page_top; ?> </div>
<?php print $page; ?> <?php print $page_top; ?>
<?php print $page_bottom; ?> <?php print $page; ?>
</body> <?php print $page_bottom; ?>
</body>
</html> </html>
...@@ -75,37 +75,38 @@ ...@@ -75,37 +75,38 @@
*/ */
?> ?>
<header class="banner global" role="banner"> <header class="banner global" role="banner">
<nav class="nav-primary" role="navigation"> <nav class="nav-primary" role="navigation">
<?php print theme('links__system_main_menu', array( <?php print theme('links__system_main_menu', array(
'links' => $valencia_menu, 'links' => $valencia_menu,
'id' => 'header' 'id' => 'header'
));?> ));?>
<div class="site-name"> <div class="site-name">
<a class="logo-ubuntuit" href="<?php print $front_page; ?>"> <a class="logo-ubuntuit" href="<?php print $front_page; ?>">
<span>ubuntu-it</span> <span>ubuntu-it</span>
</a> </a>
</div> </div>
</nav> </nav>
</header> </header>
<header class="banner global inverted" role="banner"> <header class="banner global inverted" role="banner">
<nav class="nav-primary nav-left" role="navigation"> <nav class="nav-primary nav-left" role="navigation">
<?php print theme('links__system_main_menu', array( <?php print theme('links__system_main_menu', array(
'links' => $valencia_menu, 'links' => $valencia_menu,
'id' => 'subheader' 'id' => 'subheader'
));?> ));?>
<form action="/search" id="search-form" class="header-search"> <form action="/search" id="search-form" class="header-search">
<input type="search" maxlength="255" name="q" id="edit-keys" class="form-text" placeholder="Cerca&hellip;" value="" /> <input type="search" maxlength="255" name="q" id="edit-keys" class="form-text" placeholder="Cerca&hellip;" value="" />
<button type="submit"> <button type="submit">
<img src="http://assets.ubuntu.com/sites/ubuntu/1044/u/img/search-black.svg" alt="Search" height="28" /> <img src="http://assets.ubuntu.com/sites/ubuntu/1044/u/img/search-black.svg" alt="Search" height="28" />
</button> </button>
</form> </form>
</nav> </nav>
</header> </header>
<div class="wrapper"> <div class="wrapper">
<div id="main-content" class="inner-wrapper"> <div id="main-content" class="inner-wrapper">
<?php print $messages; // Error messages ?> <?php print $messages; // Error messages ?>
<nav role="navigation" class="nav-secondary clearfix"> <nav role="navigation" class="nav-secondary clearfix">
<?php print theme('links__system_main_menu', array( <?php print theme('links__system_main_menu', array(
...@@ -114,37 +115,42 @@ ...@@ -114,37 +115,42 @@
));?> ));?>
</nav> </nav>
<div id="main-wrapper"><div id="main" class="clearfix"> <div id="main-wrapper">
<div id="main" class="clearfix">
<div id="content" class="column"><div class="section"> <div id="content" class="column">
<a id="main-content"></a> <div class="section">
<?php if ($title): ?><h1 class="row" id="page-title"><?php print $title; ?></h1><?php endif; ?> <a id="main-content"></a>
<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?> <?php if ($title): ?><h1 class="row" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php print render($page['help']); ?> <?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?> <?php print render($page['help']); ?>
<?php print render($page['content']); ?> <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
<?php print $feed_icons; ?> <?php print render($page['content']); ?>
</div></div> <!-- /.section, /#content --> <?php print $feed_icons; ?>
</div>
</div>
</div></div> <!-- /#main, /#main-wrapper --> </div>
</div>
</div></div> <!-- /#main-content, /.wrapper --> </div>
</div>
<footer class="global clearfix"> <footer class="global clearfix">
<nav role="navigation"> <nav role="navigation">
<div class="footer-a"> <div class="footer-a">
<div class="clearfix"> <div class="clearfix">
<?php print theme('links__system_main_menu', array( <?php print theme('links__system_main_menu', array(
'links' => $valencia_menu, 'links' => $valencia_menu,
'id' => 'footer' 'id' => 'footer'
));?> ));?>
</div> </div> <!-- /.clearfix, /.footer-a --> </div>
<div class="legal clearfix"> </div>
<p class="twelve-col">&copy; Ubuntu e Canonical sono marchi registrati da Canonical Ltd.</p> <div class="legal clearfix">
<p class="twelve-col">Sito realizzato con &hearts; dal Gruppo Web di ubuntu-it, con <a href="http://drupal.org" target="_blank">Drupal</a> e <a href="http://www.postgresql.org/" target="_blank">PostgreSQL</a>.</p> <p class="twelve-col">&copy; Ubuntu e Canonical sono marchi registrati da Canonical Ltd.</p>
<p class="twelve-col"><a href="http://code.ubuntu-it.org/ubuntu-it-web/valencia/issues" target="_blank">Segnala un errore</a> | <a href="http://code.ubuntu-it.org/ubuntu-it-web/www-test" target="_blank">Scarica il codice</a> | <a href="http://wiki.ubuntu-it.org/GruppoWeb/Contribuire" target="_blank">Collabora con noi</a> <p class="twelve-col">
</div> <!-- /.legal .clearfix --> Sito realizzato con &hearts; dal Gruppo Web di ubuntu-it, con <a href="http://drupal.org" target="_blank">Drupal</a> e <a href="http://www.postgresql.org/" target="_blank">PostgreSQL</a>.
<span class="accessibility-aid"><a href="#">Got to the top of the page</a></span> </p>
</nav> <!-- /nav --> <p class="twelve-col"><a href="http://code.ubuntu-it.org/ubuntu-it-web/valencia/issues" target="_blank">Segnala un errore</a> | <a href="http://code.ubuntu-it.org/ubuntu-it-web/www-test" target="_blank">Scarica il codice</a> | <a href="http://wiki.ubuntu-it.org/GruppoWeb/Contribuire" target="_blank">Collabora con noi</a>
</footer> <!-- /footer --> </div>
<span class="accessibility-aid"><a href="#">Got to the top of the page</a></span>
</nav>
</footer>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment