[rt #1290] set the eimage variable to the image being edited
authorTony Cook <tony@develop-help.com>
Fri, 27 Apr 2012 09:09:50 +0000 (19:09 +1000)
committerTony Cook <tony@develop-help.com>
Fri, 27 Apr 2012 09:09:50 +0000 (19:09 +1000)
Changes.txt
site/cgi-bin/modules/BSE/Edit/Article.pm
site/templates/admin/image_edit.tmpl

index 64c10239b60b59cfb84a87f60a8b060017bcec1e..2826290fe8bb0a900d675c9a84abca3094207bf0 100644 (file)
@@ -34,6 +34,10 @@ Enhancements:
 
  - bsexlsprod.pl can now update tiered pricing
 
+ - make the eimage variable available on the admin/image_edit template
+   and use it to display a thumbnail.
+   https://rt4.develop-help.com/Ticket/Display.html?id=1290
+
 Templates:
 
  - admin/order_detail.tmpl - the product tag now uses tag_article as
index 8df12c7304540ebf66b337d7505d49091bacc9fa..e1a61021514abb15421a7bed4fec65634360ab4c 100644 (file)
@@ -15,7 +15,7 @@ use DevHelp::Date qw(dh_parse_date dh_parse_sql_date);
 use List::Util qw(first);
 use constant MAX_FILE_DISPLAYNAME_LENGTH => 255;
 
-our $VERSION = "1.025";
+our $VERSION = "1.026";
 
 =head1 NAME
 
@@ -3529,6 +3529,30 @@ sub req_thumb {
   }
 }
 
+=item edit_image
+
+Display a form to allow editing an image.
+
+Tags:
+
+=over
+
+=item *
+
+eimage - the image being edited
+
+=item *
+
+normal article edit tags.
+
+=back
+
+Variables:
+
+eimage - the image being edited.
+
+=cut
+
 sub req_edit_image {
   my ($self, $req, $article, $articles, $errors) = @_;
 
@@ -3543,6 +3567,8 @@ sub req_edit_image {
     or return $self->edit_form($req, $article, $articles,
                               "You don't have access to save image information for this article");
 
+  $req->set_variable(eimage => $image);
+
   my %acts;
   %acts =
     (
index 82a89b3a3a1db88101b50a64a7ad6e35d2863d03..aebfa6ffd2f2588d5fcfb2b7c4bce2535f921332 100644 (file)
@@ -17,7 +17,8 @@
 <table class="editform editformsmall">
   <tr> 
     <th>Replacement image file:</th>
-    <td><input type="file" name="image" size="40" /><br />(leave blank to keep the current image)</td>
+    <td><input type="file" name="image" size="40" /><br />(leave blank to keep the current image)
+<:= eimage.thumb("geo", "editor") :></td>
      <td class="help"><:help image image:> <:error_img image:></td>
   </tr>
   <tr>