mostly filebased Content Presentation System
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

57 rindas
1.4KB

  1. <?php
  2. namespace Modules;
  3. class CPublication extends ContentType {
  4. public $keys = array(
  5. 'TITLE' => 'title',
  6. 'ARTIST' => 'artist',
  7. 'DATE' => 'date',
  8. 'IMAGE' => 'img',
  9. 'CATALOGUE' => 'catalogue'
  10. );
  11. public $values;
  12. protected $layout;
  13. protected $layouts = array(
  14. 'default' => 'view_in_toc',
  15. 'toc' => 'view_in_toc'
  16. );
  17. function __construct($keys,$config) {
  18. parent::__construct($keys,$config);
  19. }
  20. function simple() {
  21. return sprintf("sdsd");
  22. }
  23. function view_in_toc() {
  24. $f3 = \Base::instance();
  25. $v = (object) $this->values;
  26. $img = new CachedImage($this->config['path'].$v->img);
  27. $img_html = sprintf('<img src="%s" alt="cover art" />', $img->get_src(1000));
  28. return sprintf(
  29. "<div class=\"contentTypeElement publication\">"
  30. ."<span class=\"catalogue\">%s</span>"
  31. ."<a href=\"/%s\">"
  32. ."%s"
  33. ."<div class=\"info\">"
  34. ."<h2>%s</h2><h3><span class=\"artist\">%s</span>%s</h3>"
  35. ."</div></a></div>",
  36. $v->catalogue,
  37. $this->href,
  38. $img_html,
  39. $v->title,
  40. $v->artist,
  41. $v->date ? '<span class="pubdate"> - '.$v->date.'</span>' : '' ,
  42. );
  43. }
  44. }