[symfony-users] Where is the configuration in Symfony 1.3/1.4 for sf_upload_dir?

2009-12-23 Thread Dennis
I looked on the web and in this group and did not find it. I found how
it WAS done in 1.0/1.1, but nothing else.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: How to declare an array of input field with sfForm?

2009-12-23 Thread Dennis
I wonder if while returning an array of files via ajax, to a form that
that only expects a single file, (no array of file validators), if it
will validate?

Perhaps making a form that has multiple widgets but only one validator
of the same name might be a good test, (Providing Symfony doesn't
check for mismatched validators for widgets)?

On Nov 16, 10:45 am, "Jesse B. Hannah"  wrote:
> One way to do this is with embedded forms. A good example is available
> athttp://trac.symfony-project.org/ticket/4906#comment:13, but here's
> a quick rundown of it:
>
> $form = new sfForm();
> for ($i = 1; $i <= 5; $i++) {
>  $form->widgetSchema[$i] = new sfWidgetFormInputFile();
>  $form->widgetSchema->setLabel($i, 'File ' . $i);}
>
> $this->embedForm('upload', $form);
> $this->widgetSchema->setLabel('upload', 'Upload files');
>
> How this will look in the view (you can use the debug inspector in
> 1.3) is there'll be a field $form['upload'], and then each file widget
> will be $form['upload'][1] through $form['upload'][5]. You can also
> start with just one input widget and then use jQuery to add more input
> widgets to the embedded form (I can't give an example right now
> because I'm still figuring out how to do this).
>
> A couple more pages with some good discussion on embedded forms:
>
> http://blog.barros.ws/2009/01/01/using-embedformforeach-in-symfony-pa...
> (focuses on multiple embedded forms using embedFormForEach, but still
> a good overview of the 
> concept)http://www.symfony-project.org/blog/2008/11/12/call-the-expert-custom...
>
> --jbh
>
> Jesse B. Hannah
>
> On Nov 14, 1:02 pm, Sid Bachtiar  wrote:
>
> > Hi,
>
> > How to declare an array of input field in sfForm? Is this where
> > embedded form come in?
>
> > In this case I want to use jquery MultiUpload library but it works by
> > creating upload fields with the same field name, so when the form is
> > uploaded, it will be as array.
>
> > Cheers,
>
> > Sid
> > --
> > Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
>
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] How to delete uploaded images when deleting records

2009-12-23 Thread Serkan Koyuncu
Hi,
If you're using Doctrine, you can create

public function postDelete($event) {

@unlink(sfConfig::get('sf_upload_dir').'/immobili/original/'.$this->fotoPrincipale);

@unlink(sfConfig::get('sf_upload_dir').'/immobili/big/'.$this->fotoPrincipale);
}

in your model file.
If you're using Propel, you can extend delete method of your model
file or create another behaviour.

Thanks.


2009/12/23 ilcaduceo :
> Hi all, I've a simple form with sfFormWidgetInputFileEditable for
> simple upload of photos:
>
> $this->validatorSchema['fotoPrincipale'] = new sfValidatorFile(array(
>                'required'   => false,
>                'path'       => 
> sfConfig::get('sf_upload_dir').'/immobili/original',
>                'mime_types' => 'web_images',
>                'validated_file_class' => 'sfResizedFile'
> ));
>
> $this->widgetSchema['fotoPrincipale'] = new
> sfWidgetFormInputFileEditable(array(
>      'label'     => 'Foto principale',
>      'file_src'  => '/uploads/immobili/big/'.$this->getObject()-
>>getFotoPrincipale(),
>      'is_image'  => true,
>      'edit_mode' => !$this->isNew(),
>          'with_delete' => false,
>      'template'  => '%file%%input%%delete%
> %delete_label%'
> ));
>
> I've also an admin generated backend interface, but I want to delete
> the photo uploaded when the record is deleted.
>
> How to this? Thanks for help me...
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> symfony-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] How to delete uploaded images when deleting records

2009-12-23 Thread Parijat Kalia
I did not go through your code, how are you storing images in the db, using
file paths?

On Wed, Dec 23, 2009 at 7:54 AM, ilcaduceo  wrote:

> Hi all, I've a simple form with sfFormWidgetInputFileEditable for
> simple upload of photos:
>
> $this->validatorSchema['fotoPrincipale'] = new sfValidatorFile(array(
>'required'   => false,
>'path'   =>
> sfConfig::get('sf_upload_dir').'/immobili/original',
>'mime_types' => 'web_images',
>'validated_file_class' => 'sfResizedFile'
> ));
>
> $this->widgetSchema['fotoPrincipale'] = new
> sfWidgetFormInputFileEditable(array(
>  'label' => 'Foto principale',
>  'file_src'  => '/uploads/immobili/big/'.$this->getObject()-
> >getFotoPrincipale(),
>  'is_image'  => true,
>  'edit_mode' => !$this->isNew(),
>  'with_delete' => false,
>  'template'  => '%file%%input%%delete%
> %delete_label%'
> ));
>
> I've also an admin generated backend interface, but I want to delete
> the photo uploaded when the record is deleted.
>
> How to this? Thanks for help me...
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: widgets's javascripts and stylesheets aren't included on layout using sf1.3

2009-12-23 Thread Tomasz Sikora
That's why component/partial is being called in view AFTER calling
include_javascripts();

On 10 Gru, 21:17, Nei Rauni Santos  wrote:
> If I add this line on layout.php
>
>  var_dump( sfContext::getInstance()->getResponse()->getStylesheets() );
> ?>
>
> I get the dump:
>
> *array*
>
>   'frontend/frontend' =>
>     *array*
>       *empty*
>   'frontend/frontend-print' =>
>     *array*
>
>       'media' => string 'print' *(length=5)*
>   'frontend/frontend-handheld' =>
>
>     *array*
>       'media' => string 'handheld' *(length=8)*
>   'frontend/frontend-iphone' =>
>
>     *array*
>       'media' => string 'only screen and (max-device-width: 480px)'
> *(length=41)*
>
> If I put the same code inside my partial It show one more css included
> by partial.
>
> *array*
>   'frontend/frontend' =>
>     *array*
>       *empty*
>   'frontend/frontend-print' =>
>
>     *array*
>       'media' => string 'print' *(length=5)*
>   'frontend/frontend-handheld' =>
>
>     *array*
>       'media' => string 'handheld' *(length=8)*
>   'frontend/frontend-iphone' =>
>
>     *array*
>       'media' => string 'only screen and (max-device-width: 480px)'
> *(length=41)*
>   'autosuggest/autocomplete' =>
>     *array*
>       'media' => string 'all' *(length=3)*
>
> my partial code:
>
> 
> 
>
> 
>  var_dump( sfContext::getInstance()->getResponse()->getStylesheets() );
> ?>
> 
>
> 
> ...
>
> I think that it's a but..
>
> Nei
>
> On Thu, Dec 10, 2009 at 5:31 PM, Nei Rauni Santos  wrote:
>
> > I notice that this way was wrong, and on my widget I put thow 2 methods:;
>
> >   /**
> >    * Gets the stylesheet paths associated with the widget.
> >    *
> >    * @return array An array of stylesheet paths
> >    */
> >   public function getStylesheets()
> >   {
> >     return array('/sfFormExtraPlugin/css/jquery.autocompleter.css' =>
> > 'all');
> >   }
>
> >   /**
> >    * Gets the JavaScript paths associated with the widget.
> >    *
> >    * @return array An array of JavaScript paths
> >    */
> >   public function getJavascripts()
> >   {
> >     return array('/sfFormExtraPlugin/js/jquery.autocompleter.js');
> >   }
>
> > but It didn't work yet...
>
> > If I put these  lines on partial symfony print the 

[symfony-users] How to delete uploaded images when deleting records

2009-12-23 Thread ilcaduceo
Hi all, I've a simple form with sfFormWidgetInputFileEditable for
simple upload of photos:

$this->validatorSchema['fotoPrincipale'] = new sfValidatorFile(array(
'required'   => false,
'path'   => 
sfConfig::get('sf_upload_dir').'/immobili/original',
'mime_types' => 'web_images',
'validated_file_class' => 'sfResizedFile'
));

$this->widgetSchema['fotoPrincipale'] = new
sfWidgetFormInputFileEditable(array(
  'label' => 'Foto principale',
  'file_src'  => '/uploads/immobili/big/'.$this->getObject()-
>getFotoPrincipale(),
  'is_image'  => true,
  'edit_mode' => !$this->isNew(),
  'with_delete' => false,
  'template'  => '%file%%input%%delete%
%delete_label%'
));

I've also an admin generated backend interface, but I want to delete
the photo uploaded when the record is deleted.

How to this? Thanks for help me...

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Passing a file to a form class without a form submission

2009-12-23 Thread andreas
In fact the tmp file is both the easiest and the cleanest way. It's
just 2 or 3 lines of code and it completely separates the form from
the specifics of how flash posts file data.

That is, if you really need a symfony form for this - if you are
posting a true ByteArray, there is only the raw post data as flash
cannot send other post params besides the ByteArray. In this case, an
sfForm is probably overkill.

If you *do* need to send other post parameters along with the file
data, you will need to post your ByteArray as an Base64 encoded
string. In this case the best option is to write a validator extending
sfFileValidator. You new validator should encapsulate the decoding of
the base64 string and the tmp file logic, and you can then use symfony
forms seamlessly with any data posted from Flash.

Cheers,
Andreas


On 23 Dez., 15:47, isleshocky77  wrote:
> So I'm just changing the subject on this cause it really is how I can
> get a file which I have passed in as a byteArray from flash to be used
> by a form class. Not sure if I should manually save it to a tmp file
> first and the pass an array to the form class with the proper
> information or there is an easier and cleaner way to do this.
>
> Thanks for any help.
>
> --
> Stephen Ostrow
>
> On Dec 22, 5:56 pm, isleshocky77  wrote:
>
>
>
> > I'm using ZendAMF with symfony and having a form in flash submit
> > information to a service in symfony. I wanted to know if anyone had
> > best practices for doing something like this.  It does include a file
> > which is where I'm running into the problems.
>
> > So far I have this:http://isleshocky77.pastebin.com/f1434534c
>
> >   /**
> >    * Uploads an Image and sets its information
> >    *
> >    * @param array     $image_array    The Image which contains all
> > information about the Image
> >    * @param byteArray $image_file     The image file as a byteArray
> >    *
> >    * @todo Complete and test
> >    *
> >    */
> >   public function upload($image_array, $image_file)
> >   {
> >     $ImageForm = new ImageServiceImageForm();
>
> >     # Do something with image file
> >     # @todo
>
> >     $ImageForm->bind($image, $image_file);
>
> >     if ($ImageForm->isValid()) {
> >       $ImageForm->save();
> >       return "Success";
> >     } else {
> >       return "Error";
> >     }
>
> >   }
>
> > Thanks for any help
>
> > --
> > Stephen Ostrow

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] sf 1.2 sfPropelActAsCommentableBehaviorPlugin routing issue

2009-12-23 Thread Lucas Peres
Hi,

Done a quick search, but couldn't find anything related.


I'm having some routing issues using
sfPropelActAsCommentableBehaviorPlugin.

i'm accessing my commentable object using a sfPropelRoute route, and
if i post the a blank comment, the plugin action (which uses sfRoute)
tries to forward back to the referer action (sfPropelRoute), but then
i get: Call to undefined method sfRoute::getObject(). Doing a bit of
instroinspection the route object ($this->getRoute()) when forwarded
back is now sfRoute instead of sfPropelRoute.

Whats the best way to deal if this situation ? Or am i missing
something ?


Thanks

Lucas

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Embed sfGuard Login Form into layout

2009-12-23 Thread blissdrop
Good day to all.

I'm searching the way to embed sfGuard login form into my layout
template to display login form on my homepage. I've tried do it like
this in my component:

> $class = sfConfig::get('app_sf_guard_plugin_signin_form', 
> 'sfGuardFormSignin');
> $this->form = new $class();

I've taken it from BasesfGuardAuthActions.class.php, but symfony
throws an exception:

> Call to undefined method BasesfGuardFormSignin::getObject.

Any other ways?

Thanks

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Admin generator - order by i18n field

2009-12-23 Thread 3lancer.eu
Hello,

I have such a schema:

Flatpage:
  actAs:
I18n:
  fields: [ title, content ]
  actAs:
Sluggable: { fields: [ title ], uniqueBy: [ lang, title ] }
Sortable: ~
Timestampable: ~
  columns:
id: { type: integer(4), primary: true, autoincrement: true }
title: { type: string(50), notnull: true }
content: { type: string(10) }
is_active: { type: boolean, default: true, notnull: true }
  indexes:
is_active_idx:
  fields: [ is_active ]

An in generator.yml:

...
  list:
table_method:  retrieveBackendFlatpageList
display:   [=title, slug, =is_active]
sort:  [title, asc]
object_actions:
toggle:~
_edit: ~
_delete:   ~
...

Now I'd like to make it possible for a admin user to sort by title or
slug column, which are being translated. At this moment it is possible
to sort only by is_active column - title and slug headers are not
clickable. However, default sorting by title seems to work fine.

Thanks in advance for your help.

Regards,
Piotr

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Can't access slots in partials (with cache enabled)

2009-12-23 Thread andrian
Thanks for the info.
I had the same problem with latest stable 1.2 release. After patching
the render function everything seems to work fine.
I still don't know why it's not included in the core release...

On Dec 21, 10:05 pm, "Paulo Magalhães"  wrote:
> Bumping up this as it is a major bug on the stable releases and seems to
> not be getting enough attention: slots are _not_ working when cache is
> enable.
>
> Two tickets on this:
>
> http://trac.symfony-project.org/ticket/4185http://trac.symfony-project.org/ticket/5958
>
> Reproducible on 1.3.1 as well.
>
> Proposed patches do fix the issue for accessing slots from within
> partials, but introduce issues when including slots in the app main layout.
>
> Is this being looked on?
>
> Regards,
> PM
>
> wissl wrote:
> > This is an issue since more than half a year now... There was (is?) a
> > ticket in trac with a working patch, I don't know why it isn't merged
> > into core...
>
> > On 16 Dez., 09:20, Matthias Pfefferle  wrote:
> >> Thats exactly my problem, Pablo!
>
> >> I have enabled the cache (settings.yml) but the files which are
> >> affected by this problem are all excluded from the caching
> >> (cache.yml).
>
> >> Example: I extracted the whole er to a partial (because every
> >> layout should use the same header-informations). In this partial there
> >> are several slots to display special meta-informations for specific
> >> actions.
>
> >> The layout code:
>
> >>  >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> >> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
> >> dir="ltr">
> >> 
> >> [...]
> >> 
>
> >> The partial code:
>
> >> http://purl.org/uF/2008/03/
> >>                http://microformats.org/wiki/xfolk-profile
> >>                 >> ('profile_uri'); } ?>
> >>   [...]
> >> 
>
> >> If the cache is disabled (settings.yml), everything works fine and the
> >> partial shows the "profile_uri"-slot without any problems. If I enable
> >> the cache (settings.yml), the "has_slot('profile_uri')" returns false.
> >> If I paste the patial-code directly into the layout, everything works
> >> fine (with and without caching enabled (settings.yml)).
>
> >> I reproduced this phenomenon also with normal templates. If the slot
> >> is directly in the template, I got no problems, if it is used in a
> >> partial the has_slot returns false.
>
> >> On Dec 16, 12:26 am, Pablo Godel  wrote:
>
> >>> If I understand your problem correctly, it is the whole purpose of 
> >>> enabling
> >>> caching, so certain parts of your code don't get ran.
> >>> Pablo
> >>> On Tue, Dec 15, 2009 at 12:03 PM, Matthias Pfefferle 
> >>> wrote:
>  I can't access slots in partials with enabled symfony caching (symfony
>  1.2.10)... does anyone had similar problems? Is there a way to
>  workaround?
>  --
>  You received this message because you are subscribed to the Google Groups
>  "symfony users" group.
>  To post to this group, send email to symfony-us...@googlegroups.com.
>  To unsubscribe from this group, send email to
>  symfony-users+unsubscr...@googlegroups.com
>  .
>  For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "symfony users" group.
> > To post to this group, send email to symfony-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > symfony-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/symfony-users?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] set error communicates

2009-12-23 Thread alexmm
If I have in Base some form class:

$this->setValidators(array(
  ..
  'price' => new sfValidatorNumber(),
  ..
));

How can I change error communicate for field 'price' in class which
extends Base some form class ?
I must again write validators with arrays inside with new communicates
of errors:

$this->setValidator('price', array(), array('required' => 'my error',
'invalid' => 'my error'));

???

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Error using sfFacebookConnectPlugin and sfGuardPlugin

2009-12-23 Thread Andrés Cristi
Currently i'm having a similar problem.
I'm working with symfony 1.4+sfDoctrineGuardPlugin.
My problem is that the the user seems to be null, so when it is saved
to the database, the username is saved like Facebook_, when it should
be something like "Facebook_".$FacebookUserId.
I've read the documentation from the advent calendar and i still
haven't found how to solve this.

Cheers,
Andrés

On 8 dic, 23:27, Hardeep Khehra  wrote:
> Not sure what I'm doing wrong, but for starters i'm beginning a fresh
> project using symfony 1.4, but I can't get this plugin to work for the
> life of me.
>
> I've followed all the instructions and cannot get this plugin to work
> using sfDoctrineGuardPlugin.
>
> The facebook dialog appears and i can log into facebook, but the user
> is never added to the database.
>
> I installed the plugin by downloading the packaging and unzipping to
> the plugins folder.
>
> On Dec 8, 7:46 am, Fabrice Bernhard  wrote:
>
>
>
> > Hi Zach,
>
> > You don't need any sfFacebookConnect filters in a standard
> > implementation.
>
> > Better documentation will soon be online as part of the symfony 2009
> > advent calendar :-)
>
> > Cheers,
>
> > Fabrice
> > --http://www.theodo.fr
>
> > On Dec 8, 7:28 am, Alexandre Salomé 
> > wrote:
>
> > > Hi,
>
> > >   You should contact the author of the plugin to have more informations, 
> > > or
> > > look for a README file or an INSTALL file.
>
> > > Alexandre
>
> > > 2009/12/7 Zach 
>
> > > > I have run into another error...
>
> > > > I am running the sfFacebookConnectDemo. It prompts me to connect, I
> > > > enter my facebook email and password, click connect, and I get this
> > > > error:
>
> > > > Strict Standards: Non-static method
> > > > sfFacebookGuardAdapter::getUserProfileProperty() should not be called
> > > > statically, assuming $this from incompatible context in /var/www/
> > > > losebig/plugins/sfFacebookConnectPlugin/lib/
> > > > sfFacebookApplicationFilter.class.php on line 25
>
> > > > Fatal error: Cannot call abstract method
> > > > sfFacebookGuardAdapter::getUserProfileProperty() in /var/www/losebig/
> > > > plugins/sfFacebookConnectPlugin/lib/
> > > > sfFacebookApplicationFilter.class.php on line 25
>
> > > > If I refresh the page, it says "Welcome Zach Fry" and has my facebook
> > > > profile picture. I'm not sure how I am supposed implement the filters,
> > > > and wondered if someone could show me what the filters.yml file is
> > > > supposed to look like. I don't really know where my problem lies, but
> > > > I thought it might be the filters since I didn't know what I was doing
> > > > when I implemented those. here is my current file:
>
> > > > rendering: ~
> > > > web_debug: ~
>
> > > > facebook_connect:
> > > >  class: sfFacebookConnectFilter
>
> > > > security:
> > > >  class: sfGuardBasicSecurityFilter
>
> > > > facebook_application:
> > > >  class: sfFacebookApplicationFilter
>
> > > > sfFacebookConnectRememberMe:
> > > >  class: sfFacebookConnectRememberMeFilter
>
> > > > #sfFacebookSecurity:
> > > > #  class: sfFacebookSecurityFilter
>
> > > > cache:     ~
> > > > common:    ~
> > > > flash:     ~
> > > > execution: ~
>
> > > > Thanks for your help.
> > > > I've been struggling getting all this to work right.
>
> > > > On Dec 3, 5:27 pm, Fabrice Bernhard  wrote:
> > > > > Great you managed to solve your problem, although it would have been
> > > > > nice to actually see what you did wrong.
>
> > > > > Cheers,
>
> > > > > Fabrice
> > > > > --http://www.theodo.fr
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "symfony users" group.
> > > > To post to this group, send email to symfony-us...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > symfony-users+unsubscr...@googlegroups.com > > >  legroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/symfony-users?hl=en.
>
> > > --
> > > Alexandre Salomé -- alexandre.sal...@gmail.com- Hide quoted text -
>
> > - Show quoted text -

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Passing a file to a form class without a form submission

2009-12-23 Thread Daniel Lohse
Please have a look at the symfony unit tests. This should be tested somewhere 
in the form class unit tests. I definitely saw that but I'm too lazy right now 
to have a look, sorry.

Daniel

On Dec 23, 2009, at 3:47 PM, isleshocky77 wrote:

> So I'm just changing the subject on this cause it really is how I can
> get a file which I have passed in as a byteArray from flash to be used
> by a form class. Not sure if I should manually save it to a tmp file
> first and the pass an array to the form class with the proper
> information or there is an easier and cleaner way to do this.
> 
> Thanks for any help.
> 
> --
> Stephen Ostrow
> 
> On Dec 22, 5:56 pm, isleshocky77  wrote:
>> I'm using ZendAMF with symfony and having a form in flash submit
>> information to a service in symfony. I wanted to know if anyone had
>> best practices for doing something like this.  It does include a file
>> which is where I'm running into the problems.
>> 
>> So far I have this:http://isleshocky77.pastebin.com/f1434534c
>> 
>>   /**
>>* Uploads an Image and sets its information
>>*
>>* @param array $image_arrayThe Image which contains all
>> information about the Image
>>* @param byteArray $image_file The image file as a byteArray
>>*
>>* @todo Complete and test
>>*
>>*/
>>   public function upload($image_array, $image_file)
>>   {
>> $ImageForm = new ImageServiceImageForm();
>> 
>> # Do something with image file
>> # @todo
>> 
>> $ImageForm->bind($image, $image_file);
>> 
>> if ($ImageForm->isValid()) {
>>   $ImageForm->save();
>>   return "Success";
>> } else {
>>   return "Error";
>> }
>> 
>>   }
>> 
>> Thanks for any help
>> 
>> --
>> Stephen Ostrow
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> symfony-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/symfony-users?hl=en.
> 
> 

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: sfWidgetFormI18nChoiceCountry has continents

2009-12-23 Thread Salim
Done. http://trac.symfony-project.org/ticket/7990

On 23 déc, 16:24, Salim  wrote:
> I have the same problem. After some searches I found out that there
> was no way to exclude continents from the list. We should better open
> a ticket !
>
> On 18 déc, 11:56, Massimiliano Arione  wrote:
>
>
>
> > the new sfWidgetFormI18nChoiceCountry (symfony 1.4) has continents
> > among countries.
> > So, in the list there's something like "Europe", "Asia", but also
> > "Eastern Europe" and so on.
> > My doubts:
> > 1) is there a way (maybe an option?) to exclude such entries? I would
> > like a clean list, with only countries.
> > 2) if first is not possible, a good fallback could be optgroups of
> > areas with countries inside
>
> > I browsed the source of sfWidgetFormI18nChoiceCountry class, but no
> > luck.
> > Should I file a bug?

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: sfWidgetFormI18nChoiceCountry has continents

2009-12-23 Thread Salim
I have the same problem. After some searches I found out that there
was no way to exclude continents from the list. We should better open
a ticket !

On 18 déc, 11:56, Massimiliano Arione  wrote:
> the new sfWidgetFormI18nChoiceCountry (symfony 1.4) has continents
> among countries.
> So, in the list there's something like "Europe", "Asia", but also
> "Eastern Europe" and so on.
> My doubts:
> 1) is there a way (maybe an option?) to exclude such entries? I would
> like a clean list, with only countries.
> 2) if first is not possible, a good fallback could be optgroups of
> areas with countries inside
>
> I browsed the source of sfWidgetFormI18nChoiceCountry class, but no
> luck.
> Should I file a bug?

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Passing a file to a form class without a form submission

2009-12-23 Thread isleshocky77
So I'm just changing the subject on this cause it really is how I can
get a file which I have passed in as a byteArray from flash to be used
by a form class. Not sure if I should manually save it to a tmp file
first and the pass an array to the form class with the proper
information or there is an easier and cleaner way to do this.

Thanks for any help.

--
Stephen Ostrow

On Dec 22, 5:56 pm, isleshocky77  wrote:
> I'm using ZendAMF with symfony and having a form in flash submit
> information to a service in symfony. I wanted to know if anyone had
> best practices for doing something like this.  It does include a file
> which is where I'm running into the problems.
>
> So far I have this:http://isleshocky77.pastebin.com/f1434534c
>
>   /**
>    * Uploads an Image and sets its information
>    *
>    * @param array     $image_array    The Image which contains all
> information about the Image
>    * @param byteArray $image_file     The image file as a byteArray
>    *
>    * @todo Complete and test
>    *
>    */
>   public function upload($image_array, $image_file)
>   {
>     $ImageForm = new ImageServiceImageForm();
>
>     # Do something with image file
>     # @todo
>
>     $ImageForm->bind($image, $image_file);
>
>     if ($ImageForm->isValid()) {
>       $ImageForm->save();
>       return "Success";
>     } else {
>       return "Error";
>     }
>
>   }
>
> Thanks for any help
>
> --
> Stephen Ostrow

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Error trying to change the class of a validator

2009-12-23 Thread tirengarfio
Solved, I just didn't read the path well..

Javi

On Dec 22, 9:12 pm, tirengarfio  wrote:
> Hi,
>
> i have extended a widget using sfWidgetFormInputFileEditable this way:
>
>   public function configure()
>   {
>
>      parent::configure();
>
>     $this->widgetSchema['fotografia'] = new
> sfWidgetFormInputFileEditable(array(
>         'file_src' => '/uploads/fotografias_miembros/'.$this->getObject
> ()->getFotografia(),
>         'is_image' => true,       // El archivo es una imagen y se
> debe visualizar.
>         'with_delete' => true,    // Añadimos un checkbox para borrar
> la imagen.
>         ));
>
>     $this->validatorSchema['fotografia'] = new sfValidatorFile(array(
>         'required' => false,
>         'path' => sfConfig::get('sf_upload_dir').'/
> fotografias_miembros',
>         'mime_types' => 'web_images',
>         ));
>
>     $this->validatorSchema['fotografia_delete'] = new
> sfValidatorBoolean();
>
>   }
>
> It is working ok this way. Now im trying to change the class of the
> validator this way:
>
>     $this->validatorSchema['fotografia'] = new sfValidatorFile(array(
>         'required' => false,
>         'path' => sfConfig::get('sf_upload_dir').'/
> fotografias_miembros',
>         'mime_types' => 'web_images',
>         'validated_file_class' => 'sfResizedFile'
>         ));
>
> Now after choosing a file from the file explorer i get this error:
>
> Fatal error: Class 'sfResizedFile' not found in /opt/lampp/htdocs/rs/
> lib/vendor/symfony/lib/validator/sfValidatorFile.class.php on line 167
>
> I have created the file the error mentions and the class sfResizedFile
> inside of it. But the error is the same...I have also checked the
> permissions of the path.
>
> Any idea?
>
> Regards
>
> Javi

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] unsetting deep nested embedded forms?

2009-12-23 Thread Tobias Schultze
 

 

  _  

Von: Tobias Schultze [mailto:webmas...@tubo-world.de] 
Gesendet: Mittwoch, 23. Dezember 2009 10:49
An: 'nperria...@gmail.com'
Betreff: symfony unsetting deep nested embedded forms?

 

Hello,

I have a Doctrine Form (Teammatch) which consists of several Matches which
themselves have several Games.

 

So I have a recursive embedded Relation like this:

 

class TeammatchForm extends BaseTeammatchForm {

  public function configure()

  {

$this->embedRelation('Matches');

  }

}

 

class MatchForm extends BaseMatchForm

{

  public function configure()

  {

$this->embedRelation('Games');

  }

}

 

My problem ist, how do I unset deep nested embedded forms?

I tried the following, but it doesn't work: Read Only Error.

 

protected function doBind(array $values)

{   

if (isset($values['Matches']))

{

  foreach ($values['Matches'] as $matchIndex => $matchValues)

  {

if (isset($matchValues['Games']))

{

foreach ($matchValues['Games'] as $gameIndex => $gameValues)

  {

if ('' === trim($gameValues['team1_score']) && ''
=== trim($gameValues['team2_score']))

  {

 
unset($values['Matches'][$matchIndex]['Games'][$gameIndex]);

 
unset($this['Matches'][$matchIndex]['Games'][$gameIndex]);

  }

  }

 

}

  }

}   

parent::doBind($values);

}

 

 

Something like $this->getEmbeddedForm('Matches')->getEmbeddedForm('Games');
doesn't work either.

 

Thanks for help

 

Tobias

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Parallel Testing Issues

2009-12-23 Thread Bernhard Schussek
Hi,

>From my experience the best way to achieve this is to use in-memory
databases (f.i. with SQLite). They are fast and are created seperately
for every test process, so they don't interfere with each other.

You also have to make sure that any other physical fixtures (f.i.
files) are dealt with in a separated directory for each test process.

Further tips for increasing test performance:

* Make sure all tests use the smallest possible fixture set in the DB.
Don't load unnecessary data.
* Write many unit tests and few functional tests, not the other way round
* Don't initialize the database for a test if you don't need to

Lime 2 features native support for running tests in parallel
processes. You can read the blog post for further information:
http://www.symfony-project.org/blog/2009/11/10/lime-2-alpha-released


Bernhard

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.