f84bcaec01
I wanted to ensure that all pages (even the downtime page, terms page, home page, etc) had the appropriate `data-` attributes on `<body>` (because those are required for certain javascript, eg autocomplete, to work). One thing led to another and now everything in `head` is microhtml'ed
31 lines
925 B
PHP
31 lines
925 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shimmie2;
|
|
|
|
use function MicroHTML\{SCRIPT};
|
|
|
|
class MP3FileHandlerTheme extends Themelet
|
|
{
|
|
public function display_image(Image $image): void
|
|
{
|
|
global $page;
|
|
$data_href = get_base_href();
|
|
$ilink = $image->get_image_link();
|
|
$html = "
|
|
<audio controls class='shm-main-image audio_image' id='main_image' alt='main image'>
|
|
<source id='audio_src' src=\"$ilink\" type=\"audio/mpeg\">
|
|
Your browser does not support the audio element.
|
|
</audio>
|
|
<p>Title: <span id='audio-title'>???</span> | Artist: <span id='audio-artist'>???</span></p>
|
|
|
|
<p><a href='$ilink' id='audio-download'>Download</a>";
|
|
|
|
$page->add_html_header(SCRIPT([
|
|
'src' => "$data_href/ext/handle_mp3/lib/jsmediatags.min.js",
|
|
'type' => 'text/javascript'
|
|
]));
|
|
$page->add_block(new Block("Music", $html, "main", 10));
|
|
}
|
|
}
|