block.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * Name: Text
  4. * Section: content
  5. * Description: Free text block
  6. *
  7. */
  8. /* @var $options array */
  9. $default_options = array(
  10. 'html'=>'<p style="text-align: left; font-size: 16px; font-family: Arial">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae sodales nulla, nec blandit velit. Morbi feugiat imperdiet augue, vel mattis augue sagittis rutrum. Sed.</p>',
  11. 'font_family'=>'Helvetica, Arial, sans-serif',
  12. 'font_size'=>16,
  13. 'font_color'=>'#000000',
  14. 'block_padding_left'=>15,
  15. 'block_padding_right'=>15,
  16. 'block_background'=>'#ffffff'
  17. );
  18. $options = array_merge($default_options, $options);
  19. /*
  20. $options['html'] = str_replace('<p>', '<p style="">', $options['html']);
  21. $style = 'font-family: ' . $options['font_family'] . ';font-size: ' . $options['font_size'] . 'px; color: <?php echo $options['font_color']?>;
  22. $options['html'] = str_replace('<p', '<p inline-class="text-p"', $options['html']);
  23. */
  24. ?>
  25. <style>
  26. .text-td {
  27. font-family: <?php echo $options['font_family']?>;
  28. font-size: <?php echo $options['font_size']?>px;
  29. color: <?php echo $options['font_color']?>;
  30. line-height: 1.5rem;
  31. }
  32. .text-p {
  33. font-family: <?php echo $options['font_family']?>;
  34. font-size: <?php echo $options['font_size']?>px;
  35. }
  36. </style>
  37. <table width="100%" style="width: 100%!important" border="0" cellpadding="0" cellspacing="0">
  38. <tr>
  39. <td width="100%" valign="top" align="left" class="text-td">
  40. <?php echo $options['html'] ?>
  41. </td>
  42. </tr>
  43. </table>