mostly filebased Content Presentation System
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

cevent.php 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Modules;
  3. class CEvent extends ContentType {
  4. public $keys = array(
  5. 'DATE' => 'date',
  6. 'LEFT01' => 'left01',
  7. 'LEFT02' => 'left02',
  8. 'LEFT03' => 'left03',
  9. 'RIGHT01' => 'right01',
  10. 'RIGHT02' => 'right02',
  11. 'RIGHT03' => 'right03'
  12. );
  13. public $values;
  14. protected $layout;
  15. protected $layouts = array(
  16. 'toc' => 'view_in_toc',
  17. );
  18. function __construct($keys,$config) {
  19. parent::__construct($keys,$config);
  20. }
  21. function view_in_toc() {
  22. $v = (object) $this->values;
  23. $TS = strtotime($v->date);
  24. $href = $this->href;
  25. $date = sprintf("<span class=\"month\">%s</span>"
  26. ."<span class=\"day-of-month\">%s</span>",
  27. $this->month_name(date('n',$TS)),
  28. date('d', $TS)
  29. );
  30. if (is_object($v->left02)) {
  31. $v->left02->set_layout('name_as_link');
  32. }
  33. $left = sprintf("<h4>%s</h4>"
  34. ."<h3>%s</h3>"
  35. ."<footer>%s</footer>",
  36. $v->left01,
  37. $v->left02,
  38. $v->left03
  39. );
  40. $right = sprintf("<h6>%s</h6>"
  41. ."<span class=\"right02\">%s</span><br>"
  42. ."<span class=\"right03\">%s</span>",
  43. $v->right01,
  44. $v->right02,
  45. $v->right03
  46. );
  47. return sprintf("<div class=\"entry\">"
  48. ."<div class=\"date\">%s</div>"
  49. ."<div class=\"left\">%s</div>"
  50. ."<div class=\"right\">%s</div>"
  51. ."</div>",
  52. $date,
  53. $left,
  54. $right
  55. );
  56. }
  57. }