PageRenderTime 346ms CodeModel.GetById 120ms app.highlight 8ms RepoModel.GetById 175ms app.codeStats 41ms

/concreteOLD/blocks/image/form.php

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