| Total Complexity | 7 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Textarea extends Generic |
||
| 8 | { |
||
| 9 | const EDITOR_TINYMCE = 'tinymce'; |
||
| 10 | const EDITOR_CKEDITOR = 'ckeditor'; |
||
| 11 | const EDITOR_MEDIUM = 'medium'; |
||
| 12 | const EDITOR_MARKDOWN = 'markdown'; |
||
| 13 | |||
| 14 | /** @var array */ |
||
| 15 | protected $visibility = [ |
||
| 16 | Scaffolding::PAGE_INDEX => false, |
||
| 17 | Scaffolding::PAGE_EDIT => true, |
||
| 18 | Scaffolding::PAGE_VIEW => true, |
||
| 19 | ]; |
||
| 20 | |||
| 21 | protected $editor = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param $editor |
||
| 25 | * @return bool |
||
| 26 | */ |
||
| 27 | public function editorEnabled($editor) |
||
| 28 | { |
||
| 29 | return $editor === $this->editor; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return $this |
||
| 34 | */ |
||
| 35 | public function tinymce() |
||
| 36 | { |
||
| 37 | $this->editor = static::EDITOR_TINYMCE; |
||
| 38 | |||
| 39 | return $this; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | public function ckeditor() |
||
| 46 | { |
||
| 47 | $this->editor = static::EDITOR_CKEDITOR; |
||
| 48 | |||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | public function medium() |
||
| 56 | { |
||
| 57 | $this->editor = static::EDITOR_MEDIUM; |
||
| 58 | |||
| 59 | return $this; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | public function markdown() |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return array |
||
| 74 | */ |
||
| 75 | public function onEdit() |
||
| 82 |