Source for file DBMS_FIELD_TEXTAREA.phpclass
Documentation is available at DBMS_FIELD_TEXTAREA.phpclass
* Class file DBMS_FIELD_TEXTAREA.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* handels long string (blob) fields
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @constant string CLASS_SRC_FILE
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** class vars ------------------------------------------------------ */
/*** class methods --------------------------------------------------- */
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** compostion --------------------------------------------------- */
/*** attributes --------------------------------------------------- */
* source file of the class
* @var string $classSrcFile
* @var boolean $isSearchable the long field has an index
* @var int $rows number of rows of the textarea
* @var int $cols number of cols of the textarea
* @var boolean $nlToBr replace \n with <br />
* @var string $wrap wrap {@link http://www.netzwelt.com/selfhtml/html/formulare/eingabe.htm#bereiche_umbruch} attrib of the textarea
* @var int $myROShowMode current showMode
* @var bool $allowHTML use htmlspecialchars for output
* @staticvar array $static_RoShowmodes values of show mode in read only view
* @version pk-03-11-27 mode 2,3 added
* @version pk-05-03-14 mode 4 li added
* @note editTblForm() sets this array too, to add li to stored objects.
protected $static_Showmodes=
array(0=>
'ohne Tag',2=>
'p',3=>
'pre',1=>
'textarea',4=>
'li');
* @staticvar array $static_wrapMode values of wrap
* @var int $myHTMLOutMode
* source file of the class
* @var string $classSrcFile
* @var int $srcVersion current version of the source
* xtype to use in the extJS framework for the field
* @var string $extJSxType
// ###########################################################
// OBJECT SETTINGS METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code with <td></td>)
* [FLDVAL] (complete html code with <td></td>)
// swap of mode 0 and 3 in pk-05-03-25
$a_ret=
parent::editTbl_getFieldEditArr($debug);
$a_ret['VALCHECKS']['FLD_ALLOWHTML']=
array(
'FLDLAB' =>
"HTML Eingabe zulassen",
'FLDVAL' =>
"<input name=\"allowHTML\" type=\"checkbox\" value=\"1\" ".
($this->allowHTML ?
"checked=\"checked\" " :
"").
"/>"
$a_ret['LAYOUT']['FLD_SIZE']['FLDVAL']=
"
ROWS: <input name=\"ROWS\" size=\"3\" value=\"".
$this->rows.
"\" /> /
COLS: <input name=\"COLS\" size=\"3\" value=\"".
$this->cols.
"\" />
$a_ret['LAYOUT']['FLDNL2BR']=
array(
'FLDLAB'=>
"Newline To <br />",
'FLDVAL'=>
"<input name=\"NLTOBR\" type=\"checkbox\" ".
($this->nlToBr ?
"checked" :
"").
" value=\"1\" />"
$a_ret['LAYOUT']['FLD_INPUTADD']['FLDLAB']=
"Zeilenumbruch";
$a_ret['LAYOUT']['FLD_INPUTADD']['FLDVAL']=
"<select name=\"WRAP\" size=1>\n";
$a_ret['LAYOUT']['FLD_INPUTADD']['FLDVAL'].=
"<option value=\"".
$mode.
"\" ";
if ($this->wrap==
$mode) $a_ret['LAYOUT']['FLD_INPUTADD']['FLDVAL'].=
" selected ";
$a_ret['LAYOUT']['FLD_INPUTADD']['FLDVAL'].=
">".
$mode.
"</option>";
$a_ret['LAYOUT']['FLD_INPUTADD']['FLDVAL'].=
"</select>";
$a_ret['LAYOUT']['FLD_ROSHOW']['FLDLAB'] =
"Readonly Anzeige";
$a_ret['LAYOUT']['FLD_ROSHOW']['FLDVAL'] =
"<select name=\"myROShowMode\">\n";
$this->static_Showmodes=
array(0=>
'ohne Tag',2=>
'p',3=>
'pre',1=>
'textarea',4=>
'li');
$a_ret['LAYOUT']['FLD_ROSHOW']['FLDVAL'].=
"<option value=\"".
$key.
"\" ";
if ($key ==
$this->myROShowMode) $a_ret['LAYOUT']['FLD_ROSHOW']['FLDVAL'].=
" selected ";
$a_ret['LAYOUT']['FLD_ROSHOW']['FLDVAL'].=
">".
$val.
"</option>\n";
$a_ret['LAYOUT']['FLD_ROSHOW']['FLDVAL'].=
"</select>\n";
$a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDLAB'] =
"Online(HTML) Anzeige";
$a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDVAL'] =
"<select name=\"myHTMLOutMode\">\n";
$a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDVAL'].=
"<option value=\"".
$key.
"\" ";
if ($key ==
$this->myHTMLOutMode) $a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDVAL'].=
" selected ";
$a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDVAL'].=
">".
$val.
"</option>\n";
$a_ret['LAYOUT']['FLD_HTMLSHOW']['FLDVAL'].=
"</select>\n";
$a_ret['LIST']['FLD_LSTSHOW']['FLDLAB'] =
"Anzeige:";
$a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'] =
"<select name=\"myLstOutMode\">\n";
$a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'].=
"<option value=\"".
$key.
"\" ";
if ($key ==
$this->myLstOutMode) $a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'].=
" selected ";
$a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'].=
">".
$val.
"</option>\n";
$a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'].=
"</select>\n";
$a_ret['LIST']['FLD_LSTSHOW']['FLDVAL'].=
"max <input name=\"myLstOutSize\" style=\"text-align:right;\" size=\"4\" value=\"".
$this->myLstOutSize.
"\" /> Zeichen";
$a_ret['LIST']['FLD_TAREADEF']=
array(
'FLDLAB' =>
"Textarea Definition",
ROWS: <input name=\"lstTAreaRows\" size=\"3\" value=\"".
$this->lstTAreaRows.
"\" /> /
COLS: <input name=\"lstTAreaCols\" size=\"3\" value=\"".
$this->lstTAreaCols.
"\" />
* echos input form for field definition
* @param bool $showSize show size and maxlength input
function editTblForm($showSize=
False,$allowHTML=
True) {
* saves the field definition from $_POST array
// set allowHTML and allowSQL if the field has been downgraded
$this->allowHTML=
((isset
($_POST['allowHTML']) &&
intval($_POST['allowHTML'])) ?
True :
False);
if (!empty($_POST['WRAP'])) $this->wrap=
$_POST['WRAP'];
// list output -> adjust wrap and nlToBr
* returns the html code for a editable formular element
* @param mixed $aValue the value to set
* @param string $nameAdd append something to name like "[VALUE]" for search forms
function getInputTag($aValue,$arrName=
"DBVAL",$nameAdd=
"",$debug=
False) {
$tag .=
"name=\"$arrName".
"[".
$this->myName.
"]\" ";
$tag .=
"id=\"".
$this->getDOMId().
"\" ";
$tag .=
"rows=\"".
$this->rows.
"\" cols=\"".
$this->cols.
"\" ";
$tag .=
"wrap=\"".
$this->wrap.
"\" ";
if ($b_limitedSize) { // <pk-06-01-19>
var o_span=ocsp_getElem('charleft_".
$this->getDOMId().
"');
o_span.innerHTML=i_charleft+' ".
$this->myForm->getLangTxt('CHAR_LEFT').
"';
if ($b_limitedSize) { // <pk-06-01-19>
$tag.=
"<br><span id=\"charleft_".
$this->getDOMId().
"\" style=\"font-size:75%\">".
intval($this->dbDesc['LEN']).
" ".
$this->myForm->getLangTxt('CHAR_LEFT').
"</span>";
* returns the html representation of the field
* @param mixed $aValue the falue
* @param string $arrName name of the global array holding data values
* @param bool $debug show debug info
* @returns string the html representation of the field
* @version pk-07-11-28 ($this->allowHTML)
if (empty($aValue)) return ""; // <pk-07-01-14 />
$tag .=
"name=\"$arrName".
"[".
$this->myName.
"]\" ";
$tag .=
"rows=\"".
$this->rows.
"\" cols=\"".
$this->cols.
"\" ";
$tag .=
"wrap=\"".
$this->wrap.
"\" ";
$tag .=
" readonly>".
$str_outValue.
"</textarea>";
return "<p>".
$aValue.
"</p>";
return "<pre>".
$str_outValue.
"</pre>";
return parent::getScreenValue($aValue,$arrName,$debug); // <pk-06-07-22 /> E_ALL
* returns the html representation of the field in a list (table col)
* @param mixed $aValue the falue
* @param string $arrName name of the global array holding data values
* @param bool $debug show debug info
* @returns mixed the html representation of the field
* @version pk-07-11-28 ($this->allowHTML)
function getListValue($aValue=
NULL,$arrName=
"DBVAL",$debug=
False) {
if (empty($aValue)) return ""; // <pk-07-01-14 />
$tag .=
"name=\"$arrName".
"[".
$this->myName.
"]\" ";
$tag .=
"wrap=\"".
$this->wrap.
"\" ";
$tag .=
" readonly>".
$str_outValue.
"</textarea>";
return "<p>".
$aValue.
"</p>";
return "<pre>".
$str_outValue.
"</pre>";
* gets a htmltag for the value
* this is mainly used in CMS Module
function getHtmlTag($aValue,$arrName=
"DBVAL",$debug=
False) {
if (empty($aValue)) return ""; // <pk-07-01-14 />
$htmlValue=
nl2br($htmlValue);
$tag .=
"id=\"".
$this->getDOMId().
"\" ";
$tag .=
"name=\"$arrName".
"[".
$this->myName.
"]\" ";
$tag .=
"rows=\"".
$this->rows.
"\" cols=\"".
$this->cols.
"\" ";
$tag .=
"wrap=\"".
$this->wrap.
"\" ";
return "<p>".
$htmlValue.
"</p>";
return "<pre>".
$htmlValue.
"</pre>";
case 4:
/* <pk-05-03-14 />*/
if ($listElems=
explode("\n",$aValue)) {
foreach($listElems as $line) {
return "<li>".
str_replace("\n","</li>\n<li>",$aValue).
"</li>";
// --------------------------------------------------------
// --------------------------------------------------------
* returns options of an ext js field config object
* NOTE the return string is NOT enclosed by {}
$arr_ret =
parent::getExtJSConfigOptions($debug);
$arr_ret['grow'] =
"true";
$arr_ret['growMin'] =
($this->rows +
1) *
10;
$arr_ret['growMax'] =
($this->rows +
1) *
20;
$arr_ret['width'] =
($this->cols +
1) *
6;
} // end class DBMS_FIELD_TEXTAREA
Documentation generated on Thu, 08 Jan 2009 17:43:03 +0100 by phpDocumentor 1.4.0a2