[dev] Dealing with picture uploads and Horde_Form_Type_image Re: [Tickets #11341] Re: Images in Sesha

Michael J Rubinsky mrubinsk at horde.org
Mon Aug 13 21:05:11 UTC 2012


Quoting Ralf Lang <lang at b1-systems.de>:

> Hi Devs,
>
> I've been struggling with Horde_Form_Type_image and I hope ansel devs
> can help me.

Ansel actually doesn't use Horde_Form_Type_image. That form type is  
really only needed when you want to display the image in the same  
form/view you use to upload it.

Turba, on the other hand, does use it to deal with the contact photo  
field. Look in Turba_Form_AddContact for more info, but basically you  
would do something like this while handling form submission in your  
Sesha_Form_* class (off the top of my head so it might not be 100%  
correct):

<code>
$this->getInfo($this->_vars, $info);
foreach ($info['object'] as $val) {
   // Need to add some conditionals to make sure this is an image field etc...
   // $val['info']['file] will contain the local path to the uploaded image.
   // $val['info']['type'] should contain the mime type
}
</code>


> A user reported he cannot save image type properties in Sesha and he
> is right. Sesha has no kind of Vfs or external api to put the image.
>
> When I process a form containing a Horde_Form_Type_image, how should I
> retrieve the relevant data?
>
> The form field only seems to return an array containing a key 'hash'.
>
> I figure this somehow leads to the image in temp storage but how can I
> access it?
>
> And how do I feed an image back into a form field of type "image" ?
>
>
> Am 13.08.2012 18:51, schrieb bugs at horde.org:
>> Ticket URL: http://bugs.horde.org/ticket/11341
>> ------------------------------------------------------------------------------
>>
>>  Ticket             | 11341 Updated By         | Ralf Lang (B1
>> Systems GmbH) <lang at b1-systems.de> Summary            | Images in
>> Sesha Queue              | Sesha Version            | 1.0.0beta1
>
>
>> Ralf Lang (B1 Systems GmbH) <lang at b1-systems.de> (2012-08-13 18:51)
>> wrote:
>>
>> Confirmed - Image properties are not saved. Investigating.
>
> - --
> Ralf Lang
> Linux Consultant / Developer
> Tel.: +49-170-6381563
> Mail: lang at b1-systems.de
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537


-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org



More information about the dev mailing list