2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2023-01-10 22:44:09 +00:00
|
|
|
|
|
|
|
namespace Shimmie2;
|
|
|
|
|
2020-06-02 23:08:24 +00:00
|
|
|
use function MicroHTML\INPUT;
|
|
|
|
|
|
|
|
class PrivateImageTheme extends Themelet
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public function get_image_admin_html(Image $image): string
|
2020-06-02 23:08:24 +00:00
|
|
|
{
|
2023-11-11 21:49:12 +00:00
|
|
|
if ($image->private === false) {
|
2020-06-02 23:08:24 +00:00
|
|
|
$html = SHM_SIMPLE_FORM(
|
|
|
|
'privatize_image/'.$image->id,
|
2023-11-11 21:49:12 +00:00
|
|
|
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image->id]),
|
2020-06-02 23:08:24 +00:00
|
|
|
SHM_SUBMIT("Make Private")
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$html = SHM_SIMPLE_FORM(
|
|
|
|
'publicize_image/'.$image->id,
|
2023-11-11 21:49:12 +00:00
|
|
|
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image->id]),
|
2020-06-02 23:08:24 +00:00
|
|
|
SHM_SUBMIT("Make Public")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (string)$html;
|
|
|
|
}
|
|
|
|
|
2021-03-14 23:43:50 +00:00
|
|
|
public function get_help_html(): string
|
2020-06-02 23:08:24 +00:00
|
|
|
{
|
2020-10-26 15:17:47 +00:00
|
|
|
return '<p>Search for posts that are private/public.</p>
|
2020-06-02 23:08:24 +00:00
|
|
|
<div class="command_example">
|
|
|
|
<pre>private:yes</pre>
|
2020-10-26 15:17:47 +00:00
|
|
|
<p>Returns posts that are private, restricted to yourself if you are not an admin.</p>
|
2020-06-02 23:08:24 +00:00
|
|
|
</div>
|
|
|
|
<div class="command_example">
|
|
|
|
<pre>private:no</pre>
|
2020-10-26 15:17:47 +00:00
|
|
|
<p>Returns posts that are public.</p>
|
2020-06-02 23:08:24 +00:00
|
|
|
</div>
|
|
|
|
';
|
|
|
|
}
|
|
|
|
}
|