|
- <?php
-
- namespace Modules;
-
- class CPublication extends ContentType {
-
- public $keys = array(
- 'TITLE' => 'title',
- 'ARTIST' => 'artist',
- 'DATE' => 'date',
- 'IMAGE' => 'img'
- );
- 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\">"
- ."%s"
- ."<h2><a href=\"/%s\">%s</a><span class=\"artist\">%s</span>%s</h2>"
- ."</div>",
- $img_html,
- $this->href,
- $v->title,
- $v->artist,
- $v->date ? '<span class="pubdate"> - '.$v->date.'</span>' : ''
-
- );
- }
-
- }
|