Commit 7998b62a authored by Eric Bremner's avatar Eric Bremner
Browse files

FDSU-1851: Removing extra merge stuff and placing comments.

parent 21a436a5
......@@ -772,8 +772,6 @@ function uw_virtual_site_homepage_field_default_field_instances() {
),
'type' => 'text_textarea_with_summary',
'weight' => 3,
<<<<<<< HEAD
=======
),
);
......
......@@ -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']);
}
}
/**
......@@ -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.
......
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