mostly filebased Content Presentation System
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

cpublication.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. }