Esempio n. 1
0
 public function testGetAndSetContentCss()
 {
     $option = new WysiwygOption();
     $this->assertEquals('/bundles/path/', $option->getContentCss('path'));
     $this->assertEquals(null, $option->getContentCss(''));
     $option->setContentCss(['path1', 'path2']);
     $this->assertArraySubset(['/bundles/path1/', '/bundles/path2/'], $option->getContentCss());
 }
Esempio n. 2
0
 public function testGetAndSetContentCss()
 {
     $option = new WysiwygOption();
     $this->assertArraySubset(array('/bundles/enhavoapp/css/editor.css', '/bundles/path/'), $option->getContentCss('path'));
     $this->assertArraySubset(array('/bundles/enhavoapp/css/editor.css'), $option->getContentCss());
     $option->setContentCss(['path1', 'path2']);
     $this->assertArraySubset(['/bundles/enhavoapp/css/editor.css', '/bundles/path1/', '/bundles/path2/'], $option->getContentCss());
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     $view->vars['id'] = uniqid(self::$uniqueIdPrefix++);
     $option = new WysiwygOption();
     $option->setFormats($options['formats']);
     $option->setToolbar1($options['toolbar1']);
     $option->setToolbar2($options['toolbar2']);
     $option->setHeight($options['height']);
     $option->setContentCss($options['content_css']);
     $view->vars['config'] = $this->config->getData($option);
 }
Esempio n. 4
0
 public function getData(WysiwygOption $option)
 {
     $data = array('formats' => $this->getConfig('formats'), 'toolbar1' => $option->getToolbar1($this->getConfig('toolbar1')), 'toolbar2' => $option->getToolbar2($this->getConfig('toolbar2')), 'height' => $option->getHeight($this->getConfig('height')), 'style_formats' => $option->getFormats($this->getConfig('style_formats')), 'content_css' => $option->getContentCss($this->getConfig('content_css')));
     return json_encode($data);
 }