TwistedInteractive / ckeditor

Symphony CMS extension that provides the CKEditor WYSIWYG editor for text fields.
http://symphony-cms.com/download/extensions/view/35082/
Other
19 stars 24 forks source link

Text Box Field #8

Closed ghost closed 12 years ago

ghost commented 12 years ago
/**
         * 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.