Example #1
0
 protected function buildForm()
 {
     $this->formBuilder->add('editor_height', 'integer', ['required' => false, 'data' => Tinymce::getConfigValue('editor_height', 0), 'label' => $this->translator->trans('Height of the editor area, in pixels. Enter 0 for default ', [], Tinymce::MODULE_DOMAIN)])->add('show_menu_bar', 'checkbox', ['required' => false, 'data' => intval(Tinymce::getConfigValue('show_menu_bar', 0)) != 0, 'label' => $this->translator->trans('Show the TinyMCE menu bar', [], Tinymce::MODULE_DOMAIN)])->add('force_pasting_as_text', 'checkbox', ['required' => false, 'data' => intval(Tinymce::getConfigValue('force_pasting_as_text', 0)) != 0, 'label' => $this->translator->trans('Force pasting as text', [], Tinymce::MODULE_DOMAIN), 'label_attr' => ['help' => $this->translator->trans('If checked, all pasted data will be converted as plain text, removing tags and styles.', [], Tinymce::MODULE_DOMAIN)]])->add('set_images_as_responsive', 'checkbox', ['required' => false, 'data' => intval(Tinymce::getConfigValue('set_images_as_responsive', 1)) != 0, 'label' => $this->translator->trans('Add responsive class to images', [], Tinymce::MODULE_DOMAIN), 'label_attr' => ['help' => $this->translator->trans('If checked, the "img-responsive" class is added by default to inserted images', [], Tinymce::MODULE_DOMAIN)]])->add('custom_css', 'textarea', ['required' => false, 'data' => Tinymce::getConfigValue('custom_css', '/* Enter here CSS or LESS code */'), 'label' => $this->translator->trans('Custom CSS available in the editor', [], Tinymce::MODULE_DOMAIN), 'label_attr' => ['help' => $this->translator->trans('Enter CSS or LESS code. You may also customize the editor.less file in the plugin template directory.', [], Tinymce::MODULE_DOMAIN)], 'attr' => ['rows' => 10, 'style' => 'font-family: \'Courier New\', Courier, monospace;']])->add('test_zone', 'textarea', ['required' => false, 'label' => $this->translator->trans('Sample editor', [], Tinymce::MODULE_DOMAIN), 'label_attr' => ['help' => $this->translator->trans('This is a sample text editor, to view actual configuration.', [], Tinymce::MODULE_DOMAIN)]]);
 }
Example #2
0
 protected function addConfigField($key)
 {
     $this->formBuilder->add($key, "checkbox", array("label_attr" => [], "required" => false, "constraints" => array(), "data" => intval(Tinymce::getConfigValue($key, 0)) != 0));
 }