<?php
use Rhyme\WMassArtsHub\Helper\GeneralHelper;
use Rhyme\WMassArtsHub\Helper\ProfileHelper;
$arrImage = $this->getReaderMainImage();
$arrGallery = $this->getReaderOtherImages();
$arrDisciplines = $this->item->getDisciplines(true);
$arrActivities = $this->item->getActivities();
$arrLinks = $this->item->getArrayContent('url_collections');
$arrVideos = $this->item->getVideos();
$arrAwards = $this->item->getArrayContent('awards');
$arrEducation = $this->item->getArrayContent('education');
$arrAssociations = $this->item->getArrayContent('professional_associations');
$arrAdditionalContent = $this->item->getAdditionalContent();
$hasDescription = strlen($this->item->description) > 0;
$infoBoxClass = ProfileHelper::infoBoxClass($arrEducation, $arrAwards, $arrAssociations, $arrAdditionalContent);
$hasLotsofImagesClass = count($arrGallery) > 6 ? ' manyImages' : '';
?>
<form action="<?php echo $this->action; ?>" id="<?= $this->formId; ?>" name="artshub_profile_item<?php echo rand(); ?>" method="post" enctype="<?php echo $this->enctype; ?>">
<div class="formbody">
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formSubmit; ?>">
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
<input type="hidden" name="AJAX_ITEM" value="<?php echo $this->item_id; ?>">
<input type="hidden" name="AJAX_MODULE" value="<?php echo $this->module_id; ?>">
<div class="contentWrapper<?= $hasLotsofImagesClass ?>">
<div class="headerContent">
<div class="nameAndType">
<div class="inner">
<h1 class="title"><?= $this->name; ?></h1>
<p class="type"><?= $this->item->getInstitutionType()->name ?></p>
</div>
<div class="bottomLeftAngle">
<svg id="Layer_1" style="enable-background:new 0 0 75 87.4;" height="100%" width="100%" viewBox="0 0 75 87.4" preserveAspectRatio="none">
<polygon height="100%" width="100%" class="st0" points="0,87.4 75,0 75,87.4 ">
</polygon></svg>
</div>
</div>
</div>
<div class="contactAndDescriptionContent">
<div class="inner">
<div class="contactWrapper">
<h2>Details:</h2>
<div class="infoWrapper">
<div class="address-web-social">
<div class="links">
<?php if($this->website): ?><a href="<?= $this->website; ?>" target="_blank" title="Website for <?= $this->name; ?>"><i class="fas fa-globe-americas"></i><span>Website</span></a><?php endif; ?>
<?php if($this->facebook): ?><a href="<?= $this->facebook; ?>" target="_blank" title="Facebook Page for <?= $this->name; ?>"><i class="fab fa-facebook-square"></i><span>Facebook</span></a><?php endif; ?>
<?php if($this->twitter): ?><a href="<?= $this->twitter; ?>" target="_blank" title="Twitter for <?= $this->name; ?>"><i class="fab fa-twitter-square"></i><span>Twitter</span></a><?php endif; ?>
<?php if($this->instagram): ?><a href="<?= $this->instagram; ?>" target="_blank" title="Instagram for <?= $this->name; ?>"><i class="fab fa-instagram-square"></i><span>Instagram</span></a><?php endif; ?>
</div>
<div class="address">
<?php if($this->latitude && $this->longitude): ?>
<div class="map">
<h3>Location</h3>
<a href="<?= $this->item->getGoogleMapsLink(); ?>" target="_blank" title="Map for <?= $this->name; ?>">
<i class="fas fa-map-marker-alt"></i><span><?= $this->item->getAddress(); ?></span>
</a>
</div>
<?php else: ?>
<?= $this->item->getAddress(); ?>
<?php endif; ?>
</div>
</div>
<div class="contact">
<h3>Contact/Mailing Info</h3>
<?= $this->item->getContactInfo(true, true); ?>
</div>
</div>
</div>
<div class="all_disciplines">
<?php if($this->item->getPrimaryDiscipline()): ?>
<div class="disciplinesWrapper primary">
<div class="disciplines">
<h2>Primary Discipline</h2>
<div class="disciplines_container">
<div class="discipline"><span class="<?= $this->item->getPrimaryDiscipline()->alias ?>"><?= $this->item->getPrimaryDiscipline()->name ?></span></div>
</div>
</div>
</div>
<?php endif; ?>
<?php if(!empty($arrDisciplines)): ?>
<div class="disciplinesWrapper">
<div class="disciplines">
<h2>Additional Disciplines</h2>
<div class="disciplines_container">
<?php foreach($arrDisciplines as $discipline): ?>
<div class="discipline"><span class="<?= $discipline->alias ?>"><?= $discipline->name ?></span></div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php if(!empty($arrActivities)): ?>
<div class="activitiesWrapper">
<div class="activities">
<h2>Activities</h2>
<div class="activities_container">
<?php foreach($arrActivities as $activity): ?>
<div class="activity"><span class="<?= $activity->alias ?>"><?= $activity->name ?></span></div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if($hasDescription): //Profiles without images will get the text description moved up higher ?>
<div class="profileInfo">
<div class="description">
<div class="readmore">
<div class="content"><?= $this->description ?></div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="images<?php if($arrImage['isPlaceholder']): echo ' noimages'; endif; if($arrImage['isTallImage']): echo ' tall_image'; endif; if(count($arrGallery) === 0): echo ' no_gallery'; else: echo ' mosaicEnabled'; endif; ?>">
<?php //if (false): ?>
<?php if($arrImage['isPlaceholder']) : ?>
<div class="image_container is_placeholder">
{{insert_node::17}}
</div>
<?php else: ?>
<?php $objOriginal = is_file(TL_ROOT.'/'.$arrImage['originalSrc']) ? new File($arrImage['originalSrc']) : null; ?>
<div class="image_container main_image<?= $arrImage['additionalClasses'] ?>" data-aspect-ratio="<?= $objOriginal ? $objOriginal->width / $objOriginal->height : 1 ?>">
<a href="<?= $arrImage['originalSrc'] ?>" class="photoswipe"<?= GeneralHelper::getPhotoswipeDataForImage($arrImage, 'lightbox-profile' . $this->id) ?>>
<?php $this->insert('picture_default', $arrImage['picture']); ?>
</a>
</div>
<?php if(count($arrGallery) > 0): ?>
<?php foreach($arrGallery as $arrImage): ?>
<?php $objOriginal = is_file(TL_ROOT.'/'.$arrImage['originalSrc']) ? new File($arrImage['originalSrc']) : null; ?>
<div class="image_container gallery_image" data-aspect-ratio="<?= $objOriginal ? $objOriginal->width / $objOriginal->height : 1 ?>">
<a href="<?= $arrImage['originalSrc'] ?>" class="photoswipe"<?= GeneralHelper::getPhotoswipeDataForImage($arrImage, 'lightbox-profile' . $this->id) ?>>
<?php $this->insert('picture_default', $arrImage['picture']); ?>
</a>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php //endif; ?>
</div>
<?php if(!empty($arrVideos)): ?>
<div class="videos">
<div class="video_container">
<h4>Videos:</h4>
<div class="video_collection">
<?php foreach($arrVideos as $video): ?>
<div class="video">
<a href="<?= $video['link'] ?>" target="_blank" rel="nofollow">
<img src="<?= str_ireplace('http://', '//', $video['thumbnail']) ?>" width="320" height="180" alt="<?= $this->name; ?> Video">
</a>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if($infoBoxClass !== 'none' || !empty($arrLinks)): ?>
<div class="additional_info <?= $infoBoxClass ?>">
<div class="inner">
<?php if(!empty($arrLinks)): ?>
<div class="info_container urls">
<h4>Additional Links:</h4>
<div class="url_collection">
<ul>
<?php foreach($arrLinks as $link): ?>
<li><a href="<?= $link['url'] ?>" target="_blank"><i class="fas fa-globe-americas"></i><span><?= $link['title'] ?></span></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
<?php if(!empty($arrAwards)): ?>
<div class="info_container awards">
<h4>Awards</h4>
<div class="content">
<ul>
<?php foreach($arrAwards as $award): ?>
<li class="award"><span><?= $award ?></span></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
<?php if(!empty($arrEducation)): ?>
<div class="info_container education">
<h4>Education</h4>
<div class="content">
<ul>
<?php foreach($arrEducation as $education): ?>
<li class="education"><span><?= $education ?></span></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
<?php if(!empty($arrAssociations)): ?>
<div class="info_container associations">
<h4>Professional Associations</h4>
<div class="content">
<ul>
<?php foreach($arrAssociations as $association): ?>
<li class="association"><span><?= $association ?></span></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
<?php if(!empty($arrAdditionalContent)): ?>
<div class="info_container addtnl_content">
<h4>Additional Information</h4>
<div class="content">
<ul>
<?php foreach($arrAdditionalContent as $content): ?>
<li class="content"><span><?= $content ?></span></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</form>
<script>
(function($) {
jQuery(document).ready(function(){
!jQuery('#<?= $this->formId; ?> .mosaicEnabled').length || jQuery('#<?= $this->formId; ?> .mosaicEnabled').Mosaic({
innerGap: 10,
showTailWhenNotEnoughItemsForEvenOneRow: true
});
jQuery(window).trigger('resize');
});
})(jQuery);
</script>
<?php
$GLOBALS['TL_BODY']['profilereader_'.$this->formId] = "
<script>
(function ($) {
jQuery(document).ready(function(){
let setReadMore = jQuery('#". $this->formId . " .readmore').readmore({
speed: 250,
moreLink: '<div class=\"shadow closed\"><a href=\"#\">Read more</a></div>',
lessLink: '<div class=\"shadow open\"><a href=\"#\">Read less</a></div>'
});
});
})(jQuery);
</script>";
?>