This commit is contained in:
Shish 2024-01-05 04:06:19 +00:00
parent 05a981d935
commit 4edf985a73
3 changed files with 19 additions and 13 deletions

View file

@ -275,9 +275,13 @@ class Notes extends Extension
$database->execute("UPDATE images SET notes=(SELECT COUNT(*) FROM notes WHERE image_id=:id) WHERE id=:id", ['id' => $note['image_id']]);
$this->add_history(
1, $noteID, $note['image_id'],
$note['x1'], $note['y1'],
$note['height'], $note['width'],
1,
$noteID,
$note['image_id'],
$note['x1'],
$note['y1'],
$note['height'],
$note['width'],
$note['note']
);

View file

@ -5,36 +5,37 @@ declare(strict_types=1);
namespace Shimmie2;
use MicroHTML\HTMLElement;
use function MicroHTML\INPUT;
class NotesTheme extends Themelet
{
public function note_button(int $image_id): HTMLElement
{
return SHM_SIMPLE_FORM("", INPUT(["type"=>"button", "value"=>"Add Note", "onclick"=>"addNewNote()"]));
return SHM_SIMPLE_FORM("", INPUT(["type" => "button", "value" => "Add Note", "onclick" => "addNewNote()"]));
}
public function request_button(int $image_id): HTMLElement
{
return SHM_SIMPLE_FORM(
"note/add_request",
INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image_id]),
INPUT(["type"=>"submit", "value"=>"Add Note Request"]),
"note/add_request",
INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]),
INPUT(["type" => "submit", "value" => "Add Note Request"]),
);
}
public function nuke_notes_button(int $image_id): HTMLElement
{
return SHM_SIMPLE_FORM(
"note/nuke_notes",
INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image_id]),
INPUT(["type"=>"submit", "value"=>"Nuke Notes", "onclick"=>"return confirm_action('Are you sure?')"]),
"note/nuke_notes",
INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]),
INPUT(["type" => "submit", "value" => "Nuke Notes", "onclick" => "return confirm_action('Are you sure?')"]),
);
}
public function nuke_requests_button(int $image_id): HTMLElement
{
return SHM_SIMPLE_FORM(
"note/nuke_requests",
INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image_id]),
INPUT(["type"=>"submit", "value"=>"Nuke Requests", "onclick"=>"return confirm_action('Are you sure?')"]),
"note/nuke_requests",
INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]),
INPUT(["type" => "submit", "value" => "Nuke Requests", "onclick" => "return confirm_action('Are you sure?')"]),
);
}

View file

@ -3,6 +3,7 @@
declare(strict_types=1);
namespace Shimmie2;
use MicroHTML\HTMLElement;
class ImageAdminBlockBuildingEvent extends Event