Example #1
0
 /**
  * @return EditorModel
  */
 public function formCreateModelObject()
 {
     $model = new EditorModel();
     $configuration = file_get_contents(plugins_path('adrenth/tinymce/assets/js/default.tinymce.init.js'));
     $model->setAttribute('configuration', $configuration);
     return $model;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $editor = Editor::find(1);
     $this->vars['name'] = $this->formField->getName();
     $this->vars['value'] = $this->getLoadValue();
     $this->vars['model'] = $this->model;
     $this->vars['configuration'] = $editor->getAttribute('configuration');
     return $this->makePartial('tinymce');
 }
Example #3
0
 /**
  * @return array
  */
 public function getCmsEditorOptions()
 {
     $options = [];
     $editors = Editor::all();
     if ($editors === null) {
         return $options;
     }
     foreach ($editors->all() as $editor) {
         $options[$editor->id] = $editor->name;
     }
     return $options;
 }