瀏覽代碼

missing file from previous commit

master
Dom SP 3 年之前
父節點
當前提交
9c81d1fe7a
共有 1 個檔案被更改,包括 50 行新增0 行删除
  1. +50
    -0
      app/modules/cpublication.php

+ 50
- 0
app/modules/cpublication.php 查看文件

@@ -0,0 +1,50 @@
<?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>' : ''
);
}

}

Loading…
取消
儲存