|
|
|
|
|
|
|
|
'ARTIST' => 'artist', |
|
|
'ARTIST' => 'artist', |
|
|
'DATE' => 'date', |
|
|
'DATE' => 'date', |
|
|
'IMAGE' => 'img', |
|
|
'IMAGE' => 'img', |
|
|
'CATALOGUE' => 'catalogue' |
|
|
|
|
|
|
|
|
'CATALOGUE' => 'cat', |
|
|
|
|
|
'PRICE' => 'price', |
|
|
|
|
|
'LINK' => 'link' |
|
|
); |
|
|
); |
|
|
public $values; |
|
|
public $values; |
|
|
protected $layout; |
|
|
protected $layout; |
|
|
|
|
|
|
|
|
function simple() { |
|
|
function simple() { |
|
|
return sprintf("sdsd"); |
|
|
return sprintf("sdsd"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function affiliate_link($href) { |
|
|
|
|
|
$classes = ['affiliate']; |
|
|
|
|
|
$name = $href; |
|
|
|
|
|
if (stripos($href, 'bandcamp.com') !== false) { |
|
|
|
|
|
$classes[] = 'bandcamp'; |
|
|
|
|
|
$name = 'Bandcamp'; |
|
|
|
|
|
} |
|
|
|
|
|
return sprintf('<a href="%s" class="%s">%s</a>', |
|
|
|
|
|
$href, |
|
|
|
|
|
implode(" ",$classes), |
|
|
|
|
|
$name |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function view_in_toc() { |
|
|
function view_in_toc() { |
|
|
$f3 = \Base::instance(); |
|
|
$f3 = \Base::instance(); |
|
|
$v = (object) $this->values; |
|
|
$v = (object) $this->values; |
|
|
|
|
|
|
|
|
$img = new CachedImage($this->config['path'].$v->img); |
|
|
$img = new CachedImage($this->config['path'].$v->img); |
|
|
$img_html = sprintf('<img src="%s" alt="cover art" />', $img->get_src(1000)); |
|
|
$img_html = sprintf('<img src="%s" alt="cover art" />', $img->get_src(1000)); |
|
|
|
|
|
|
|
|
|
|
|
$ED = new ElementDispatcher(); |
|
|
|
|
|
$buy_button = $v->price |
|
|
|
|
|
? $ED->content_element([ |
|
|
|
|
|
'buy', |
|
|
|
|
|
$v->cat .": ".$v->title, |
|
|
|
|
|
$v->price]) |
|
|
|
|
|
: ""; |
|
|
|
|
|
|
|
|
|
|
|
$affiliates = ""; |
|
|
|
|
|
|
|
|
|
|
|
if (is_array($v->link)) { |
|
|
|
|
|
foreach ($v->link as $link) { |
|
|
|
|
|
$affiliates .= $this->affiliate_link($link); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
$affiliates .= $this->affiliate_link($v->link); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return sprintf( |
|
|
return sprintf( |
|
|
"<div class=\"contentTypeElement publication\">" |
|
|
"<div class=\"contentTypeElement publication\">" |
|
|
."<span class=\"catalogue\">%s</span>" |
|
|
."<span class=\"catalogue\">%s</span>" |
|
|
|
|
|
|
|
|
."%s" |
|
|
."%s" |
|
|
."<div class=\"info\">" |
|
|
."<div class=\"info\">" |
|
|
."<h2>%s</h2><h3><span class=\"artist\">%s</span>%s</h3>" |
|
|
."<h2>%s</h2><h3><span class=\"artist\">%s</span>%s</h3>" |
|
|
."</div></a></div>", |
|
|
|
|
|
$v->catalogue, |
|
|
|
|
|
|
|
|
."</div></a></div>%s %s", |
|
|
|
|
|
$v->cat, |
|
|
$this->href, |
|
|
$this->href, |
|
|
$img_html, |
|
|
$img_html, |
|
|
$v->title, |
|
|
$v->title, |
|
|
$v->artist, |
|
|
$v->artist, |
|
|
$v->date ? '<span class="pubdate"> - '.$v->date.'</span>' : '' , |
|
|
$v->date ? '<span class="pubdate"> - '.$v->date.'</span>' : '' , |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$buy_button, |
|
|
|
|
|
$affiliates |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|