This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/rotate/theme.php

35 lines
960 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
2020-01-26 13:19:35 +00:00
use function MicroHTML\INPUT;
2012-08-18 20:10:35 +00:00
class RotateImageTheme extends Themelet
{
/**
* Display a link to rotate an image.
*/
public function get_rotate_html(int $image_id): string
{
2020-01-26 13:19:35 +00:00
return (string)SHM_SIMPLE_FORM(
2020-01-30 10:31:11 +00:00
'rotate/'.$image_id,
2023-11-11 21:49:12 +00:00
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]),
INPUT(["type" => 'number', "name" => 'rotate_deg', "id" => "rotate_deg", "placeholder" => "Rotation degrees"]),
INPUT(["type" => 'submit', "value" => 'Rotate', "id" => "rotatebutton"]),
2020-01-26 13:19:35 +00:00
);
}
2014-04-28 06:56:58 +00:00
/**
* Display the error.
*/
public function display_rotate_error(Page $page, string $title, string $message)
{
$page->set_title("Rotate Image");
$page->set_heading("Rotate Image");
$page->add_block(new NavBlock());
$page->add_block(new Block($title, $message));
}
2012-08-18 20:10:35 +00:00
}