fix saving images to the image api from IMP
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Jun 2010 18:54:52 +0000 (14:54 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Jun 2010 18:54:52 +0000 (14:54 -0400)
imp/lib/Contents.php
imp/saveimage.php
imp/templates/saveimage/saveimage.html

index ec27ff8..9526ee9 100644 (file)
@@ -669,7 +669,7 @@ class IMP_Contents
         if (($mask & self::SUMMARY_IMAGE_SAVE) &&
             $GLOBALS['registry']->hasMethod('images/selectGalleries') &&
             ($mime_part->getPrimaryType() == 'image')) {
-            $part['img_save'] = Horde::link('#', _("Save Image in Gallery"), 'saveImgAtc', null, Horde::popupJs(Horde::applicationUrl('saveimage.php'), array('params' => array('mbox' => $this->_mailbox, 'uid' => $this->_uid, 'id' => $id), 'height' => 200, 'width' => 450)) . 'return false;') . '</a>';
+            $part['img_save'] = Horde::link('#', _("Save Image in Gallery"), 'saveImgAtc', null, Horde::popupJs(Horde::applicationUrl('saveimage.php'), array('params' => array('mbox' => $this->_mailbox, 'uid' => $this->_uid, 'id' => $id), 'height' => 200, 'width' => 450, 'urlencode' => true)) . 'return false;') . '</a>';
         }
 
         /* Add print link? */
index 90e4c42..aece591 100644 (file)
@@ -30,7 +30,7 @@ case 'save_image':
         'type' => $mime_part->getType()
     );
     try {
-        $registry->images->saveImage(null, $vars->gallery, $image_data);
+        $registry->images->saveImage($vars->gallery, $image_data);
     } catch (Horde_Exception $e) {
         $notification->push($e);
         break;
@@ -50,6 +50,7 @@ $t->setOption('gettext', true);
 $t->set('action', Horde::applicationUrl('saveimage.php'));
 $t->set('id', htmlspecialchars($vars->id));
 $t->set('uid', htmlspecialchars($vars->uid));
+$t->set('mbox', htmlspecialchars($vars->mbox));
 $t->set('image_img', Horde::img('mime/image.png', _("Image")));
 
 /* Build the list of galleries. */
index 92a7e09..f9617b2 100644 (file)
@@ -2,6 +2,7 @@
 <input type="hidden" name="actionID" value="save_image" />
 <input type="hidden" name="id" value="<tag:id />" />
 <input type="hidden" name="uid" value="<tag:uid />" />
+<input type="hidden" name="mbox" value="<tag:mbox />" />
 
 <h1 class="header">
  <tag:image_img />