Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
wcms-openscholar
uw_virtual_site_homepage
Commits
7998b62a
Commit
7998b62a
authored
Jan 09, 2017
by
Eric Bremner
Browse files
FDSU-1851: Removing extra merge stuff and placing comments.
parent
21a436a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
uw_virtual_site_homepage.features.field_instance.inc
uw_virtual_site_homepage.features.field_instance.inc
+0
-2
uw_virtual_site_homepage.module
uw_virtual_site_homepage.module
+33
-13
No files found.
uw_virtual_site_homepage.features.field_instance.inc
View file @
7998b62a
...
...
@@ -772,8 +772,6 @@ function uw_virtual_site_homepage_field_default_field_instances() {
),
'type'
=>
'text_textarea_with_summary'
,
'weight'
=>
3
,
<<<<<<<
HEAD
=======
),
);
...
...
uw_virtual_site_homepage.module
View file @
7998b62a
...
...
@@ -41,38 +41,70 @@ function uw_virtual_site_homepage_image_field_widget_process($element, &$form_st
* Placing homepage banners on the virtual site homepage.
*/
function
uw_virtual_site_homepage_page_alter
(
&
$page
)
{
// Setting the variables to be used in homepage banners.
$index
=
0
;
$continue
=
true
;
// If there are banners, process them.
if
(
isset
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
]))
{
// html divs in homepage banners.
$html
=
'<div class="field-name-field-uw-home-page-banners">'
;
$html
.
=
'<div class="field-items">'
;
// While there is a continue, process the homepage banners.
while
(
$continue
)
{
// Set the image.
$html
.
=
'<figure class="field-item uw-homepage-banners-figure">'
;
$html
.
=
'<img src="'
.
file_uri_target
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
][
'#item'
][
'uri'
])
.
'">'
;
// If there is a title, double check, and then set the caption.
if
(
isset
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
][
'#item'
][
'title'
]))
{
// If there is a title, set the caption.
if
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
][
'#item'
][
'title'
]
!==
""
)
{
$html
.
=
'<span class="banner-caption">'
.
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
][
'#item'
][
'title'
]
.
'</span>'
;
}
}
// More html.
$html
.
=
'<div class="banner-controls">'
;
// Set previous and next buttons.
$html
.
=
'<button id="previous_banner" class="tabs-previous"><</button>'
;
$html
.
=
'<button id="next_banner" class="tabs-next">></button>'
;
// More html to close the homepage banners.
$html
.
=
'</div>'
;
$html
.
=
'</figure>'
;
// Increment the index.
$index
++
;
// If there are not any more homepage banners, stop processing the homepage banners.
if
(
!
(
isset
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_home_page_banners'
][
$index
])))
{
$continue
=
false
;
}
}
// Final closing html and play/pause button.
$html
.
=
'</div>'
;
$html
.
=
'<button class="slideshow-control pause" title="Pause">'
;
$html
.
=
'<span class="element-invisible">Pause banner slideshow</span>'
;
$html
.
=
'<span class="icon-pause"></span>'
;
$html
.
=
'</button>'
;
$html
.
=
'</div>'
;
// Set the html to the page variable.
$page
[
'uw_virtual_page_homepage_banners_html'
]
=
$html
;
}
// If there is credentials in the virutal site homepage settings, add it to the header.
if
(
isset
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_credentials'
]))
{
$page
[
'header_second'
][
'boxes_site_info'
][
'content'
][
'#markup'
]
=
preg_replace
(
'/<p>(.*)<a(.*)<\/a>/s'
,
'<h2>'
.
$page
[
'uw-virtual-site-homepage'
][
'field_uw_credentials'
][
0
][
'#markup'
]
.
'</h2>'
,
$page
[
'header_second'
][
'boxes_site_info'
][
'content'
][
'#markup'
]);
}
$page
[
'uw_virtual_page_homepage_banners_html'
]
=
$html
;
}
/**
...
...
@@ -169,18 +201,6 @@ function uw_virtual_site_homepage_form_uw_virtual_site_homepage_node_form_alter(
$form
[
'actions'
][
'submit'
][
'#submit'
][]
=
'uw_virtual_site_homepage_node_form_redirect'
;
}
/**
* Implements hook_page_alter().
* Add credentials to header if present.
*/
function
uw_virtual_site_homepage_page_alter
(
&
$page
)
{
// If there is credentials in the virutal site homepage settings, add it to the header.
if
(
isset
(
$page
[
'uw-virtual-site-homepage'
][
'field_uw_credentials'
]))
{
$page
[
'header_second'
][
'boxes_site_info'
][
'content'
][
'#markup'
]
=
preg_replace
(
'/<p>(.*)<a(.*)<\/a>/s'
,
'<h2>'
.
$page
[
'uw-virtual-site-homepage'
][
'field_uw_credentials'
][
0
][
'#markup'
]
.
'</h2>'
,
$page
[
'header_second'
][
'boxes_site_info'
][
'content'
][
'#markup'
]);
}
}
/**
* Submit callback.
* Saves site title and site description.
...
...
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