Source for file PRO_GROUP_TREE.phpclass

Documentation is available at PRO_GROUP_TREE.phpclass

  1. <?php
  2. /**
  3.   * Class file PRO_GROUP_TREE.phpclass
  4.   *
  5.   * @project    Open CSP-Management
  6.   * @package    products
  7.   *
  8.   * @author     Peter Krebs (pk) <p.krebs@wpus.at>
  9.   * @copyright  (c) 2002-2004 by Peter Krebs and Landesverlag Unternehmensservice
  10.   * @copyright  (c) 2005 by WURM & Partner Unternehmensservice GmbH
  11.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  12.   *
  13.   * @since pk-05-06-19
  14.   *
  15.   ***/
  16.  
  17. require_once $GLOBALS['DEFAULTCONFPATH']."products.conf.phpinc";
  18. require_once $GLOBALS['PROJECT']['PHPINCPATH']."db/dbms_tree.phpclass";
  19. require_once $GLOBALS['PRODUCTS']['PHPINCPATH']."PRO_GROUP_NODE.phpclass";
  20.  
  21. /**
  22.   * Class PRO_GROUP_TREE
  23.   *
  24.   * @project    Open CSP-Management
  25.   * @package    products
  26.   *
  27.   * @author     Peter Krebs (pk) <p.krebs@wpus.at>
  28.   * @copyright  (c) 2002-2004 by Peter Krebs and Landesverlag Unternehmensservice
  29.   * @copyright  (c) 2005 by WURM & Partner Unternehmensservice GmbH
  30.   * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  31.   *
  32.   * @since pk-05-06-19
  33.   *
  34.   ***/
  35. class PRO_GROUP_TREE extends DBMS_TREE {
  36.     /**
  37.       * @var  string  $myGlobalTreeKey      index in $GLOABLS['DBMS_TREE'][]
  38.       ***/
  39.     var $myGlobalTreeKey = "PRO_GROUP_TREE";
  40.  
  41.     /**
  42.       * @staticvar string $myTable 
  43.       */
  44.     var $myTable="T_PRO_GROUP";
  45.  
  46.     /**
  47.       * @staticvar  string  $myIdFld        id column = root
  48.       ***/
  49.     var $myIdFld        ="PGP_ID";
  50.  
  51.     /**
  52.       * @staticvar  string  $myParentFld    name of the parent column
  53.       ***/
  54.     var $myParentFld    ="PGP_PARENT";
  55.  
  56.     /**
  57.       * @staticvar  string  $mySortFld      name of the sort field
  58.       ***/
  59.     var $mySortFld      ="PGP_SORTORDER";
  60.  
  61.     /**
  62.       * @var  string  $myChildClass 
  63.       ***/
  64.     var $myChildClass = "PRO_GROUP_NODE";
  65.  
  66.     /**
  67.       * @var  string  $myChildKeys    NOT FINAL comma sperated list of keys the children
  68.       *                                      have to fit to
  69.       ***/
  70.     var $myChildKeys    ="PROJ_ID";
  71.  
  72.     /**
  73.       * url to open for pages
  74.       * @var string $pageUrl 
  75.       ***/
  76.     var $pageUrl = "/cms/index.php";
  77.  
  78.     /**
  79.       * table tage
  80.       * @var string tblTag
  81.       ***/
  82.    var $tblTag = "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"menuTable\">";
  83.  
  84.     /**
  85.       * sub (child) table Tag
  86.       * @var string $pageUrl 
  87.       ***/
  88.     var $subtblTag = "<table width=\"95%\" align=\"right\" border=\"0\">";
  89.  
  90.  
  91.     /**
  92.       * tar tag
  93.       * @var $trTag 
  94.       ***/
  95.     var $trTag="<tr>";
  96.  
  97.     /**
  98.       * td tag
  99.       * @var string $tdTag 
  100.       ***/
  101.     var $tdTag = "<td>";
  102.  
  103.     // ######################################
  104.  
  105.  
  106.     /**
  107.       * constructor
  108.       *
  109.       * @param int $projId 
  110.       * @param string $gDBIDX 
  111.       * @param bool $debug 
  112.       *
  113.       * @version pk-04-08-23
  114.       *
  115.       ***/
  116.     function PRO_GROUP_TREE($projId,$debug=FALSE{
  117.         if ($debugecho "<p><b>PRO_GROUP_TREE::PRO_GROUP_TREE($projId,$debug)</b> (".get_class($this).")</p>";
  118.  
  119.         $this->PROJ_ID=intval($projId);
  120.         $this->myGlobalTreeKey="PRO_GROUP_TREE".intval($projId);
  121.  
  122.         if ($debugecho "<pre>";print_r($GLOBALS[$this->gDBIDX]);echo "</pre>"}
  123.     }
  124.  
  125.  
  126.     function writeSidemenuTable($nodeId=0,$useCache=TRUE,$debug=FALSE{
  127.         if ($debugecho "<p><b>PRO_GROUP_TREE::writeSidemenuTable($nodeId,$useCache,$debug)</b> (".get_class($this).")</p>";
  128.  
  129.         echo $this->tblTag;
  130.         $treePath=$this->getRootPath($nodeId,TRUE,FALSE);
  131.         foreach($this->myChildren as $orderNr => $id{
  132.             $node=$GLOBALS['DBMS_TREE'][$this->getGlobalTreeKey()][$id];
  133.             $node->subtblTag=$this->subtblTag;
  134.             $node->trTag    =$this->trTag;
  135.             $node->tdTag    =$this->tdTag;
  136.             $node->pageUrl  =$this->pageUrl;
  137.             if ((!is_object($treePath[0])) || ($id != $treePath[0]->getId())) {
  138.                 if ($node->isToShow(TRUE,TRUE,$debug)) {
  139.                     $node->writeSideMenuRow("menu",$debug);
  140.                 }
  141.             else {
  142.                 $node->writeSideMenuRowOnPath($treePath,"menuPath",$debug);
  143.             }
  144.         }
  145.         echo "</table>";
  146.     }
  147. }

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