PageRenderTime 51ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

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