Source for file OCSP_FRMCONTR_FORM_EXTJS.phpclass

Documentation is available at OCSP_FRMCONTR_FORM_EXTJS.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file OCSP_FRMCONTR_FORM_EXTJS.phpclass
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package default
  7.   *
  8.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  9.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.   *
  11.   * @since pk-08.09.2008
  12.   * @version $Id: OCSP_FRMCONTR_FORM_EXTJS.phpclass,v 1.4 2008/09/24 01:18:40 pitlinz Exp $
  13.   */
  14.  
  15.     // ---------------------------------------------------------
  16.     // requirements
  17.     // ---------------------------------------------------------
  18.  
  19.     pcf_require_class('OCSP_FRMCONTR_FORM'dirname(__FILE__"/");
  20.  
  21. /**
  22.   * openCSP class OCSP_FRMCONTR_FORM_EXTJS
  23.   *
  24.   * @project Open CSP-Management
  25.   * @package default
  26.   *
  27.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  28.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   * @since pk-08.09.2008
  31.   * @version $Id: OCSP_FRMCONTR_FORM_EXTJS.phpclass,v 1.4 2008/09/24 01:18:40 pitlinz Exp $
  32.   */
  33. {
  34.     // ---------------------------------------------------------------------------
  35.     // constants
  36.     // ---------------------------------------------------------------------------
  37.     
  38.     /**
  39.      * @constant string CLASS_SRC_FILE
  40.      */
  41.     const CLASS_SRC_FILE = __FILE__;
  42.  
  43.     // ---------------------------------------------------------------------------
  44.     // class (static)
  45.     // ---------------------------------------------------------------------------
  46.     
  47.     /*** class vars ------------------------------------------------------ */
  48.     
  49.     /*** class methods --------------------------------------------------- */
  50.     
  51.     // ---------------------------------------------------------------------------
  52.     // object vars
  53.     // ---------------------------------------------------------------------------
  54.     
  55.     /*** compostion --------------------------------------------------- */
  56.     
  57.     /*** attributes  -------------------------------------------------- */
  58.     
  59.     // ---------------------------------------------------------------------------
  60.     // factory / construct
  61.     // ---------------------------------------------------------------------------
  62.     
  63.     // ---------------------------------------------------------------------------
  64.     // getter / setter
  65.     // ---------------------------------------------------------------------------    
  66.  
  67.     /**
  68.      * returns the form control attributes
  69.      * 
  70.      * note return value is not enclosed by {}
  71.      *
  72.      * @param boolean $debug 
  73.      * 
  74.      * @return string (json)
  75.      */
  76.     public function getFormAttributes($debug)
  77.     {
  78.         if ($debugechoDebugMethod(__FILE__,get_class($this),"OCSP_FRMCONTR_FORM_EXTJS::getFormAttributes()");
  79.         
  80.         if ($this->myForm->getFrmMode(!= FRM_MODE_NEW)
  81.         {
  82.             $this->populateRow(NULL,$debug)// ensure the row is populated
  83.         else {
  84.             $this->getDefaultValues(TRUE,$debug);                
  85.         }
  86.         
  87.           if (
  88.             (($this->myForm->getFrmMode(== FRM_MODE_EDIT|| ($this->myForm->getFrmMode(== FRM_MODE_DELETE))
  89.             && (!sizeof($this->myFilter))
  90.            // empty filter -> try to get it from primary keys
  91.         {
  92.             $this->getFilterFromValues($debug);           
  93.         }        
  94.         
  95.         $arr_ocspFormSettings=array(
  96.                 'ID'        => $this->myForm->getId(),
  97.                 'MODE'      => $this->myForm->getFrmMode(),
  98.                 'FILTER'    => $this->myFilter,
  99.                 'CLASS'     => get_class($this),
  100.                 'USER_ID'    => OCSP_OBJ::currentUser()->getId()
  101.             );        
  102.         
  103.         $str_ret "
  104.             DBMSFORMID: " $this->myForm->getId(",
  105.             OCSP_FORM_SETTING_CRYPT: '" OCSP_SESSION::getInstance()->encrypt(serialize($arr_ocspFormSettings)) "',
  106.             FRM_NEXTURL: '" base64_encode($this->getNextUrl(False)) "',
  107.             FRMARRAYNAME: '" $this->myForm->getDataArrName("',
  108.             FRMMODE: " $this->myForm->getFrmMode(",
  109.             FRMHTMLNAME: '".$this->myForm->getHTMLname()."',
  110.         ";
  111.         
  112.         if (($obj_tblObj=$this->myForm->getMyTblObj(False,$debug)) && $this->myForm->getTblObjClass())
  113.         {
  114.             if ($debugechoDebugLine(__FILE__,__LINE__,"class: " $this->myForm->getTblObjClass(" include: " $this->myForm->getTblObjInc());
  115.             $str_ret.="
  116.                 OCSP_FORM_TBLOBJCLASS: '".OCSP_SESSION::getInstance()->encrypt($this->myForm->getTblObjClass())."',
  117.                 OCSP_FORM_TBLOBJINC:   '".OCSP_SESSION::getInstance()->encrypt($this->myForm->getTblObjInc())."',
  118.             ";
  119.         }
  120.  
  121.         if (get_class($this->myForm!= 'OCSP_FORM')
  122.         {
  123.             $str_ret.="
  124.                 OCSP_FORM_CLASS: '".OCSP_SESSION::getInstance()->encrypt(get_class($this->myForm))."',
  125.                 OCSP_FORM_INC:   '".OCSP_SESSION::getInstance()->encrypt($this->myForm->get_mySourceFile()).",
  126.             ";
  127.          }        
  128.                      
  129.          if ($arr_passThrough $this->myForm->getPassThroughFields())
  130.          {
  131.              $str_ret .= "b64_PASSTHROUGH: '" base64_encode(serialize($arr_passThrough)) "',";
  132.          }        
  133.         
  134.          return $str_ret;
  135.     }
  136.  
  137.     
  138. }
  139.  
  140. ?>

Documentation generated on Thu, 08 Jan 2009 17:46:24 +0100 by phpDocumentor 1.4.0a2