* @access public * @param eter string value * @param eter string owner * @return string */ public function render($value = null, $owner = null) { if ($this->strTo === 'UPPER') { $value = strtoupper($value); } if ($this->strTo === 'LOWER') { $value = strtolower($value); } //if ($this->strTo==='CAPITALIZE') $value = strtocapitalize($value); $onkeypress = G::replaceDataField($this->onkeypress, $owner->values); if ($this->replaceTags == 1) { $value = G::replaceDataField($value, $owner->values); } if ($this->showVars == 1) { $this->process = G::replaceDataField($this->process, $owner->values); //$sShowVars = ' ' . $this->symbol . ''; $sShowVars = ' '; } else { $sShowVars = ''; } if ($this->mode === 'edit') { if ($this->readOnly) { return 'htmlentities($value, ENT_COMPAT, 'utf-8') . '\' readOnly="readOnly" style="' . htmlentities($this->style, ENT_COMPAT, 'utf-8') . '" onkeypress="' . htmlentities($onkeypress, ENT_COMPAT, 'utf-8') . '"/>' . $sShowVars; } else { return 'htmlentities($value, ENT_COMPAT, 'utf-8') . '\' style="' . htmlentities($this->style, ENT_COMPAT, 'utf-8') . '" onkeypress="' . htmlentities($onkeypress, ENT_COMPAT, 'utf-8') . '"/>' . $sShowVars; } } elseif ($this->mode === 'view') { return 'htmlentities($value, ENT_COMPAT, 'utf-8') . '\' style="display:none;' . htmlentities($this->style, ENT_COMPAT, 'utf-8') . '" onkeypress="' . htmlentities($onkeypress, ENT_COMPAT, 'utf-8') . '"/>' . $this->htmlentities($value, ENT_COMPAT, 'utf-8'); } else { return $this->htmlentities($value, ENT_COMPAT, 'utf-8'); } } /** * Function renderGrid * * @author Julio Cesar Laura Avendano * @access public * @param eter array values * @param eter string owner * @return string */ public function renderGrid($values = array(), $owner) { $result = array(); $r = 1; foreach ($values as $v) { if ($this->replaceTags == 1) { $v = G::replaceDataField($v, $owner->values); } if ($this->showVars == 1) { $this->process = G::replaceDataField($this->process, $owner->values); //$sShowVars = ' ' . $this->symbol . ''; $sShowVars = ' '; } else { $sShowVars = ''; } if ($this->mode === 'edit') { if ($this->readOnly) { $result[] = '' . $sShowVars; } else { $result[] = '' . $sShowVars; } } elseif ($this->mode === 'view') { $result[] = '

' . $this->htmlentities(number_format($v, 2), ENT_COMPAT, 'utf-8') . '

'; } else { $result[] = '

' . $this->htmlentities(number_format($v, 2), ENT_COMPAT, 'utf-8') . '

'; } $r ++; } return $result; } /** * Function attachEvents * * @access public * @param eter string $element * @return string */ public function attachEvents($element) { return "myForm.aElements[i] = new G_Text(myForm, $element,'{$this->name}'); myForm.aElements[i].setAttributes(" . $this->getAttributes() . ");"; } }