2007-06-30 01:19:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class RegenThumbTheme extends Themelet {
|
2014-04-28 02:56:58 -04:00
|
|
|
/**
|
2007-07-28 20:30:01 +00:00
|
|
|
* Show a form which offers to regenerate the thumb of an image with ID #$image_id
|
2014-04-28 02:56:58 -04:00
|
|
|
*
|
|
|
|
* @param int|string $image_id
|
|
|
|
* @return string
|
2007-07-28 20:30:01 +00:00
|
|
|
*/
|
2008-06-14 11:36:19 +00:00
|
|
|
public function get_buttons_html($image_id) {
|
|
|
|
return "
|
2017-06-01 20:44:17 +01:00
|
|
|
".make_form(make_link("regen_thumb/one"))."
|
2007-06-30 01:19:11 +00:00
|
|
|
<input type='hidden' name='image_id' value='$image_id'>
|
2014-12-14 16:07:00 -08:00
|
|
|
<input type='submit' value='Regenerate Thumbnail'>
|
2007-06-30 01:19:11 +00:00
|
|
|
</form>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2014-04-28 02:56:58 -04:00
|
|
|
/**
|
|
|
|
* Show a link to the new thumbnail.
|
|
|
|
*
|
|
|
|
* @param Page $page
|
|
|
|
* @param Image $image
|
2007-07-28 20:30:01 +00:00
|
|
|
*/
|
2009-01-04 11:54:16 -08:00
|
|
|
public function display_results(Page $page, Image $image) {
|
2007-06-30 01:19:11 +00:00
|
|
|
$page->set_title("Thumbnail Regenerated");
|
|
|
|
$page->set_heading("Thumbnail Regenerated");
|
2011-08-28 00:31:30 -04:00
|
|
|
$page->add_html_header("<meta http-equiv=\"cache-control\" content=\"no-cache\">");
|
2007-06-30 01:19:11 +00:00
|
|
|
$page->add_block(new NavBlock());
|
2007-10-26 01:35:53 +00:00
|
|
|
$page->add_block(new Block("Thumbnail", $this->build_thumb_html($image)));
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|
2017-06-01 20:44:17 +01:00
|
|
|
|
|
|
|
public function mtr_html($terms) {
|
|
|
|
$h_terms = html_escape($terms);
|
|
|
|
$html = make_form(make_link("regen_thumb/mass"), "POST") . "
|
|
|
|
<input type='hidden' name='tags' value='$h_terms'>
|
|
|
|
<input type='submit' value='Regen all thumbs' onclick='return confirm(\"This can use a lot of CPU time.\\nAre you sure you want to do this?\")'>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
return $html;
|
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|
2014-04-25 22:54:51 -04:00
|
|
|
|