kanduvisla/symphony-ckeditor — Issue #8: Text Box Field
Author: justify
Created: 2011-12-02 13:13:35+00:00
State: open

```php
/**
* Load and apply CKEditor
*/
protected $addedCKEditorHeaders = false;

public function applyCKEditor($context) {
//if($context['field']->get('formatter') != 'ckeditor' && $context['field']->get('formatter') != 'ckeditor_compact') return;

if(!$this->addedCKEditorHeaders){
Administration::instance()->Page->addScriptToHead(URL . '/extensions/ckeditor/lib/ckeditor/ckeditor.js', 200, false);
Administration::instance()->Page->addScriptToHead(URL . '/extensions/ckeditor/assets/symphony.ckeditor.js', 210, false);
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/ckeditor/assets/symphony.ckeditor.css', 'screen', 30);

$this->addedCKEditorHeaders = true;
}
}
```

It isn't attaching the scripts/stylesheets when used with the Text Box Field extension. The first line of the script is returning it before it runs the if statement.