tak, podam
wiec po sciągnieciu tej klasy ze strony
http://trac.symfony-project.org/attachment...ditor.class.php i dodaniu jej do pluginu sfFormExtraPlugin, trzeba też sciągnąc kod edytora FCK i załadować do katalogu js/fckeditor
pozniej w aplikacji w config/settings.yml
dodajesz
<?php
rich_text_fck_js_dir: js/fckeditor
?>
i jeszcze w pliku view.yml
<?php
javascripts: [ fckeditor/fckeditor]
?>
w tej klasie sciągniętej zmieniłem tresc funkcji render na
<?php
public function render
($name, $value = null, $attributes = array(), $errors = array()) {
$path1=sfContext::getInstance()->getRequest()->getRelativeUrlRoot().'/'.sfConfig::get('sf_rich_text_fck_js_dir').'/';
$path2=sfContext::getInstance()->getRequest()->getRelativeUrlRoot().'/js/fckeditor/fckconfig.js';
$textarea = parent::render($name, $value, $attributes, $errors);
<script type="text/javascript">
var oFCKeditor = new FCKeditor('%s','%s','%s');
oFCKeditor.BasePath = '%s' ;
oFCKeditor.Config['CustomConfigurationsPath'] = '%s';
oFCKeditor.ReplaceTextarea();
</script>
EOF
,
$name,
$this->getOption('width') ? $this->getOption('width') : '100%',
$this->getOption('height') ? $this->getOption('height') : '200',
$this->getOption('BasePath') ? $this->getOption('BasePath') : $path1,
$this->getOption('CustomConfigurationsPath') ? $this->getOption('CustomConfigurationsPath') : $path2
);
return $textarea.$js;
}
?>
czyli usunieta finkcja document.onload, ponieważ onload ;pozwalało na odpalenie tylko jednego edytora fck, a jak chciałem kilka edytorów na stronie to nie działało, a teraz dxiała z kilkoma edytorami
definiowanie pola w lib/forms/...Form.class.php tak wygłada
<?php
$this->widgetSchema['longdescription'] = new sfWidgetFormTextareaFCKEditor
(array('width'=>'800', 'height'=>'400'));
?>
i działa bez problemu, tez pola z I18N działąją ok, gdybyś miał problemy to pisz jeszcze
pozdrawiam
Stachu