truncated_text.php 402 B

1234567891011121314151617
  1. <?php
  2. function render_truncated_text($content) {
  3. if (strlen($content) < 400 || substr_count($content, '<br />') < 8) {
  4. echo $content;
  5. return;
  6. } ?>
  7. <input type="checkbox" class="expand-checkbox" id="expand" autocomplete="off" />
  8. <div class="truncated">
  9. <?= $content ?>
  10. </div>
  11. <p class="center">
  12. <label class="expand-button" for="expand"><?= get_string('expand') ?></label>
  13. </p><?php
  14. }