Merge pull request #19594 from eileenmcnaughton/535m
[civicrm-core.git] / setup / plugins / blocks / components.tpl.php
index 0c129709b474fb4c93347e5339735bddf04b72cf..2949a48c229407bbaea018c0efd0e37b197ad77d 100644 (file)
@@ -2,6 +2,8 @@
 endif; ?>
 <h2 id="components"><?php echo ts('Components'); ?></h2>
 
+<p class="comp-error-required"><?php echo ts('At least one component must be enabled.'); ?></p>
+
 <div>
   <?php foreach ($model->getField('components', 'options') as $comp => $label): ?>
     <input class="comp-cb sr-only" style="display: none;" type="checkbox" name="civisetup[components][<?php echo $comp; ?>]" id="civisetup[components][<?php echo $comp; ?>]" <?php echo in_array($comp, $model->components) ? 'checked' : '' ?>>
@@ -16,3 +18,11 @@ endif; ?>
   <strong><?php echo ts('Tip'); ?></strong>:
   <?php echo ts('Not sure? That\'s OK. After installing, you can enable and disable components at any time.'); ?>
 </p>
+
+<script type="text/javascript">
+  csj$(function($){
+    $('.comp-cb').useValidator(function(){
+      $('.comp-error-required').toggleError($('.comp-cb:checked').length == 0);
+    });
+  });
+</script>