<commit_before><?php  
defined('C5_EXECUTE') or die("Access Denied.");
$al = Loader::helper('concrete/asset_library');
$bf = null;
$bfo = null;

if ($controller->getFileID() > 0) { 
	$bf = $controller->getFileObject();
}
if ($controller->getFileOnstateID() > 0) { 
	$bfo = $controller->getFileOnstateObject();

}
?>
<div class="ccm-block-field-group">
<h4><?=t('Image to Display')?></h4><br/>
<?
$args = array();
if ($forceImageToMatchDimensions && $maxWidth && $maxHeight) {
	$args['maxWidth'] = $maxWidth;
	$args['maxHeight'] = $maxHeight;
	$args['minWidth'] = $maxWidth;
	$args['minHeight'] = $maxHeight;
}
?>

<div class="clearfix">
	<label><?=t('Image')?></label>
	<div class="input">	
		<?=$al->image('ccm-b-image', 'fID', t('Choose Image'), $bf, $args);?>
	</div>
</div>
<div class="clearfix">
	<label><?=t('Image On-State')?></label>
	<div class="input">	
		<?=$al->image('ccm-b-image-onstate', 'fOnstateID', t('Choose Image On-State'), $bfo, $args);?>
	</div>
</div>

</div>

<div class="ccm-block-field-group">
<h4><?=t('Link and Caption')?></h4><br/>

<div class="clearfix">
	<?=$form->label('linkType', t('Image Links to:'))?>
	<div class="input">	
		<select name="linkType" id="linkType">
			<option value="0" <?=(empty($externalLink) && empty($internalLinkCID) ? 'selected="selected"' : '')?>><?=t('Nothing')?></option>
			<option value="1" <?=(empty($externalLink) && !empty($internalLinkCID) ? 'selected="selected"' : '')?>><?=t('Another Page')?></option>
			<option value="2" <?=(!empty($externalLink) ? 'selected="selected"' : '')?>><?=t('External URL')?></option>
		</select>
	</div>
</div>

<div id="linkTypePage" style="display: none;" class="clearfix">
	<?=$form->label('internalLinkCID', t('Choose Page:'))?>
	<div class="input">
		<?= Loader::helper('form/page_selector')->selectPage('internalLinkCID', $internalLinkCID); ?>
	</div>
</div>
<div id="linkTypeExternal" style="display: none;" class="clearfix">
	<?=$form->label('externalLink', t('URL:'))?>
	<div class="input">
	<?= $form->text('externalLink', $externalLink, array('style' => 'width: 250px')); ?>
	</div>
</div>


<div class="clearfix">
	<?=$form->label('altText', t('Alt Text/Caption'))?>
	<div class="input">	
		<?= $form->text('altText', $altText, array('style' => 'width: 250px')); ?>
	</div>
</div>

</div>

<div>
<h4><?=t('Constrain Image Dimensions')?></h4>
<? if ($maxWidth == 0) { 
	$maxWidth = '';<commit_msg>Adding linebreak for a little more consistency<commit_after><?php  
defined('C5_EXECUTE') or die("Access Denied.");
$al = Loader::helper('concrete/asset_library');
$bf = null;
$bfo = null;

if ($controller->getFileID() > 0) { 
	$bf = $controller->getFileObject();
}
if ($controller->getFileOnstateID() > 0) { 
	$bfo = $controller->getFileOnstateObject();

}
?>
<div class="ccm-block-field-group">
<h4><?=t('Image to Display')?></h4><br/>
<?
$args = array();
if ($forceImageToMatchDimensions && $maxWidth && $maxHeight) {
	$args['maxWidth'] = $maxWidth;
	$args['maxHeight'] = $maxHeight;
	$args['minWidth'] = $maxWidth;
	$args['minHeight'] = $maxHeight;
}
?>

<div class="clearfix">
	<label><?=t('Image')?></label>
	<div class="input">	
		<?=$al->image('ccm-b-image', 'fID', t('Choose Image'), $bf, $args);?>
	</div>
</div>
<div class="clearfix">
	<label><?=t('Image On-State')?></label>
	<div class="input">	
		<?=$al->image('ccm-b-image-onstate', 'fOnstateID', t('Choose Image On-State'), $bfo, $args);?>
	</div>
</div>

</div>

<div class="ccm-block-field-group">
<h4><?=t('Link and Caption')?></h4><br/>

<div class="clearfix">
	<?=$form->label('linkType', t('Image Links to:'))?>
	<div class="input">	
		<select name="linkType" id="linkType">
			<option value="0" <?=(empty($externalLink) && empty($internalLinkCID) ? 'selected="selected"' : '')?>><?=t('Nothing')?></option>
			<option value="1" <?=(empty($externalLink) && !empty($internalLinkCID) ? 'selected="selected"' : '')?>><?=t('Another Page')?></option>
			<option value="2" <?=(!empty($externalLink) ? 'selected="selected"' : '')?>><?=t('External URL')?></option>
		</select>
	</div>
</div>

<div id="linkTypePage" style="display: none;" class="clearfix">
	<?=$form->label('internalLinkCID', t('Choose Page:'))?>
	<div class="input">
		<?= Loader::helper('form/page_selector')->selectPage('internalLinkCID', $internalLinkCID); ?>
	</div>
</div>
<div id="linkTypeExternal" style="display: none;" class="clearfix">
	<?=$form->label('externalLink', t('URL:'))?>
	<div class="input">
	<?= $form->text('externalLink', $externalLink, array('style' => 'width: 250px')); ?>
	</div>
</div>


<div class="clearfix">
	<?=$form->label('altText', t('Alt Text/Caption'))?>
	<div class="input">	
		<?= $form->text('altText', $altText, array('style' => 'width: 250px')); ?>
	</div>
</div>

</div>

<div>
<h4><?=t('Constrain Image Dimensions')?></h4><br/>
<? if ($maxWidth == 0) { 
	$maxWidth = '';
{'fraction_non_alphanumeric': 0.2796784830997527, 'fraction_numerical': 0.007831821929101401, 'mean_word_length': 6.375379939209727, 'pattern_counts': {'":': 0, '<': 148, '<?xml version=': 0, '>': 180, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5697189', 'n_tokens_mistral': 1891, 'n_tokens_neox': 1841, 'n_words': 326}