$child) {
if($element[$key]['#description'] == 'Provide banner images for virtual site homepages on Scholar at Waterloo sites.') {
$element[$key]['#process'][] = 'uw_virtual_site_homepage_image_field_widget_process';
}
}
}
}
/**
* Implements hook_image_field_widget_process().
* Processing images to change title to caption for homepage banners.
*/
function uw_virtual_site_homepage_image_field_widget_process($element, &$form_state, $form) {
// Set the title to be the caption and the description.
//$element['title']['#title'] = 'Caption';
$element['title']['#description'] = 'The title is display with the picture.';
// Return the altered element
return $element;
}
/**
* Implements hook_page_alter().
* Placing homepage banners on the virtual site homepage.
*/
function uw_virtual_site_homepage_page_alter(&$page) {
global $base_path;
// Setting the variables to be used in homepage banners.
$index = 0;
$continue = true;
if(isset($page['uw-virtual-site-homepage']['field_uw_faculty_list_logo'][0]['#markup'])) {
$site_links = _uw_virtual_site_homepage_get_site_links();
if (isset($site_links[$page['uw-virtual-site-homepage']['field_uw_faculty_list_logo'][0]['#markup']])) {
$site_link = $site_links[$page['uw-virtual-site-homepage']['field_uw_faculty_list_logo'][0]['#markup']];
$page['uw-virtual-site-homepage']['uw_scholar_row']['site_link'] = $site_link;
}
}
// If there are banners, process them.
if(isset($page['uw-virtual-site-homepage']['field_uw_homepage_banners'][$index])) {
// html divs in homepage banners.
$html = '
';
}
}
else{
$html .= '';
}
}
// If there is more than one image, add the Play/Pause button.
if($num_of_images > 1) {
// Final closing html and play/pause button.
$html .= '
';
$html .= '';
$html .= '
';
$html .= $boxes;
$html .= '
';
$html .= '
';
}
else{
// close the opening html divs in homepage banners. if single image in banner
$html .= '';
$html .= '';
}
// 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'])) {
if(isset($page['header_second']['boxes_site_info']['content']['#markup'])) {
$page['header_second']['boxes_site_info']['content']['#markup'] = preg_replace('/