Example #1
0
 public function testConfiguredDisable()
 {
     $this->ckEditorType->isEnable(false);
     $options = array('config' => array('toolbar' => array('foo' => 'bar'), 'uiColor' => '#ffffff'), 'plugins' => array('wordcount' => array('path' => '/my/path', 'filename' => 'plugin.js')));
     $form = $this->factory->create('ckeditor', null, $options);
     $view = $form->createView();
     $this->assertArrayHasKey('enable', $view->vars);
     $this->assertFalse($view->vars['enable']);
     $this->assertArrayNotHasKey('config', $view->vars);
     $this->assertArrayNotHasKey('plugins', $view->vars);
 }
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $pool = $this->pool;
     $translator = $this->translator;
     $formatters = array();
     foreach ($pool->getFormatters() as $code => $instance) {
         $formatters[$code] = $translator->trans($code, array(), 'SonataFormatterBundle');
     }
     $resolver->setDefaults(array('inherit_data' => true, 'event_dispatcher' => null, 'format_field' => null, 'ckeditor_toolbar_icons' => array(array('Bold', 'Italic', 'Underline', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'Image', 'Link', 'Unlink', 'Table'), array('Maximize', 'Source')), 'ckeditor_basepath' => $this->CKEditorType->getBasePath(), 'ckeditor_context' => null, 'ckeditor_plugins' => $this->CKEditorType->getPluginManager()->getPlugins(), 'ckeditor_styles' => $this->CKEditorType->getStylesSetManager()->getStylesSets(), 'ckeditor_templates' => $this->CKEditorType->getTemplateManager()->getTemplates(), 'ckeditor_auto_inline' => $this->CKEditorType->isAutoInline(), 'ckeditor_inline' => $this->CKEditorType->isInline(), 'ckeditor_input_sync' => $this->CKEditorType->isInputSync(), 'format_field_options' => array('choices' => $formatters), 'source_field' => null, 'source_field_options' => array('attr' => array('class' => 'span10 col-sm-10 col-md-10', 'rows' => 20)), 'target_field' => null, 'listener' => true));
     $resolver->setRequired(array('format_field', 'source_field', 'target_field'));
 }
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->replaceDefaults(array('config' => array('filebrowserBrowseUrl' => $this->router->generate('ckfinder_index'), 'filebrowserImageBrowseUrl' => $this->router->generate('ckfinder_index', array('type' => 'images')), 'filebrowserFlashBrowseUrl' => $this->router->generate('ckfinder_index', array('type' => 'flash')), 'filebrowserUploadUrl' => $this->router->generate('ckfinder_init', array('command' => 'QuickUpload', 'type' => 'files', 'service' => 'php')), 'filebrowserImageUploadUrl' => $this->router->generate('ckfinder_init', array('command' => 'QuickUpload', 'type' => 'images', 'service' => 'php')), 'filebrowserFlashUploadUrl' => $this->router->generate('ckfinder_init', array('command' => 'QuickUpload', 'type' => 'flash', 'service' => 'php')))));
 }
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults(array('ckeditor_toolbar_icons' => array(array('Bold', 'Italic', 'Underline', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'Image', 'Link', 'Unlink', 'Table'), array('Maximize', 'Source')), 'ckeditor_basepath' => $this->CKEditorType->getBasePath(), 'ckeditor_context' => null, 'ckeditor_plugins' => $this->CKEditorType->getPluginManager()->getPlugins(), 'ckeditor_styles' => $this->CKEditorType->getStylesSetManager()->getStylesSets(), 'ckeditor_templates' => $this->CKEditorType->getTemplateManager()->getTemplates(), 'ckeditor_auto_inline' => $this->CKEditorType->isAutoInline(), 'ckeditor_inline' => $this->CKEditorType->isInline(), 'ckeditor_input_sync' => $this->CKEditorType->isInputSync(), 'format_options' => array('attr' => array('class' => 'span10 col-sm-10 col-md-10', 'rows' => 20))));
     $resolver->setRequired(array('format'));
 }