newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Cant specify custom configuration file for ckeditor #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you want a specific toolbar setup or set other ckeditor settings you can
pass ckeditor a custom js file with the settings you need. We need a
setting to pass our configfile setting to ckeditor within the form builder
class.

Here is a solution:

78:
    protected $ckeditorPath;            /*Allows ckeditor directory's location
to be identified.*/
        protected $ckeditorCustomConfig;                /*Specify location
of custom ckeditor config file*/

2620:
                $ckeditorID = str_replace('"', '"', $ckeditor->attributes["id"]);
                                if(!empty($this->ckeditorCustomConfig))
                                {
                    $str .= "\n\t\t" . 'CKEDITOR.replace("' . $ckeditorID . '", {
customConfig: \'' . $this->ckeditorCustomConfig . '\'}';
                    if(!empty($this->ckeditorLang))
                        $str .= ', { language: "' . $this->ckeditorLang . '" }';
                    $str .= ");";
                                } else
                if(!empty($ckeditor->ckeditorBasic))

To use it:

        $form->setAttributes(array(
                "ckeditorPath" => "../ckeditor",
                "ckeditorCustomConfig" => "../ckeditor/myconfig.js"
        ));

Cheers,
moncojhr

Original issue reported on code.google.com by moncojhr@gmail.com on 1 Apr 2010 at 2:47

GoogleCodeExporter commented 8 years ago
I have added this request to the NewFeatureRequests wiki.

Original comment by ajporterfield@gmail.com on 1 Apr 2010 at 1:43

GoogleCodeExporter commented 8 years ago
The latest release of version 1.0.2 uploaded this afternoon includes 
ckeditorCustomConfig as a new form 
attribute which can be used to load settings from a js configuration file.

- Andrew

Original comment by ajporterfield@gmail.com on 2 Apr 2010 at 6:36