# contact-forms/2.3.0/PFBC/Element/CKEditor.php

Contact Forms by Cimatti, version 2.3.0. 36 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.3.0/code/PFBC/Element/CKEditor.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.3.0/raw/PFBC/Element/CKEditor.php
- Modified: 2026-04-08T09:49:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/2.3.0/code/PFBC/Element/CKEditor.php#L10-L20`.

```php
<?php
/**
 * PFBC (PHP Form Builder Class) - Third-party library
 * @package PFBC
 */
if ( ! defined( 'ABSPATH' ) ) exit;

// phpcs:disable WordPress.Security.EscapeOutput, WordPress.NamingConventions.PrefixAllGlobals, PluginCheck.CodeAnalysis.Heredoc -- Third-party library

class Element_CKEditor extends Element_Textarea {
	protected $basic;

	function renderJS() {
		echo 'CKEDITOR.replace("', $this->attributes["id"], '"';
		if(!empty($this->basic))
			echo ', { toolbar: "Basic" }';
		echo ');';

		$ajax = $this->form->getAjax();
		$id = $this->form->getID();
		if(!empty($ajax)) {
			echo <<<JS
	jQuery("#$id").bind("submit", function() {
		CKEDITOR.instances["{$this->attributes["id"]}"].updateElement();
	});
JS;
		}
	}

	function getJSFiles() {
		return array(
			$this->form->getResourcesPath() . "/ckeditor/ckeditor.js"
		);
	}
}	

```
