To enable readonly, for an input-box 2 files must be updated:
1. . . ./com_demo/models/fields/cktext.php
add 1 line to this file - 'readonly' => $this->getOption('readonly');
2. . . ./libraries/jdom/html/form/input/text.php
to this one add: var $readonly;
then in the constructor:
$this->arg('size' , 6, $args, '32');
if ($this->readonly)
$this->addSelector('readonly', 'readonly');[/code]
and in the build function:
. ' ' . $this->readonly
cktext.phpclass CommuterCkFormFieldCktext extends CommuterClassFormField
{
/**
* The form field type.
*
* @var string
*/
public $type = 'cktext';
/**
* Method to get the field input markup.
*
* @access public
*
*
* @since 11.1
*
* @return string The field input markup.
*/
public function getInput()
{
$this->input = JDom::_('html.form.input.text', array_merge(array(
'dataKey' => $this->getOption('name'),
'domClass' => $this->getOption('class'),
'domId' => $this->id,
'domName' => $this->name,
'dataValue' => $this->value,
'placeholder' => $this->getOption('placeholder'),
'readonly' => $this->getOption('readonly'),
'hidden' => $this->getOption('hidden'),
text.phpclass JDomHtmlFormInputText extends JDomHtmlFormInput
{
var $readonly;
var $hidden;
var $size;
function __construct($args)
{
parent::__construct($args);
$this->arg('readonly' , null, $args);
$this->arg('hidden , null, $args);
$this->arg('size' , 6, $args, '32');
if ($this->readonly)
$this->addSelector('readonly', 'readonly');
if ($this->hidden)
$this->type = 'hidden';
function build()
{
$html = '<%PREFIX%><input type="' . $this->type . '" id="<%DOM_ID%>" name="<%INPUT_NAME%>"<%STYLE%><%CLASS%><%SELECTORS%>'
. ' value="<%VALUE%>"'
. ' ' . $this->readonly
. ' size="' . $this->size . '"'
. '/><%SUFFIX%>' .LN
. '<%VALIDOR_ICON%>'.LN
. '<%MESSAGE%>';