Source for file list.phpclass

Documentation is available at list.phpclass

  1. <?php
  2. /**
  3.   * Class file list.phpclass
  4.   * handels LIST templates
  5.   *
  6.   * @project    Open CSP-Management
  7.   * @package    cms
  8.   * @categorie  templates
  9.   *
  10.   * @author     Peter Krebs <p.krebs@lvus.at>
  11.   * @copyright  (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
  12.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  13.   * @verision   pk-03-10-13
  14.   *
  15.   ***/
  16.  
  17. require_once $GLOBALS['PROJECT']['CONFIGPATH']."cms.conf";
  18. require_once $GLOBALS['CMS']['PHPINCPATH']."template/page/page.phpclass";
  19.  
  20. /**
  21.   * handels LIST templates
  22.   *
  23.   * @project    Open CSP-Management
  24.   * @package    cms
  25.   *
  26.   * @author     Peter Krebs <p.krebs@lvus.at>
  27.   * @copyright  (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
  28.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  29.   *
  30.   * @verision   pk-03-12-14
  31.   *
  32.   ***/
  33.     /**
  34.       * @staticvar string $type OBJECT TYPE
  35.       ***/
  36.     var $type       = "LIST";
  37.  
  38.     /**
  39.       * returns the new/edit form for the template
  40.       *
  41.       * @param int $mode show mode
  42.       * @parma string $frmName form name to load instead of T_CMS_PAGE_TEMPLATE
  43.       *
  44.       ***/
  45.     function &dbGetForm($mode,$frmName="")  {
  46.         if ($form=&parent::dbGetForm($mode,$frmName)) {
  47.             if (!$form->fieldExists("QUERY",DBMS_NO_DBFIELD)) {
  48.                 $fld=&$form->addNoDbField("QUERY","SQL-Abfrage",DBMS_FIELD_SQLSTATEMENT,"PT");
  49.                 $fld->wrap="off";
  50.                 $fld->rows=4;
  51.                 $fld->toolTip="Platzhalter: \n\$^key\$ = GET \n\$~key\$ = SESSION \n\$§key\$ = POST \n\$°key\$ = SERVER";
  52.                 $fld->allowNull=FALSE;
  53.                 $fld->nullErrMsg="Sie müssen eine SQL-Statement eingeben";                
  54.             }
  55.             if (!$form->fieldExists("LISTSTART",DBMS_NO_DBFIELD)) {
  56.                 $fld=&$form->addNoDbField("LISTSTART","Listenstart","_blobHTMLCODE","PT");
  57.                 $fld->wrap="off";
  58.                 $fld->rows=3;
  59.             }
  60.             if (!$form->fieldExists("LISTSEND",DBMS_NO_DBFIELD)) {
  61.                 $fld=&$form->addNoDbField("LISTSEND","Listenende","_blobHTMLCODE","PT");
  62.                 $fld->wrap="off";
  63.                 $fld->rows=3;
  64.             }
  65.             if (!$form->fieldExists("LISTITEM",DBMS_NO_DBFIELD)) {
  66.                 $fld=&$form->addNoDbField("LISTITEM","Listeneintrag","_blobHTMLCODE","PT");
  67.                 $fld->wrap="off";
  68.                 $fld->rows=10;
  69.                 $fld->toolTip="Platzhalter für DB-COLUMNS: §*COLUMN§";
  70.  
  71.             }
  72.             if (!$form->fieldExists("LISTNOITEM",DBMS_NO_DBFIELD)) {
  73.                 $fld=&$form->addNoDbField("LISTNOITEM","keine Datensätze","_blobHTMLCODE","PT");
  74.                 $fld->wrap="off";
  75.                 $fld->rows=5;
  76.                 $fld->toolTip="Wird angezeigt, wenn kein Datensatz gefunden wurde";
  77.             }
  78.  
  79.             return $form;
  80.         else {
  81.             return FALSE;
  82.         }
  83.     }
  84.  
  85.     /**
  86.       * sets data from $_POST[key]array (dbms) to the objects db values
  87.       *
  88.       * @param string   $arrName name of the post array
  89.       * @param bool     $debug show debug info
  90.       *
  91.       ***/
  92.     function setPOSTVAL($arrName="DBVAL",$debug=FALSE{
  93.         if ($debugecho "<hr><p><b>CMS_PAGE_TEMPLATE::setPOSTVAL($arrName,$debug</b> (".get_class($this).")</p>";
  94.         parent::setPOSTVAL($arrName,$debug);
  95.         if (!$this->pt$this->pt=array();
  96.         $this->pt['QUERY']=        $_POST[$arrName]['QUERY'];
  97.         $this->pt['LISTSTART']=    $_POST[$arrName]['LISTSTART'];
  98.         $this->pt['LISTEND']=      $_POST[$arrName]['LISTEND'];
  99.         $this->pt['LISTITEM']=     $_POST[$arrName]['LISTITEM'];
  100.         $this->pt['LISTNOITEM']=   $_POST[$arrName]['LISTNOITEM'];
  101.     }
  102.  
  103.     /**
  104.       * sets post array with form checks
  105.       *
  106.       * @param  DBMS_FORM $frmObj      a formObj as ref
  107.       * @param  array     $dbVal       array with data
  108.       * @param  bool      $debug 
  109.       *
  110.       * @return bool 
  111.       *
  112.       ***/
  113.     function setFORMPOST(&$frmObj,$dbval,$debug=FALSE{
  114.         if ($debugecho "<hr><p><b>CMS_PAGE_TEMPLATE::setFORMPOST($frmObj,$dbval,$debug)</b> (".get_class($this).")</p>";
  115.         if (parent::setFORMPOST($frmObj,$dbval,$debug)) {
  116.             if (!$this->pt$this->pt=array();
  117.             $this->pt['QUERY']=        $_POST[$arrName]['QUERY'];
  118.             $this->pt['LISTSTART']=    $_POST[$arrName]['LISTSTART'];
  119.             $this->pt['LISTEND']=      $_POST[$arrName]['LISTEND'];
  120.             $this->pt['LISTITEM']=     $_POST[$arrName]['LISTITEM'];
  121.             $this->pt['LISTNOITEM']=   $_POST[$arrName]['LISTNOITEM'];
  122.             return TRUE;
  123.         else {
  124.             return FALSE;
  125.         }
  126.     }
  127.  
  128.  
  129. }

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