Source for file OCSP_FRMVIEW_FORM.phpclass
Documentation is available at OCSP_FRMVIEW_FORM.phpclass
* Class file OCSP_FRMVIEW_FORM.phpclass
* @project Open CSP-Management
* @author Peter Krebs (pk) <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: OCSP_FRMVIEW_FORM.phpclass,v 1.28 2008/12/04 16:02:28 peterkrebs Exp $
require_once dirname(__FILE__
).
"/OCSP_FRMVIEW.phpclass";
* class OCSP_FRMVIEW_FORM
* @project Open CSP-Management
* @author Peter Krebs (pk) <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: OCSP_FRMVIEW_FORM.phpclass,v 1.28 2008/12/04 16:02:28 peterkrebs Exp $
* @var OCSP_FRMCONTR_FORM $myControl
* @var array $buttonImages
* hide form button pannel
* @var boolean $hideFrmBtnPannel
* @var string $outerDivStyle
protected $outerDivStyle=
"display:inline;margin:0px;padding:0px;border:0px;";
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$this->myForm->setFrmMode($aMode);
* sets $this->hideFrmBtnPannel to TRUE
* sets $this->hideFrmBtnPannel to FALSE
* @param string $btnImgUrl
* returns the first enabled field
foreach($arr_fields as &$obj_field)
if ($obj_field->isToShow($this->getMyForm()->getFrmMode(),$this->getMyForm()->getControl()->getCurrentRow()))
if ($obj_field->isEnabled($this->getMyForm()->getFrmMode()))
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ----------- buttons -------------------------
$str_ret.=
"<div class=\"frmButtonPanel\">";
* returns the image tag for a button
* @global array $OCSP_CONF
return "<img src=\"".
$this->buttonImages[$cmd].
"\" border=\"0\" alt=\"$cmd\" class=\"button\" />";
return "<img src=\"" .
OCSP_CONF::getInstance()->getValue('SYSIMGURL') .
"icons-22x22/back.png\" border=\"0\" alt=\"back\" title=\"".
$this->myForm->getLangTxt('BACK').
"\" class=\"button\">";
switch($this->myForm->getFrmMode())
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/filesaveas.png\" border=\"0\" alt=\"save\" title=\"".
$this->myForm->getLangTxt('SUBMIT').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/remove.png\" border=\"0\" alt=\"remove\" title=\"".
$this->myForm->getLangTxt('DELETE').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/filesave.png\" border=\"0\" alt=\"save\" title=\"".
$this->myForm->getLangTxt('SUBMIT').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/edit.png\" border=\"0\" alt=\"edit\" title=\"".
$this->myForm->getLangTxt('EDIT').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/emptytrash.png\" border=\"0\" alt=\"save\" title=\"".
$this->myForm->getLangTxt('DELETE').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-22x22/undo.png\" border=\"0\" alt=\"reset\" title=\"".
$this->myForm->getLangTxt('RESET').
"\" class=\"button\" />";
return "<img src=\"" .
OCSP_OBJ::getConf('SYSIMGURL') .
"icons-16x16/reload.gif\" border=\"0\" alt=\"reload\" title=\"".
$this->myForm->getLangTxt('RELOAD').
"\" class=\"button\" />";
* returns the outer-div tag vor buttons
return "<div style=\"display: inline;\" class=\"frmPanelButton\">";
* @param OCSP_FORM_BLOCK $aBlock
* @global array $OCSP_CONF
if ($debug) echoDebugMethod(__FILE__
,get_class($this),"OCSP_FRMVIEW_FORM::getTableBlock_Fields(\$aBlock[id:".
$aBlock->getId().
"])");
$arr_fields=
$aBlock->getFields($this->getMyForm()->getFrmMode(),$debug);
foreach($arr_fields as $int_ordNr =>
&$obj_field)
$obj_field->setMyForm($this->myForm);
if ($obj_field->isToShow($this->myForm->getFrmMode(),$this->myControl->getCurrentRow()))
if (pcf_is_instance_of($obj_field,'DBMS_FIELD_LAYOUT') &&
$obj_field->isLayoutFld()) // <pk-08-03-07 /> isLayoutFld() added
$str_ret.=
$obj_field->getFieldRowCols($this->myForm->getFrmMode(),$this->myControl->getCurrentRow(),$debug);
$str_ret.=
"\n<tr id=\"tr_".
$obj_field->getDOMId().
"\" >";
if (!$obj_field->labelIsHidden())
$str_ret.=
"<td id=\"fldName_".
$obj_field->getDOMId().
"\" class=\"fldName\" ".
$this->myControl->getFieldEvents('fldName').
">";
$str_tip=
$obj_field->getToolTip();
$str_ret.=
"<div style=\"float:right\" title=\"".
$str_tip.
"\"><img src=\"".
$OCSP_CONF['SYSIMGURL'].
"icons-16x16/tip.gif\" border=\"0\"></div>";
//$str_ret.=$this->myControl->getFieldLabelDiv($obj_field);
$str_ret.=
$obj_field->getLabel();
if ($debug) $str_ret.=
" ".
$obj_field->getTable();
switch($this->myForm->getFrmMode())
$str_ret.=
"<td id=\"fldValue_".
$obj_field->getDOMId().
"\" class=\"$str_class\" colspan=\"$int_colspan\" ".
$this->myControl->getFieldEvents('fldValue').
">";
$str_ret.=
"<div id=\"error_".
$obj_field->getDOMId().
"\" class=\"fldErrorMsg\" ".
($obj_field->hasErrors() ?
"" :
"style=\"display:none\"").
">".
$obj_field->getErrorMsg().
"</div>";
if ($debug) $str_ret.=
"<tr><td colspan=\"2\">Hidden Field: ".
$obj_field->getKey().
" (".
basename(__FILE__
).
" Line: ".__LINE__.
")</td></tr>";
* @param OCSP_FORM_BLOCK $aBlock
* @global array $OCSP_CONF
* @todo OCSP_FRMVIEW_FORM::getFieldSetBlock_Fields() still uses table format
if ($debug) echoDebugMethod(__FILE__
,get_class($this),"OCSP_FRMVIEW_FORM::getTableBlock_Fields(\$aBlock[id:".
$aBlock->getId().
"])");
* returns the html code for the form
* @param boolean $withOuterDiv
* @param boolean $withjOCSPInit
* @todo OCSP_FRMVIEW_FORM::getForm -> block view tab
* @version pk-08-01-29 id added
* @version pk-08-01-31 jOCSP_getFormInitCmd() added
* @version pk-08-11-02 $withjOCSPInit
function getForm($aMode=-
1,$debug=
False,$withOuterDiv=
True,$withjOCSPInit=
True)
// ----------------------------
// ----------------------------
$this->myForm->setFrmMode($aMode);
$this->myControl=
$this->myForm->getControllObj('OCSP_FRMCONTR_FORM',$debug);
// ----------------------------
// ----------------------------
if ($obj_ajax =
$this->myForm->ajax_getObj(FALSE))
$obj_ajax->addJsCode($str_js);
$str_ret .=
"<script type=\"text/javascript\" language=\"javascript\">\n" .
$str_js .
"\n</script>";
$str_ret .=
" " .
$this->myForm->getLayoutField('FRMFRM_FORMADD');
// ----------------------------
// ----------------------------
$bol_fieldSetOpen =
False;
if ($arr_blocks =
$this->myForm->getBlocks($debug))
foreach($arr_blocks as &$obj_block)
if ($obj_block->isToShow($this->myForm->getFrmMode(),$debug))
if ($debug) echoDebugLine(__FILE__
,__LINE__
,$obj_block->getTitle() .
" is to show in " .
$this->myForm->getFrmMode());
switch($obj_block->getViewType())
if ($bol_tableOpen) $str_ret .=
"</table>";
if ($bol_fieldSetOpen) $str_ret .=
"</fieldset>";
$str_ret .=
"<fieldset " .
$this->myForm->getLayoutField('FRMFRM_FIELDSETADD') .
"><legend>".
$obj_block->getTitle().
"</legend>";
$str_ret .=
"<table " .
$this->myForm->getLayoutField('FRMFRM_TABLEADD') .
">";
$bol_fieldSetOpen =
True;
if ($bol_tableOpen) $str_ret .=
"</table>";
if ($bol_fieldSetOpen) $str_ret .=
"</fieldset>";
$str_ret .=
"<table " .
$this->myForm->getLayoutField('FRMFRM_TABLEADD') .
">";
$str_ret .=
"<table " .
$this->myForm->getLayoutField('FRMFRM_TABLEADD') .
">";
} // foreach($arr_blocks as &$obj_block)
if ($bol_tableOpen) $str_ret .=
"</table>";
if ($bol_fieldSetOpen) $str_ret .=
"</fieldset>";
if (!empty($str_tabHeader))
$str_ret .=
$str_tabHeader;
$str_ret .=
$str_tabTabs;
// ----------------------------
// ----------------------------
if (!empty($str_btnPannnel))
if (!empty($str_tabHeader))
$str_ret .=
$str_tabHeader;
$str_ret .=
$str_tabTabs;
if ($withOuterDiv) $str_ret.=
"</div>";
} // end of OCSP_FRMVIEW_FORM
Documentation generated on Thu, 08 Jan 2009 17:46:36 +0100 by phpDocumentor 1.4.0a2