Well, it's all OK, until you do :

$this->widgetSchema['intro'] =  new sfWidgetFormTextareaTinyMCE(


At this time, you are not modifying existing widgets, you are creating new
one.

You should put this code in the MyObjectI18nForm.  Symfony generates forms
for I18N attributes.

In your template :

echo $form['fr']['intro']


Alex'

2009/12/1 poussain <[email protected]>

> Hi everybody.
>
> I can not manage to have both i18n and tinyMCE widgets on
> internationalised fields. If i put both, i will have internationalised
> fields for all my objects' fields, but no tinyMCE for them. I will
> have as much tinyMCE fields as i declared, but thew will not
> correspond to any language, they will be at the beginning or at the
> end. It worked perfectly before i internationalized the objects
>
> Here is an example of code :
>
> // config/doctrine/schema.yml
>
> MyObject:
>  actAs:
>    I18n:
>      fields: [title, subtitle, intro, text]
>  columns:
>    title: {type: string(500)}
>    subtitle: {type: string(500)}
>    intro: {type: string(4000)}
>    text: {type: string(16000)}
>
>
> // lib/form/doctrine/MyObject.class.php
>
> public function configure()
> {
>
> $this->embedI18n(array('en', 'fr', 'es'));
> $this->widgetSchema->setLabel('fr', 'Français');
> $this->widgetSchema->setLabel('en', 'Anglais');
> $this->widgetSchema->setLabel('es', 'Español');
>
> $this->widgetSchema['intro'] =  new sfWidgetFormTextareaTinyMCE(
>  array(
>    'width'=>600,
>    'height'=>100,
>    'config'=>'theme_advanced_disable: "anchor,image,cleanup,help"',
>    'theme'   =>  sfConfig::get('app_tinymce_theme','simple'),
>  ),
>  array(
>    'class'   =>  'tiny_mce'
>  )
> );
>
> $this->widgetSchema['text'] =  new sfWidgetFormTextareaTinyMCE(
>  array(
>    'width'=>600,
>    'height'=>100,
>    'config'=>'theme_advanced_disable: "anchor,image,cleanup,help"',
>    'theme'   =>  sfConfig::get('app_tinymce_theme','simple'),
>  ),
>  array(
>    'class'   =>  'tiny_mce'
>  )
> );
>
> $js_path = sfConfig::get('sf_rich_text_js_dir') ? '/'.sfConfig::get
> ('sf_rich_text_js_dir').'/tiny_mce.js' : '/sf/tinymce/js/tiny_mce.js';
> sfContext::getInstance()->getResponse()->addJavascript($js_path);
>
> }
>
>
> So i guess when i use $this->widgetSchema['intro'], the "intro" name
> does not correspond to all the i18n "intro" fields. I tried both
> 'en_intro' and 'intro_en', but it doesn't do any magic. So maybe you
> could help me ?
> I have search by myself quite a lot, but found no answer
> Thank you
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>


-- 
Alexandre Salomé -- [email protected]

--

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


Reply via email to