2017-08-11 11:10:27 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2017-08-11 18:13:07 -04:00
|
|
|
* Class XmlFormFieldTextareaPm
|
|
|
|
|
*/
|
2017-08-15 16:26:55 -04:00
|
|
|
class XmlFormFieldTextareaPm extends XmlFormField
|
2017-08-11 11:10:27 -04:00
|
|
|
{
|
|
|
|
|
public $rows = 12;
|
|
|
|
|
public $cols = 40;
|
|
|
|
|
public $required = false;
|
|
|
|
|
public $readOnly = false;
|
|
|
|
|
public $wrap = 'OFF';
|
|
|
|
|
public $showVars = 0;
|
|
|
|
|
public $process = '';
|
|
|
|
|
public $symbol = '@@';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function render
|
|
|
|
|
*
|
|
|
|
|
* @author Julio Cesar Laura Avendao <juliocesar@colosa.com>
|
|
|
|
|
* @access public
|
|
|
|
|
* @param eter string value
|
|
|
|
|
* @param eter string owner
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2017-08-11 18:13:07 -04:00
|
|
|
public function render($value = null, $owner)
|
2017-08-11 11:10:27 -04:00
|
|
|
{
|
|
|
|
|
if ($this->showVars == 1) {
|
2017-08-11 18:13:07 -04:00
|
|
|
$this->process = G::replaceDataField($this->process, $owner->values);
|
2017-08-11 11:10:27 -04:00
|
|
|
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
|
|
|
|
} else {
|
|
|
|
|
$sShowVars = '';
|
|
|
|
|
}
|
|
|
|
|
if ($this->mode === 'edit') {
|
|
|
|
|
if ($this->readOnly) {
|
2017-08-11 18:13:07 -04:00
|
|
|
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities($this->wrap, ENT_QUOTES, 'UTF-8') . '" class="FormTextPM" readOnly>' . $this->htmlentities($value, ENT_COMPAT, 'utf-8') . '</textarea>' . $sShowVars;
|
2017-08-11 11:10:27 -04:00
|
|
|
} else {
|
2017-08-11 18:13:07 -04:00
|
|
|
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities($this->wrap, ENT_QUOTES, 'UTF-8') . '" class="FormTextPM" >' . $this->htmlentities($value, ENT_COMPAT, 'utf-8') . '</textarea>' . $sShowVars;
|
2017-08-11 11:10:27 -04:00
|
|
|
}
|
|
|
|
|
} elseif ($this->mode === 'view') {
|
2017-08-11 18:13:07 -04:00
|
|
|
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" readOnly style="border:0px;backgroud-color:inherit;' . $this->style . '" wrap="' . htmlentities($this->wrap, ENT_QUOTES, 'UTF-8') . '" class="FormTextPM" >' . $this->htmlentities($value, ENT_COMPAT, 'utf-8') . '</textarea>';
|
2017-08-11 11:10:27 -04:00
|
|
|
} else {
|
2017-08-11 18:13:07 -04:00
|
|
|
return '<textarea id="form[' . $this->name . ']" name="form[' . $this->name . ']" cols="' . $this->cols . '" rows="' . $this->rows . '" style="' . $this->style . '" wrap="' . htmlentities($this->wrap, ENT_QUOTES, 'UTF-8') . '" class="FormTextArea" >' . $this->htmlentities($value, ENT_COMPAT, 'utf-8') . '</textarea>';
|
2017-08-11 11:10:27 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function renderGrid
|
|
|
|
|
*
|
|
|
|
|
* @author Julio Cesar Laura Avendano <juliocesar@colosa.com>
|
|
|
|
|
* @access public
|
|
|
|
|
* @param eter string values
|
|
|
|
|
* @param eter string owner
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2017-08-11 18:13:07 -04:00
|
|
|
public function renderGrid($owner, $values = null)
|
2017-08-11 11:10:27 -04:00
|
|
|
{
|
2017-08-11 18:13:07 -04:00
|
|
|
$result = array();
|
2017-08-11 11:10:27 -04:00
|
|
|
$r = 1;
|
|
|
|
|
foreach ($values as $v) {
|
|
|
|
|
if ($this->showVars == 1) {
|
2017-08-11 18:13:07 -04:00
|
|
|
$this->process = G::replaceDataField($this->process, $owner->values);
|
2017-08-11 11:10:27 -04:00
|
|
|
$sShowVars = ' <input type="button" value="' . $this->symbol . '" onclick="showDynaformsFormVars(\'form[' . $owner->name . '][' . $r . '][' . $this->name . ']\', \'../controls/varsAjax\', \'' . $this->process . '\', \'' . $this->symbol . '\');return false;"/>';
|
|
|
|
|
} else {
|
|
|
|
|
$sShowVars = '';
|
|
|
|
|
}
|
|
|
|
|
if ($this->mode === 'edit') {
|
|
|
|
|
if ($this->readOnly) {
|
2017-08-11 18:13:07 -04:00
|
|
|
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities($v, ENT_COMPAT, 'utf-8') . '\' readOnly="readOnly"/>' . $sShowVars;
|
2017-08-11 11:10:27 -04:00
|
|
|
} else {
|
2017-08-11 18:13:07 -04:00
|
|
|
$result[] = '<input class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value=\'' . $this->htmlentities($v, ENT_COMPAT, 'utf-8') . '\' />' . $sShowVars;
|
2017-08-11 11:10:27 -04:00
|
|
|
}
|
|
|
|
|
} elseif ($this->mode === 'view') {
|
2017-08-11 18:13:07 -04:00
|
|
|
if (stristr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
|
|
|
|
|
$result[] = $this->htmlentities($v, ENT_COMPAT, 'utf-8');
|
2017-08-11 11:10:27 -04:00
|
|
|
} else {
|
2017-08-11 18:13:07 -04:00
|
|
|
$result[] = $this->htmlentities($v, ENT_COMPAT, 'utf-8');
|
2017-08-11 11:10:27 -04:00
|
|
|
}
|
|
|
|
|
} else {
|
2017-08-11 18:13:07 -04:00
|
|
|
$result[] = $this->htmlentities($v, ENT_COMPAT, 'utf-8');
|
2017-08-11 11:10:27 -04:00
|
|
|
}
|
|
|
|
|
$r ++;
|
|
|
|
|
}
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
}
|