1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 | <?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><?php echo t('Image to Display')?></h4><br/>
<?php
$args = array();
if ($forceImageToMatchDimensions && $maxWidth && $maxHeight) {
$args['maxWidth'] = $maxWidth;
$args['maxHeight'] = $maxHeight;
$args['minWidth'] = $maxWidth;
$args['minHeight'] = $maxHeight;
}
?>
<div class="clearfix">
<label><?php echo t('Image')?></label>
<div class="input">
<?php echo $al->image('ccm-b-image', 'fID', t('Choose Image'), $bf, $args);?>
</div>
</div>
<div class="clearfix">
<label><?php echo t('Image On-State')?></label>
<div class="input">
<?php echo $al->image('ccm-b-image-onstate', 'fOnstateID', t('Choose Image On-State'), $bfo, $args);?>
</div>
</div>
</div>
<div class="ccm-block-field-group">
<h4><?php echo t('Link and Caption')?></h4><br/>
<div class="clearfix">
<?php echo $form->label('linkType', t('Image Links to:'))?>
<div class="input">
<select name="linkType" id="linkType">
<option value="0" <?php echo (empty($externalLink) && empty($internalLinkCID) ? 'selected="selected"' : '')?>><?php echo t('Nothing')?></option>
<option value="1" <?php echo (empty($externalLink) && !empty($internalLinkCID) ? 'selected="selected"' : '')?>><?php echo t('Another Page')?></option>
<option value="2" <?php echo (!empty($externalLink) ? 'selected="selected"' : '')?>><?php echo t('External URL')?></option>
</select>
</div>
</div>
<div id="linkTypePage" style="display: none;" class="clearfix">
<?php echo $form->label('internalLinkCID', t('Choose Page:'))?>
<div class="input">
<?php echo Loader::helper('form/page_selector')->selectPage('internalLinkCID', $internalLinkCID); ?>
</div>
</div>
<div id="linkTypeExternal" style="display: none;" class="clearfix">
<?php echo $form->label('externalLink', t('URL:'))?>
<div class="input">
<?php echo $form->text('externalLink', $externalLink, array('style' => 'width: 250px')); ?>
</div>
</div>
<div class="clearfix">
<?php echo $form->label('altText', t('Alt Text/Caption'))?>
<div class="input">
<?php echo $form->text('altText', $altText, array('style' => 'width: 250px')); ?>
</div>
</div>
</div>
<div>
<h4><?php echo t('Constrain Image Dimensions')?></h4>
<?php if ($maxWidth == 0) {
$maxWidth = '';
}
if ($maxHeight == 0) {
$maxHeight = '';
}
?>
<div class="clearfix">
<?php echo $form->label('maxWidth', t('Max Width'))?>
<div class="input">
<?php echo $form->text('maxWidth', $maxWidth, array('style' => 'width: 60px')); ?>
</div>
</div>
<div class="clearfix">
<?php echo $form->label('maxHeight', t('Max Height'))?>
<div class="input">
<?php echo $form->text('maxHeight', $maxHeight, array('style' => 'width: 60px')); ?>
</div>
</div>
<div class="clearfix">
<?php echo $form->label('forceImageToMatchDimensions', t('Scale Image'))?>
<div class="input">
<select name="forceImageToMatchDimensions" id="forceImageToMatchDimensions">
<option value="0" <?php if (!$forceImageToMatchDimensions) { ?> selected="selected" <?php } ?>><?php echo t('Automatically')?></option>
<option value="1" <?php if ($forceImageToMatchDimensions == 1) { ?> selected="selected" <?php } ?>><?php echo t('Force Exact Image Match')?></option>
</select>
</div>
</div>
</div>
|