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
a61993ea
Commit
a61993ea
authored
May 02, 2014
by
Mattia Migliorini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic theme files -
Add function to test if region is empty
parent
03b66150
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
7 deletions
+92
-7
template.php
template.php
+59
-0
tpl/page.tpl.php
tpl/page.tpl.php
+0
-0
valencia.info
valencia.info
+33
-7
No files found.
template.php
0 → 100644
View file @
a61993ea
<?php
/**
* Conditional logic and data processing.
*
* Can be used to hold preprocessors [1] for generating variables before
* they are merged with the markup inside .tpl.php files.
*
* Custom functions, overriding theme functions [2], or any other customization
* of the raw output should be done here.
*
* NB: omit the php closing tag.
*
* [1] @see https://drupal.org/node/223430
* [2] @see https://drupal.org/node/173880#function-override
*
* @package Valencia
* @since 1.0.0
*/
/**
* Check if region is empty.
*
* Examines the block visibility setting for the current path to work out
* if the region is occupied.
*
* @param string $region required. Region name.
* @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
;
}
\ No newline at end of file
tpl/page.tpl.php
0 → 100644
View file @
a61993ea
valencia.info
View file @
a61993ea
...
...
@@ -2,23 +2,49 @@ name = Valencia
description = A theme developed by the Ubuntu Italy community.
core = 7.x
version = 0.1
engine = phptemplate
;screenshot = screenshot.png
; STYLESHEETS
stylesheets[all][] = css/ubuntu-styles.min.css
stylesheets[all][] = css/style.css
; SCRIPTS
scripts[] = js/yui-min.js
scripts[] = js/core.js
; CORE REGIONS - REQUIRED
regions[page_top] = Page Top
regions[content] = Content
regions[page_bottom] = Page Bottom
; CORE REGIONS - ENABLED
; CORE REGIONS
regions[page_top] = Page Top ; required, hidden
regions[page_bottom] = Page Bottom ; required, hidden
regions[header] = Header
regions[content] = Content ; required
regions[footer] = Footer
; CORE REGIONS - DISABLED
;regions[highlighted] = Highlighted
;regions[help] = Help
;regions[sidebar_first] = Sidebar First
;regions[sidebar_second] = Sidebar Second
\ No newline at end of file
;regions[sidebar_second] = Sidebar Second
; FEATURES
features[] = logo
features[] = name
features[] = slogan
features[] = node_user_picture
features[] = comment_user_picture
features[] = comment_user_verification
features[] = favicon
features[] = main_menu
features[] = secondary_menu
features[] = in_page_menu
; SETTINGS
settings[toggle_logo] = 1
settings[toggle_name] = 1
settings[toggle_slogan] = 1
settings[toggle_node_user_picture] = 1
settings[toggle_comment_user_picture] = 1
settings[toggle_comment_user_verification] = 1
settings[toggle_favicon] = 1
settings[toggle_main_menu] = 1
settings[toggle_secondary_menu] = 1
\ No newline at end of file
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