Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/public_html/administrator/components/com_convertforms/ConvertForms/Field/ |
<?php
/**
* @package Convert Forms
* @version 4.3.3 Pro
*
* @author Tassos Marinos <info@tassos.gr>
* @link https://www.tassos.gr
* @copyright Copyright © 2023 Tassos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
namespace ConvertForms\Field;
defined('_JEXEC') or die('Restricted access');
class Editor extends Textarea
{
/**
* Remove common fields from the form rendering
*
* @var mixed
*/
protected $excludeFields = [
'placeholder',
'browserautocomplete',
'size',
];
/**
* Event fired before the field options form is rendered in the backend
*
* @param object $form
*
* @return void
*/
protected function onAfterRenderOptionsForm(&$html)
{
// Remove the 'None' editor from dropdown options
$html = str_replace('<option value="none">Editor - None</option>', '', $html);
}
/**
* Renders the field's input element
*
* @return string HTML output
*/
protected function getInput()
{
$selected_editor = empty($this->field->editor) ? \JFactory::getConfig()->get('editor') : $this->field->editor;
if (!$selected_editor)
{
return \JText::sprintf('COM_CONVERTFORMS_EDITOR_NOT_FOUND', $selected_editor);
}
// Instantiate the editor
$editor = \Joomla\CMS\Editor\Editor::getInstance($selected_editor);
$id = $this->field->input_id;
$name = $this->field->input_name;
$contents = htmlspecialchars($this->field->value, ENT_COMPAT, 'UTF-8');
$width = '100%';
$height = (int) $this->field->height;
$row = 1;
$col = 10;
$buttons = false;
$author = null;
$asset = null;
$params = [
'readonly' => $this->field->readonly,
];
$this->field->richeditor = $editor->display($name, $contents, $width, $height, $col, $row, $buttons, $id, $author, $asset, $params);
return parent::getInput();
}
/**
* Return the HTML version of the submitted value.
*
* @param string $value
*
* @return string
*/
public function prepareValueHTML($value)
{
// Editor's value is already in HTML format in the database
return $value;
}
}
?>