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/resize/theme.php

34 lines
1.1 KiB
PHP
Raw Normal View History

2011-09-04 03:13:41 +00:00
<?php
class ResizeImageTheme extends Themelet {
/*
* Display a link to resize an image
*/
2012-02-10 04:04:37 +00:00
public function get_resize_html(/*int*/ $image_id) {
global $user, $config;
2011-09-04 03:13:41 +00:00
$i_image_id = int_escape($image_id);
2012-08-18 20:09:40 +00:00
$default_width = $config->get_int('resize_default_width');
$default_height = $config->get_int('resize_default_height');
2011-09-04 03:13:41 +00:00
2012-08-18 20:09:40 +00:00
$html .= "
".make_form(make_link('resize/'.$i_image_id), 'POST')."
<input type='hidden' name='image_id' value='$i_image_id'>
<input id='resize_width' style='width: auto;' size='5' name='resize_width' type='text' value='".$default_width."'> x
<input id='resize_height' style='width: auto;' size='5' name='resize_height' type='text' value='".$default_height."'>
<input id='resizebutton' type='submit' value='Resize'>
2011-09-04 03:13:41 +00:00
</form>
";
return $html;
}
2012-02-10 04:04:37 +00:00
public function display_resize_error(Page $page, /*string*/ $title, /*string*/ $message) {
$page->set_title("Resize Image");
$page->set_heading("Resize Image");
$page->add_block(new NavBlock());
2011-09-04 03:13:41 +00:00
$page->add_block(new Block($title, $message));
}
}
?>