|
- <?php
-
- namespace Modules;
-
- class CPublication extends ContentType {
-
- public $keys = array(
- 'TITLE' => 'title',
- 'ARTIST' => 'artist',
- 'DATE' => 'date',
- 'IMAGE' => 'img',
- 'CATALOGUE' => 'catalogue'
- );
- public $values;
- protected $layout;
- protected $layouts = array(
- 'default' => 'view_in_toc',
- 'toc' => 'view_in_toc'
- );
-
- function __construct($keys,$config) {
-
- parent::__construct($keys,$config);
- }
-
-
- function simple() {
- return sprintf("sdsd");
- }
-
- function view_in_toc() {
- $f3 = \Base::instance();
- $v = (object) $this->values;
-
- $img = new CachedImage($this->config['path'].$v->img);
- $img_html = sprintf('<img src="%s" alt="cover art" />', $img->get_src(1000));
- return sprintf(
- "<div class=\"contentTypeElement publication\">"
- ."<span class=\"catalogue\">%s</span>"
- ."<a href=\"/%s\">"
- ."%s"
- ."<div class=\"info\">"
- ."<h2>%s</h2><h3><span class=\"artist\">%s</span>%s</h3>"
- ."</div></a></div>",
- $v->catalogue,
- $this->href,
- $img_html,
- $v->title,
- $v->artist,
- $v->date ? '<span class="pubdate"> - '.$v->date.'</span>' : '' ,
-
-
- );
- }
-
- }
|