2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2023-01-10 22:44:09 +00:00
|
|
|
namespace Shimmie2;
|
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
use MicroHTML\HTMLElement;
|
2022-10-27 16:21:46 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
use function MicroHTML\TABLE;
|
|
|
|
use function MicroHTML\TR;
|
|
|
|
use function MicroHTML\TD;
|
|
|
|
use function MicroHTML\SMALL;
|
|
|
|
use function MicroHTML\rawHTML;
|
|
|
|
use function MicroHTML\INPUT;
|
|
|
|
use function MicroHTML\emptyHTML;
|
|
|
|
use function MicroHTML\NOSCRIPT;
|
|
|
|
use function MicroHTML\DIV;
|
|
|
|
use function MicroHTML\BR;
|
|
|
|
use function MicroHTML\A;
|
|
|
|
|
|
|
|
use function MicroHTML\P;
|
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
class UploadTheme extends Themelet
|
|
|
|
{
|
2021-12-14 18:10:15 +00:00
|
|
|
public function display_block(Page $page): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
2021-12-14 18:10:15 +00:00
|
|
|
$b = new Block("Upload", (string)$this->build_upload_block(), "left", 20);
|
2020-06-24 14:40:25 +00:00
|
|
|
$b->is_content = false;
|
|
|
|
$page->add_block($b);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
public function display_full(Page $page): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
$page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "left", 20));
|
|
|
|
}
|
2008-07-24 07:50:31 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
public function display_page(Page $page): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
global $config, $page;
|
2012-03-06 15:38:53 +00:00
|
|
|
|
2020-06-16 23:29:59 +00:00
|
|
|
$tl_enabled = ($config->get_string(UploadConfig::TRANSLOAD_ENGINE, "none") != "none");
|
|
|
|
$max_size = $config->get_int(UploadConfig::SIZE);
|
2019-05-28 16:59:38 +00:00
|
|
|
$max_kb = to_shorthand_int($max_size);
|
2023-03-26 22:12:22 +00:00
|
|
|
$max_total_size = parse_shorthand_int(ini_get('post_max_size')) - 102400; //leave room for http request data
|
|
|
|
$max_total_kb = to_shorthand_int($max_total_size);
|
2019-05-28 16:59:38 +00:00
|
|
|
$upload_list = $this->h_upload_list_1();
|
2021-12-14 18:10:15 +00:00
|
|
|
|
2021-12-18 05:40:55 +00:00
|
|
|
$form = SHM_FORM("upload", "POST", true, "file_upload");
|
2021-12-14 18:10:15 +00:00
|
|
|
$form->appendChild(
|
|
|
|
TABLE(
|
2023-11-11 21:49:12 +00:00
|
|
|
["id" => "large_upload_form", "class" => "vert"],
|
2021-12-14 18:10:15 +00:00
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["width" => "20"], rawHTML("Common Tags")),
|
|
|
|
TD(["colspan" => "5"], INPUT(["name" => "tags", "type" => "text", "placeholder" => "tagme", "class" => "autocomplete_tags", "autocomplete" => "off"]))
|
2021-12-14 18:10:15 +00:00
|
|
|
),
|
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["width" => "20"], rawHTML("Common Source")),
|
|
|
|
TD(["colspan" => "5"], INPUT(["name" => "source", "type" => "text"]))
|
2021-12-14 18:10:15 +00:00
|
|
|
),
|
|
|
|
$upload_list,
|
2023-03-26 22:12:22 +00:00
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["colspan" => $tl_enabled ? 2 : 4,"id" => "upload_size_tracker"], ""),
|
|
|
|
TD(["colspan" => 2], ""),
|
2023-03-26 22:12:22 +00:00
|
|
|
),
|
2021-12-14 18:10:15 +00:00
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["colspan" => "6"], INPUT(["id" => "uploadbutton", "type" => "submit", "value" => "Post"]))
|
2021-12-14 18:10:15 +00:00
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$html = emptyHTML(
|
|
|
|
$form,
|
2023-12-26 12:50:37 +00:00
|
|
|
$max_size > 0 ? SMALL("(Max file size is $max_kb)") : null,
|
|
|
|
$max_total_size > 0 ? SMALL(BR(), "(Max total size is $max_total_kb)") : null,
|
2023-03-26 22:12:22 +00:00
|
|
|
rawHTML("<script>
|
|
|
|
function fileSize(size){
|
|
|
|
var i = Math.floor(Math.log(size) / Math.log(1024));
|
|
|
|
return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
|
|
|
|
}
|
|
|
|
function updateTracker(){
|
|
|
|
var size = 0;
|
|
|
|
var upbtn = $(\"#uploadbutton\")[0];
|
|
|
|
var tracker = $(\"#upload_size_tracker\")[0];
|
|
|
|
var lockbtn = false;
|
|
|
|
|
|
|
|
$(\"input[name*='data'][id!='data[]']\").each(function(_,n){
|
|
|
|
var cancelbtn = $(\"div[name='cancel\"+n.name+\"']\")[0];
|
|
|
|
var toobig = false;
|
|
|
|
if (n.files.length){
|
|
|
|
cancelbtn.style.visibility = 'visible';
|
|
|
|
for (var i = 0; i<n.files.length; i++){
|
|
|
|
size += n.files[i].size;
|
2023-12-26 12:50:37 +00:00
|
|
|
if ($max_size > 0 && n.files[i].size > $max_size){
|
2023-03-26 22:12:22 +00:00
|
|
|
toobig = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (toobig){
|
|
|
|
lockbtn = true;
|
|
|
|
n.style = 'color:red';
|
|
|
|
}else{
|
|
|
|
n.style = 'color:initial';
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
n.style = 'color:initial';
|
|
|
|
cancelbtn.style.visibility = 'hidden';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (size){
|
|
|
|
tracker.innerText = 'Total: ' + fileSize(size);
|
2023-12-26 12:50:37 +00:00
|
|
|
if ($max_total_size > 0 && size > $max_total_size){
|
2023-03-26 22:12:22 +00:00
|
|
|
lockbtn = true;
|
|
|
|
tracker.style = 'color:red';
|
|
|
|
}else{
|
|
|
|
tracker.style = 'color:initial';
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
tracker.innerText = '';
|
|
|
|
}
|
|
|
|
upbtn.disabled = lockbtn;
|
|
|
|
}
|
|
|
|
window.onload = function(){
|
|
|
|
$(\"input[name*='data'][id!='data[]']\").change(function(){
|
|
|
|
updateTracker();
|
|
|
|
});
|
|
|
|
updateTracker();
|
|
|
|
}
|
|
|
|
</script>")
|
2021-12-14 18:10:15 +00:00
|
|
|
);
|
2020-01-28 21:19:59 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$page->set_title("Upload");
|
|
|
|
$page->set_heading("Upload");
|
|
|
|
$page->add_block(new NavBlock());
|
2023-06-27 10:59:39 +00:00
|
|
|
$page->add_block(new Block("Upload", $html, "main", 20));
|
2019-05-28 16:59:38 +00:00
|
|
|
if ($tl_enabled) {
|
2021-12-14 18:10:15 +00:00
|
|
|
$page->add_block(new Block("Bookmarklets", (string)$this->h_bookmarklets(), "left", 20));
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-06 15:38:53 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
protected function h_upload_list_1(): HTMLElement
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
global $config;
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list = emptyHTML();
|
2020-06-16 23:29:59 +00:00
|
|
|
$upload_count = $config->get_int(UploadConfig::COUNT);
|
|
|
|
$tl_enabled = ($config->get_string(UploadConfig::TRANSLOAD_ENGINE, "none") != "none");
|
2020-02-23 22:04:36 +00:00
|
|
|
$accept = $this->get_accept();
|
2012-03-06 15:38:53 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list->appendChild(
|
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["colspan" => $tl_enabled ? 2 : 4], "Files"),
|
|
|
|
$tl_enabled ? TD(["colspan" => "2"], "URLs") : emptyHTML(),
|
|
|
|
TD(["colspan" => "2"], "Post-Specific Tags"),
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2023-11-11 21:49:12 +00:00
|
|
|
for ($i = 0; $i < $upload_count; $i++) {
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list->appendChild(
|
|
|
|
TR(
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(["colspan" => $tl_enabled ? 2 : 4], DIV(["name" => "canceldata{$i}[]","style" => "display:inline;margin-right:5px;font-size:15px;visibility:hidden;","onclick" => "$(\"input[name='data{$i}[]']\")[0].value='';updateTracker();"], "✖"), INPUT(["type" => "file", "name" => "data{$i}[]", "accept" => $accept, "multiple" => true])),
|
|
|
|
$tl_enabled ? TD(["colspan" => "2"], INPUT(["type" => "text", "name" => "url{$i}"])) : emptyHTML(),
|
2023-12-26 12:53:46 +00:00
|
|
|
TD(["colspan" => "2"], INPUT(["type" => "text", "name" => "tags{$i}", "class" => "autocomplete_tags"])),
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2012-03-06 15:38:53 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
return $upload_list;
|
|
|
|
}
|
2012-03-06 15:38:53 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
protected function h_bookmarklets(): HTMLElement
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
global $config;
|
|
|
|
$link = make_http(make_link("upload"));
|
|
|
|
$main_page = make_http(make_link());
|
2019-08-02 19:40:03 +00:00
|
|
|
$title = $config->get_string(SetupConfig::TITLE);
|
2020-06-16 23:29:59 +00:00
|
|
|
$max_size = $config->get_int(UploadConfig::SIZE);
|
2019-05-28 16:59:38 +00:00
|
|
|
$max_kb = to_shorthand_int($max_size);
|
|
|
|
$delimiter = $config->get_bool('nice_urls') ? '?' : '&';
|
2012-03-06 12:22:08 +00:00
|
|
|
|
2023-11-11 21:49:12 +00:00
|
|
|
$js = 'javascript:(
|
2021-12-14 18:10:15 +00:00
|
|
|
function() {
|
|
|
|
if(typeof window=="undefined" || !window.location || window.location.href=="about:blank") {
|
|
|
|
window.location = "'. $main_page .'";
|
|
|
|
}
|
|
|
|
else if(typeof document=="undefined" || !document.body) {
|
|
|
|
window.location = "'. $main_page .'?url="+encodeURIComponent(window.location.href);
|
|
|
|
}
|
|
|
|
else if(window.location.href.match("\/\/'. $_SERVER["HTTP_HOST"] .'.*")) {
|
|
|
|
alert("You are already at '. $title .'!");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var tags = prompt("Please enter tags", "tagme");
|
2023-06-27 16:45:35 +00:00
|
|
|
if(tags !== "" && tags !== null) {
|
2021-12-14 18:10:15 +00:00
|
|
|
var link = "'. $link . $delimiter .'url="+location.href+"&tags="+tags;
|
|
|
|
var w = window.open(link, "_blank");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)();';
|
|
|
|
$html1 = P(
|
2023-11-11 21:49:12 +00:00
|
|
|
A(["href" => $js], "Upload to $title"),
|
2021-12-14 18:10:15 +00:00
|
|
|
rawHTML(' (Drag & drop onto your bookmarks toolbar, then click when looking at a post)')
|
|
|
|
);
|
2012-03-06 12:22:08 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
// Bookmarklet checks if shimmie supports ext. If not, won't upload to site/shows alert saying not supported.
|
2020-05-28 15:05:20 +00:00
|
|
|
$supported_ext = join(" ", DataHandlerExtension::get_all_supported_exts());
|
|
|
|
|
2019-08-02 19:40:03 +00:00
|
|
|
$title = "Booru to " . $config->get_string(SetupConfig::TITLE);
|
2019-05-28 16:59:38 +00:00
|
|
|
// CA=0: Ask to use current or new tags | CA=1: Always use current tags | CA=2: Always use new tags
|
2021-12-14 18:10:15 +00:00
|
|
|
$js = '
|
|
|
|
javascript:
|
|
|
|
var ste="'. $link . $delimiter .'url=";
|
|
|
|
var supext="'.$supported_ext.'";
|
|
|
|
var maxsize="'.$max_kb.'";
|
|
|
|
var CA=0;
|
|
|
|
void(document.body.appendChild(document.createElement("script")).src="'.make_http(get_base_href())."/ext/upload/bookmarklet.js".'")
|
|
|
|
';
|
|
|
|
$html2 = P(
|
2023-11-11 21:49:12 +00:00
|
|
|
A(["href" => $js], $title),
|
2021-12-14 18:10:15 +00:00
|
|
|
rawHTML("(Click when looking at a post page. Works on sites running Shimmie / Danbooru / Gelbooru. (This also grabs the tags / rating / source!))"),
|
|
|
|
);
|
|
|
|
|
|
|
|
return emptyHTML($html1, $html2);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2012-03-06 12:22:08 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
/**
|
|
|
|
* Only allows 1 file to be uploaded - for replacing another image file.
|
|
|
|
*/
|
|
|
|
public function display_replace_page(Page $page, int $image_id)
|
|
|
|
{
|
|
|
|
global $config, $page;
|
2020-06-16 23:29:59 +00:00
|
|
|
$tl_enabled = ($config->get_string(UploadConfig::TRANSLOAD_ENGINE, "none") != "none");
|
2020-02-23 22:04:36 +00:00
|
|
|
$accept = $this->get_accept();
|
2011-08-25 00:53:53 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list = emptyHTML(
|
|
|
|
TR(
|
|
|
|
TD("File"),
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(INPUT(["name" => "data[]", "type" => "file", "accept" => $accept]))
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
if ($tl_enabled) {
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list->appendChild(
|
|
|
|
TR(
|
|
|
|
TD("or URL"),
|
2023-11-11 21:49:12 +00:00
|
|
|
TD(INPUT(["name" => "url", "type" => "text"]))
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2011-08-25 00:53:53 +00:00
|
|
|
|
2020-06-16 23:29:59 +00:00
|
|
|
$max_size = $config->get_int(UploadConfig::SIZE);
|
2019-05-28 16:59:38 +00:00
|
|
|
$max_kb = to_shorthand_int($max_size);
|
2020-01-28 21:19:59 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$image = Image::by_id($image_id);
|
|
|
|
$thumbnail = $this->build_thumb_html($image);
|
2020-01-28 21:19:59 +00:00
|
|
|
|
2021-12-18 05:40:55 +00:00
|
|
|
$form = SHM_FORM("upload/replace/".$image_id, "POST", true);
|
2021-12-14 18:10:15 +00:00
|
|
|
$form->appendChild(emptyHTML(
|
2023-11-11 21:49:12 +00:00
|
|
|
INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]),
|
2021-12-14 18:10:15 +00:00
|
|
|
TABLE(
|
2023-11-11 21:49:12 +00:00
|
|
|
["id" => "large_upload_form", "class" => "vert"],
|
2021-12-14 18:10:15 +00:00
|
|
|
$upload_list,
|
2023-11-11 21:49:12 +00:00
|
|
|
TR(TD("Source"), TD(["colspan" => 3], INPUT(["name" => "source", "type" => "text"]))),
|
|
|
|
TR(TD(["colspan" => 4], INPUT(["id" => "uploadbutton", "type" => "submit", "value" => "Post"]))),
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
));
|
|
|
|
|
2023-06-27 10:44:46 +00:00
|
|
|
$html = emptyHTML(
|
2021-12-14 18:10:15 +00:00
|
|
|
P(
|
|
|
|
"Replacing Post ID $image_id",
|
|
|
|
BR(),
|
|
|
|
"Please note: You will have to refresh the post page, or empty your browser cache."
|
|
|
|
),
|
|
|
|
$thumbnail,
|
|
|
|
BR(),
|
|
|
|
$form,
|
2023-12-26 12:50:37 +00:00
|
|
|
$max_size > 0 ? SMALL("(Max file size is $max_kb)") : null,
|
2023-06-27 10:44:46 +00:00
|
|
|
);
|
2011-08-25 03:55:44 +00:00
|
|
|
|
2020-10-26 15:19:02 +00:00
|
|
|
$page->set_title("Replace Post");
|
|
|
|
$page->set_heading("Replace Post");
|
2019-05-28 16:59:38 +00:00
|
|
|
$page->add_block(new NavBlock());
|
2023-06-27 10:44:46 +00:00
|
|
|
$page->add_block(new Block("Upload Replacement Post", $html, "main", 20));
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2014-04-28 05:26:22 +00:00
|
|
|
|
2023-12-26 12:50:37 +00:00
|
|
|
/**
|
|
|
|
* @param int[] $image_ids
|
|
|
|
* @param UploadError[] $errors
|
|
|
|
*/
|
|
|
|
public function display_upload_status(Page $page, array $image_ids, array $errors): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
2020-10-28 20:51:34 +00:00
|
|
|
global $user;
|
|
|
|
|
2023-12-26 12:50:37 +00:00
|
|
|
if (count($errors) > 0) {
|
2019-05-28 16:59:38 +00:00
|
|
|
$page->set_title("Upload Status");
|
|
|
|
$page->set_heading("Upload Status");
|
|
|
|
$page->add_block(new NavBlock());
|
2023-12-26 12:50:37 +00:00
|
|
|
foreach($errors as $error) {
|
|
|
|
$message = $error->error;
|
|
|
|
// this message has intentional HTML in it...
|
|
|
|
$message = str_contains($message, "already has hash") ? $message : html_escape($message);
|
|
|
|
$page->add_block(new Block($error->name, $message));
|
2020-10-28 20:51:34 +00:00
|
|
|
}
|
2023-12-26 12:50:37 +00:00
|
|
|
} elseif (count($image_ids) == 0) {
|
|
|
|
$page->set_title("No images uploaded");
|
|
|
|
$page->set_heading("No images uploaded");
|
|
|
|
$page->add_block(new NavBlock());
|
|
|
|
$page->add_block(new Block("No images uploaded", "Upload attempted, but nothing succeeded and nothing failed?"));
|
|
|
|
} elseif (count($image_ids) == 1) {
|
|
|
|
$page->set_mode(PageMode::REDIRECT);
|
|
|
|
$page->set_redirect(make_link("post/view/{$image_ids[0]}"));
|
|
|
|
} else {
|
|
|
|
$page->set_mode(PageMode::REDIRECT);
|
|
|
|
$page->set_redirect(search_link(["poster={$user->name}"]));
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2021-12-14 18:10:15 +00:00
|
|
|
protected function build_upload_block(): HTMLElement
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
global $config;
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2020-02-23 22:04:36 +00:00
|
|
|
$accept = $this->get_accept();
|
2020-01-28 21:19:59 +00:00
|
|
|
|
2020-06-16 23:29:59 +00:00
|
|
|
$max_size = $config->get_int(UploadConfig::SIZE);
|
2019-05-28 16:59:38 +00:00
|
|
|
$max_kb = to_shorthand_int($max_size);
|
2023-03-26 22:12:22 +00:00
|
|
|
$max_total_size = parse_shorthand_int(ini_get('post_max_size')) - 102400; //leave room for http request data
|
|
|
|
$max_total_kb = to_shorthand_int($max_total_size);
|
2020-06-16 23:29:59 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
// <input type='hidden' name='max_file_size' value='$max_size' />
|
2021-12-18 05:40:55 +00:00
|
|
|
$form = SHM_FORM("upload", "POST", true);
|
2021-12-14 18:10:15 +00:00
|
|
|
$form->appendChild(
|
|
|
|
emptyHTML(
|
2023-11-11 21:49:12 +00:00
|
|
|
INPUT(["id" => "data[]", "name" => "data[]", "size" => "16", "type" => "file", "accept" => $accept, "multiple" => true]),
|
2023-12-26 12:53:46 +00:00
|
|
|
INPUT(["name" => "tags", "type" => "text", "placeholder" => "tagme", "class" => "autocomplete_tags", "required" => true]),
|
2023-11-11 21:49:12 +00:00
|
|
|
INPUT(["type" => "submit", "value" => "Post"]),
|
2021-12-14 18:10:15 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
return DIV(
|
2023-11-11 21:49:12 +00:00
|
|
|
["class" => 'mini_upload'],
|
2021-12-14 18:10:15 +00:00
|
|
|
$form,
|
2023-12-26 12:50:37 +00:00
|
|
|
$max_size > 0 ? SMALL("(Max file size is $max_kb)") : null,
|
|
|
|
$max_total_size > 0 ? SMALL(BR(), "(Max total size is $max_total_kb)") : null,
|
2023-11-11 21:49:12 +00:00
|
|
|
NOSCRIPT(BR(), A(["href" => make_link("upload")], "Larger Form"))
|
2021-12-14 18:10:15 +00:00
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2020-02-23 22:04:36 +00:00
|
|
|
|
2020-06-14 16:05:55 +00:00
|
|
|
protected function get_accept(): string
|
2020-02-25 12:18:47 +00:00
|
|
|
{
|
2020-06-14 16:05:55 +00:00
|
|
|
return ".".join(",.", DataHandlerExtension::get_all_supported_exts());
|
2020-02-23 22:04:36 +00:00
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|