2010-01-05 11:07:13 +00:00
|
|
|
<?php
|
2012-08-18 20:56:35 +01:00
|
|
|
class ImageIOTheme extends Themelet {
|
2011-09-03 16:03:21 -04:00
|
|
|
/**
|
2010-01-05 11:07:13 +00:00
|
|
|
* Display a link to delete an image
|
2011-08-12 22:02:41 -04:00
|
|
|
* (Added inline Javascript to confirm the deletion)
|
2010-01-05 11:07:13 +00:00
|
|
|
*
|
2014-04-24 22:29:29 -04:00
|
|
|
* @param $image_id integer The image to delete
|
|
|
|
* @return string
|
2010-01-05 11:07:13 +00:00
|
|
|
*/
|
2017-09-19 18:55:43 +01:00
|
|
|
public function get_deleter_html(int $image_id) {
|
2012-03-15 05:49:24 +00:00
|
|
|
$html = "
|
2012-04-01 16:06:11 +01:00
|
|
|
".make_form(make_link("image/delete"))."
|
2012-03-15 05:49:24 +00:00
|
|
|
<input type='hidden' name='image_id' value='$image_id' />
|
|
|
|
<input type='submit' value='Delete' onclick='return confirm(\"Delete the image?\");' />
|
|
|
|
</form>
|
|
|
|
";
|
2011-09-03 16:45:56 -04:00
|
|
|
|
|
|
|
return $html;
|
2011-09-03 16:03:21 -04:00
|
|
|
}
|
2014-04-24 22:29:29 -04:00
|
|
|
|
2011-09-03 16:03:21 -04:00
|
|
|
/**
|
|
|
|
* Display link to replace the image
|
|
|
|
*
|
2014-04-24 22:29:29 -04:00
|
|
|
* @param $image_id integer The image to replace
|
|
|
|
* @return string
|
2011-09-03 16:03:21 -04:00
|
|
|
*/
|
2017-09-19 18:55:43 +01:00
|
|
|
public function get_replace_html(int $image_id) {
|
2012-04-01 16:06:11 +01:00
|
|
|
$html = make_form(make_link("image/replace"))."
|
2011-09-03 16:03:21 -04:00
|
|
|
<input type='hidden' name='image_id' value='$image_id' />
|
2011-08-24 23:55:44 -04:00
|
|
|
<input type='submit' value='Replace' />
|
2011-09-03 16:03:21 -04:00
|
|
|
</form>";
|
2010-01-05 11:07:13 +00:00
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
}
|
2014-04-24 22:28:53 -04:00
|
|
|
|