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 @@
//--------------------------------------------------
.page-description {
background: none repeat scroll 0 0 $light-grey;
border: 1px solid $warm-grey;
padding: em-calc(10 10 12);
@include rounded-corners;
@include font-size;
line-height: em-calc(22);
background: none repeat scroll 0 0 $light-grey;
border: 1px solid $warm-grey;
padding: em-calc(10 10 12);
@include rounded-corners;
@include font-size;
line-height: em-calc(22);
}
.middleinfo {
padding: em-calc(8);
margin-bottom: em-calc(6);
@include rounded-corners;
padding: em-calc(8);
margin-bottom: em-calc(6);
@include rounded-corners;
&.gray {
background: $warm-grey;
border: 1px solid $light-grey;
}
&.gray {
background: $warm-grey;
border: 1px solid $light-grey;
}
}
//--------------------------------------------------
......
......@@ -4,16 +4,16 @@
// Strip unit.
@function strip-unit( $num ) {
@return $num / ($num * 0 + 1);
@return $num / ($num * 0 + 1);
}
// Convert to em.
@function convert-to-em( $value ) {
$value: strip-unit( $value ) / strip-unit( $em-base ) * 1em;
@if ( $value == 0em ) {
$value: 0; // Turn 0em to 0
}
@return $value;
$value: strip-unit( $value ) / strip-unit( $em-base ) * 1em;
@if ( $value == 0em ) {
$value: 0; // Turn 0em to 0
}
@return $value;
}
//--------------------------------------------------
......@@ -32,15 +32,15 @@
//--------------------------------------------------
@function em-calc($values) {
$max: length($values);
$max: length($values);
@if $max == 1 {
@return convert-to-em( nth( $values, 1 ) );
}
@if $max == 1 {
@return convert-to-em( nth( $values, 1 ) );
}
$em-values: ();
@for $i from 1 through $max {
$em-values: append( $em-values, convert-to-em( nth( $values, $i ) ) );
}
@return $em-values;
$em-values: ();
@for $i from 1 through $max {
$em-values: append( $em-values, convert-to-em( nth( $values, $i ) ) );
}
@return $em-values;
}
\ No newline at end of file
......@@ -5,24 +5,24 @@
*/
@mixin transition($transition: all .5s) {
-webkit-transition:$transition;
-moz-transition:$transition;
transition:$transition;
-webkit-transition:$transition;
-moz-transition:$transition;
transition:$transition;
}
@mixin placeholder($color) {
&::-webkit-input-placeholder {
color: $color;
}
&:-moz-placeholder { // Firefox 18-
color: $color;
}
&::-moz-placeholder { // Firefox 19+
color: $color;
}
&:-ms-input-placeholder {
color: $color;
}
&::-webkit-input-placeholder {
color: $color;
}
&:-moz-placeholder { // Firefox 18-
color: $color;
}
&::-moz-placeholder { // Firefox 19+
color: $color;
}
&:-ms-input-placeholder {
color: $color;
}
}
@mixin box-shadow($shadow) {
......
......@@ -8,13 +8,13 @@
// Override default text selection color
::selection {
background:lighten($ubuntu-orange, 10%);
background:lighten($ubuntu-orange, 10%);
}
a {
&::selection,
& *::selection {
background:$warm-grey;
}
&::selection,
& *::selection {
background:$warm-grey;
}
}
// Remove unwanted "x"es from search box (webkit and ie)
......@@ -26,14 +26,14 @@ input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }
.logo {
position:absolute;
top:0;
left:0;
z-index:10;
position:absolute;
top:0;
left:0;
z-index:10;
body.toolbar & {
top:30px;
}
body.toolbar & {
top:30px;
}
}
// Custom background for community pages
......@@ -42,7 +42,7 @@ body.node-type-community-page {
}
header.banner {
margin-bottom:0;
margin-bottom:0;
.nav-primary {
ul {
li {
......@@ -52,94 +52,94 @@ header.banner {
}
}
&.inverted {
background: $light-grey;
margin-bottom:20px;
margin-top:-4px; // Ugly fix for gap between navbar
&.inverted {
background: $light-grey;
margin-bottom:20px;
margin-top:-4px; // Ugly fix for gap between navbar
.nav-primary {
ul {
border-color:lighten($light-grey, 10%);
margin-top:1px;
.nav-primary {
ul {
border-color:lighten($light-grey, 10%);
margin-top:1px;
li {
&, &:last-child {
border-color:darken($light-grey, 5%);
}
a {
&:link,
&:visited {
border-color:lighten($light-grey, 7%);
color:darken($warm-grey, 10%);
}
&:hover {
background:darken($light-grey, 5%);
color:lighten($cool-grey, 7%);
}
}
}
}
a {
&.active,
&:active {
border-color:darken($light-grey, 5%);
background:darken($light-grey, 5%);
}
}
}
li {
&, &:last-child {
border-color:darken($light-grey, 5%);
}
a {
&:link,
&:visited {
border-color:lighten($light-grey, 7%);
color:darken($warm-grey, 10%);
}
&:hover {
background:darken($light-grey, 5%);
color:lighten($cool-grey, 7%);
}
}
}
}
a {
&.active,
&:active {
border-color:darken($light-grey, 5%);
background:darken($light-grey, 5%);
}
}
}
.header-search {
overflow:hidden;
// padding:7px 0 7px 14px;
max-width:240px;
float:right;
.header-search {
overflow:hidden;
// padding:7px 0 7px 14px;
max-width:240px;
float:right;
input[type="search"] {
@include box-sizing(border-box);
-webkit-appearance:none;
float:left;
display:block;
@include font-size(16);
height:2.1em;
@include rounded-corners(4px);
width:100%;
border:none;
margin-bottom:0;
background-color: rgba(0, 0, 0, 0);
@include box-shadow(inset 0 1px 4px rgba(0,0,0,.2));
@include transition(); // Use defaults
padding:.5em 2.5em .5em .5em;
color:#555;
input[type="search"] {
@include box-sizing(border-box);
-webkit-appearance:none;
float:left;
display:block;
@include font-size(16);
height:2.1em;
@include rounded-corners(4px);
width:100%;
border:none;
margin-bottom:0;
background-color: rgba(0, 0, 0, 0);
@include box-shadow(inset 0 1px 4px rgba(0,0,0,.2));
@include transition(); // Use defaults
padding:.5em 2.5em .5em .5em;
color:#555;
&:focus {
background: rgba(0, 0, 0, 0.05);
}
&:focus {
background: rgba(0, 0, 0, 0.05);
}
@include placeholder(#555);
}
button[type="submit"] {
padding:3px 2px;
line-height:0;
float:left;
margin-left:-40px;
display:block;
background:none;
overflow:visible;
}
}
}
@include placeholder(#555);
}
button[type="submit"] {
padding:3px 2px;
line-height:0;
float:left;
margin-left:-40px;
display:block;
background:none;
overflow:visible;
}
}
}
.site-name {
float:right;
.logo-ubuntuit {
@include font-size(36);
margin-bottom:0;
position:relative;
text-transform:lowercase;
margin:0;
display:inline-block;
margin-left:20px;
font-weight:300;
}
}
.site-name {
float:right;
.logo-ubuntuit {
@include font-size(36);
margin-bottom:0;
position:relative;
text-transform:lowercase;
margin:0;
display:inline-block;
margin-left:20px;
font-weight:300;
}
}
}
......@@ -28,128 +28,128 @@
* @uses drupal_add_css()
*/
function valencia_preprocess_html( &$variables ) {
/**
* Add a cascading stylesheet to the stylesheet queue.
*
* 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']
* 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.
* Externally hosted stylesheets are never aggregated or compressed.
*
* @see drupal_get_css()
* @since 1.0.0
*
* @param string $data Optional. Stylesheet data to be added, depending on what is passed through the
* $options['type'] parameter.
* @param string|array $options {
* 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.
*
* @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 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.
* 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.
* Default <FALSE>.
* @type integer $weight CSS order relative to the same group and $every_page.
* @type string $media Media type for the stylesheet. Default <all>.
* @type bool $preprocess If TRUE and CSS aggregation/compression is enabled, the styles
* will be aggregated and compressed. Default <TRUE>.
* @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
* }
* @return array Queued cascading stylesheets.
*/
//drupal_add_css('http://assets.ubuntu.com/sites/guidelines/css/responsive/latest/ubuntu-styles.css', array(
// 'type' => 'external',
// 'group' => CSS_DEFAULT,
// 'every_page' => true
//));
//drupal_add_css('http://assets.ubuntu.com/sites/ubuntu/1160/u/css/styles.css', array(
// 'type' => 'external',
// 'group' => CSS_DEFAULT,
// 'every_page' => true
//));
/**
* Add a cascading stylesheet to the stylesheet queue.
*
* 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']
* 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.
* Externally hosted stylesheets are never aggregated or compressed.
*
* @see drupal_get_css()
* @since 1.0.0
*
* @param string $data Optional. Stylesheet data to be added, depending on what is passed through the
* $options['type'] parameter.
* @param string|array $options {
* 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.
*
* @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 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.
* 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.
* Default <FALSE>.
* @type integer $weight CSS order relative to the same group and $every_page.
* @type string $media Media type for the stylesheet. Default <all>.
* @type bool $preprocess If TRUE and CSS aggregation/compression is enabled, the styles
* will be aggregated and compressed. Default <TRUE>.
* @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
* }
* @return array Queued cascading stylesheets.
*/
//drupal_add_css('http://assets.ubuntu.com/sites/guidelines/css/responsive/latest/ubuntu-styles.css', array(
// 'type' => 'external',
// 'group' => CSS_DEFAULT,
// 'every_page' => true
//));
//drupal_add_css('http://assets.ubuntu.com/sites/ubuntu/1160/u/css/styles.css', array(
// 'type' => 'external',
// 'group' => CSS_DEFAULT,
// 'every_page' => true
//));
drupal_add_css( drupal_get_path( 'theme', 'valencia' ) . '/css/style.css', array(
'type' => 'file',
'group' => CSS_THEME,
'every_page' => true
));
/**
* Add JavaScript file, setting, or inline code to the page.
*
* 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
* to an existing file or as inline code. You can:
* - Add a file ('file')
* - Add inline JavaScript code ('inline'). Make sure to wrap code in `(function($){})(jQuery);`
* - Add external JavaScript ('external')
* - Add settings ('setting'). Will be accessible at Drupal.settings
*
* 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
* aggregated into this single file. Externally hosted JavaScripts are never aggregated.
*
* @see drupal_get_js()
* @since 1.0.0
*
* @param string $data Optional. If given, the value depends on the $options or $options['type'] parameter.
* @param string|array $options {
* 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
* 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 $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>,
* <JS_THEME>.
* @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 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 $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.
*/
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/modernizr.2.7.1.js', array(
'type' => 'external',
'group' => JS_LIBRARY,
'every_page' => 'TRUE'
));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/yui-combined.min.js', array(
'type' => 'external',
'group' => JS_DEFAULT,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js("if(!core){ var core = {}; } core.globalPrepend = 'body';", array(
'type' => 'inline',
'group' => JS_DEFAULT,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js('http://assets.ubuntu.com/sites/guidelines/js/responsive/core.js', array(
'type' => 'external',
'group' => JS_THEME,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/respond.min.js', array(
'type' => 'external',
'group' => JS_THEME,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_css( drupal_get_path( 'theme', 'valencia' ) . '/css/style.css', array(
'type' => 'file',
'group' => CSS_THEME,
'every_page' => true
));
/**
* Add JavaScript file, setting, or inline code to the page.
*
* 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
* to an existing file or as inline code. You can:
* - Add a file ('file')
* - Add inline JavaScript code ('inline'). Make sure to wrap code in `(function($){})(jQuery);`
* - Add external JavaScript ('external')
* - Add settings ('setting'). Will be accessible at Drupal.settings
*
* 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
* aggregated into this single file. Externally hosted JavaScripts are never aggregated.
*
* @see drupal_get_js()
* @since 1.0.0
*
* @param string $data Optional. If given, the value depends on the $options or $options['type'] parameter.
* @param string|array $options {
* 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
* 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 $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>,
* <JS_THEME>.
* @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 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 $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.
*/
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/modernizr.2.7.1.js', array(
'type' => 'external',
'group' => JS_LIBRARY,
'every_page' => 'TRUE'
));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/yui-combined.min.js', array(
'type' => 'external',
'group' => JS_DEFAULT,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js("if(!core){ var core = {}; } core.globalPrepend = 'body';", array(
'type' => 'inline',
'group' => JS_DEFAULT,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js('http://assets.ubuntu.com/sites/guidelines/js/responsive/core.js', array(
'type' => 'external',
'group' => JS_THEME,
'every_page' => 'TRUE',
'scope' => 'footer'
));
drupal_add_js('http://assets.ubuntu.com/sites/ubuntu/1160/u/js/plugins/respond.min.js', array(
'type' => 'external',
'group' => JS_THEME,
'every_page' => 'TRUE',
'scope' => 'footer'
));
}
/**
......@@ -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
*/
function menu_tree_add_active_path(&$tree) {
// Grab any menu item to find the menu_name for this tree.
$menu_item = current($tree);
$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.
$subtree_pointer = &$tree;
// Find each key in the active trail.
while ($tree_with_trail) {
foreach ($tree_with_trail as $key => &$value) {
if ($tree_with_trail[$key]['link']['in_active_trail']) {
// Set the active trail info in the original tree.
$subtree_pointer[$key]['link']['in_active_trail'] = TRUE;
// Continue in the subtree, if it exists.
$tree_with_trail = &$tree_with_trail[$key]['below'];
$subtree_pointer = &$subtree_pointer[$key]['below'];
break;
}
else {
unset($tree_with_trail[$key]);
}
}
}
// Grab any menu item to find the menu_name for this tree.
$menu_item = current($tree);
$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.
$subtree_pointer = &$tree;
// Find each key in the active trail.
while ($tree_with_trail) {
foreach ($tree_with_trail as $key => &$value) {
if ($tree_with_trail[$key]['link']['in_active_trail']) {
// Set the active trail info in the original tree.
$subtree_pointer[$key]['link']['in_active_trail'] = TRUE;
// Continue in the subtree, if it exists.
$tree_with_trail = &$tree_with_trail[$key]['below'];
$subtree_pointer = &$subtree_pointer[$key]['below'];
break;
}
else {
unset($tree_with_trail[$key]);
}
}
}
}
/**
* Choose which menu create basing on the id
*/
function valencia_links__system_main_menu($vars) {
switch ($vars['id']) {
case 'header':
return valencia_header_menu($vars);
case 'subheader':
return valencia_subheader_menu($vars);
case 'breadcrumb':
return valencia_breadcrumb_menu($vars);
case 'footer':
return valencia_footer_menu($vars);
}
switch ($vars['id']) {
case 'header':
return valencia_header_menu($vars);
case 'subheader':
return valencia_subheader_menu($vars);
case 'breadcrumb':
return valencia_breadcrumb_menu($vars);
case 'footer':
return valencia_footer_menu($vars);
}
}
/**
......@@ -265,27 +265,27 @@ function valencia_header_menu($vars) {
* We need to print only the submenu of active menu
*/
function valencia_subheader_menu($vars) {
// Var with all HTML of the menu
$html = '';
foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API
if (is_numeric($key)) {
// Check for submenu, but only if they are of first level and this
// is the active link
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,
// because they have the same struct
$sub_menu = theme('links__system_main_menu', array(
'links' => $link['#below'],
'id' => 'header'
));
$html .= $sub_menu;
}
}
}
return $html;
// Var with all HTML of the menu
$html = '';
foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API
if (is_numeric($key)) {
// Check for submenu, but only if they are of first level and this
// is the active link
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,
// because they have the same struct
$sub_menu = theme('links__system_main_menu', array(
'links' => $link['#below'],
'id' => 'header'
));
$html .= $sub_menu;
}
}
}
return $html;
}
/**
......@@ -371,31 +371,31 @@ function valencia_breadcrumb_menu($vars) {
* active link, the second element is the html of third level menu
*/
function valencia_third_level_menu($vars) {
// Var with all HTML
$html = '<ul class="third-level">';
// This becomes TRUE if there is an active link
$has_active_link = FALSE;
foreach ($vars as $key => $link) {
// See Drupal API, is to print every menu voice only one
if (is_numeric($key)) {
if ($link['#original_link']['in_active_trail']) {
$has_active_link = TRUE;
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li class="active">' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
else {
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
}
}
$html .= '</ul>';
return array($has_active_link, $html);
// Var with all HTML
$html = '<ul class="third-level">';
// This becomes TRUE if there is an active link
$has_active_link = FALSE;
foreach ($vars as $key => $link) {
// See Drupal API, is to print every menu voice only one
if (is_numeric($key)) {
if ($link['#original_link']['in_active_trail']) {
$has_active_link = TRUE;
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li class="active">' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
else {
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
}
}
$html .= '</ul>';
return array($has_active_link, $html);
}
/**
......@@ -471,34 +471,34 @@ if ( !function_exists( 'region_empty' ) ) :
* @return bool. True if empty, false otherwise.
*/
function region_empty( $region ) {
$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 );
if ( count($result) > 0 ) {
while ( $node = db_fetch_object($result) ) {
if ( $node->visibility < 2 ) {
$path = drupal_get_path_alias($_GET['q']);
// Compare with the internal and path alias (if any)
$page_match = drupal_match_path($path, $node->pages);
if ( $path != $_GET['q'] )
$page_match = $page_match || drupal_match_path( $_GET['q'], $node->pages );
/**
* 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
* is displayed only on those pages listed in $block->pages.
*/
$page_match = !( $node->visibility xor $page_match );
} else {
$page_match = drupal_eval( $block->pages );
}
if ( $page_match )
$empty = 0;
}
}
return $empty;
$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 );
if ( count($result) > 0 ) {
while ( $node = db_fetch_object($result) ) {
if ( $node->visibility < 2 ) {
$path = drupal_get_path_alias($_GET['q']);
// Compare with the internal and path alias (if any)
$page_match = drupal_match_path($path, $node->pages);
if ( $path != $_GET['q'] )
$page_match = $page_match || drupal_match_path( $_GET['q'], $node->pages );
/**
* 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
* is displayed only on those pages listed in $block->pages.
*/
$page_match = !( $node->visibility xor $page_match );
} else {
$page_match = drupal_eval( $block->pages );
}
if ( $page_match )
$empty = 0;
}
}
return $empty;
}
endif;
......@@ -42,21 +42,24 @@
*
* @ingroup themeable
*/
?><!DOCTYPE html>
?>
<!DOCTYPE html>
<html lang="<?php print $language->language; ?>">
<head profile="<?php print $grddl_profile; ?>">
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<div id="skip-link">
<a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a>
</div>
<?php print $page_top; ?>
<?php print $page; ?>
<?php print $page_bottom; ?>
</body>
<head profile="<?php print $grddl_profile; ?>">
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<div id="skip-link">
<a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a>
</div>
<?php print $page_top; ?>
<?php print $page; ?>
<?php print $page_bottom; ?>
</body>
</html>
......@@ -75,37 +75,38 @@
*/
?>
<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>
<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">
<?php print theme('links__system_main_menu', array(
'links' => $valencia_menu,
'id' => 'subheader'
));?>
<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="" />
<button type="submit">
<img src="http://assets.ubuntu.com/sites/ubuntu/1044/u/img/search-black.svg" alt="Search" height="28" />
</button>
</form>
</nav>
<nav class="nav-primary nav-left" role="navigation">
<?php print theme('links__system_main_menu', array(
'links' => $valencia_menu,
'id' => 'subheader'
));?>
<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="" />
<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="main-content" class="inner-wrapper">
<?php print $messages; // Error messages ?>
<?php print $messages; // Error messages ?>
<nav role="navigation" class="nav-secondary clearfix">
<?php print theme('links__system_main_menu', array(
......@@ -114,37 +115,42 @@
));?>
</nav>
<div id="main-wrapper"><div id="main" class="clearfix">
<div id="content" class="column"><div class="section">
<a id="main-content"></a>
<?php if ($title): ?><h1 class="row" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
<?php print render($page['content']); ?>
<?php print $feed_icons; ?>
</div></div> <!-- /.section, /#content -->
</div></div> <!-- /#main, /#main-wrapper -->
<div id="main-wrapper">
<div id="main" class="clearfix">
<div id="content" class="column">
<div class="section">
<a id="main-content"></a>
<?php if ($title): ?><h1 class="row" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
<?php print render($page['content']); ?>
<?php print $feed_icons; ?>
</div>
</div>
</div>
</div>
</div></div> <!-- /#main-content, /.wrapper -->
</div>
</div>
<footer class="global clearfix">
<nav role="navigation">
<div class="footer-a">
<div class="clearfix">
<?php print theme('links__system_main_menu', array(
'links' => $valencia_menu,
'id' => 'footer'
));?>
</div> </div> <!-- /.clearfix, /.footer-a -->
<div class="legal clearfix">
<p class="twelve-col">&copy; Ubuntu e Canonical sono marchi registrati da Canonical Ltd.</p>
<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"><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>
</div> <!-- /.legal .clearfix -->
<span class="accessibility-aid"><a href="#">Got to the top of the page</a></span>
</nav> <!-- /nav -->
</footer> <!-- /footer -->
<footer class="global clearfix">
<nav role="navigation">
<div class="footer-a">
<div class="clearfix">
<?php print theme('links__system_main_menu', array(
'links' => $valencia_menu,
'id' => 'footer'
));?>
</div>
</div>
<div class="legal clearfix">
<p class="twelve-col">&copy; Ubuntu e Canonical sono marchi registrati da Canonical Ltd.</p>
<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"><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>
</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