forms
[ class tree: forms ] [ index: forms ] [ all elements ]

Source for file MultiRelationSelect.class.php

Documentation is available at MultiRelationSelect.class.php

  1. <?php
  2. /**
  3.  * For including this file you have to define the constant "CLASSPATH".
  4.  * Because every include in the framework depends on the CLASSPATH definition.
  5.  * The CLASSPATH means the relative path to the folder that contains the
  6.  * framework GilliGan.
  7.  *
  8.  * @package    forms
  9.  * @subpackage items
  10.  */
  11. if!defined"CLASSPATH" ) )
  12. {
  13.   echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
  14.   echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
  15.   exit();
  16. }
  17.  
  18. /**
  19.  * Including the basic class for form items.
  20.  */
  21. require_onceCLASSPATH."forms/items/ABSTHTMLFormItem.class.php" );
  22. /**
  23.  *
  24.  */
  25. require_onceCLASSPATH."forms/items/HTMLSelect.class.php" );
  26. /**
  27.  *
  28.  */
  29. require_onceCLASSPATH."forms/items/HTMLButton.class.php" );
  30. /**
  31.  *
  32.  */
  33. require_onceCLASSPATH."forms/items/HTMLHiddenInput.class.php" );
  34. /**
  35.  *
  36.  */
  37. require_onceCLASSPATH."html/JavaScript.class.php" );
  38. /**
  39.  *
  40.  */
  41. require_onceCLASSPATH."html/HTMLTable.class.php" );
  42.  
  43. /**
  44.  * A class to generate selects mainly to handle multiple relation between two
  45.  * databasetables.
  46.  * <code>
  47.  *                      _________
  48.  *                     |   p   |v|
  49.  *                      ---------
  50.  *               mtrb
  51.  *  +-------+-+   |    +-------+-+
  52.  *  |       | |   V    |       |-|
  53.  *  |       | |  |>>|  |       | |
  54.  *  |  ls   | |        |  rs   | |
  55.  *  |       |-|  |<<|  |       |-|
  56.  *  |       |-|   ^    |       | |
  57.  *  +-------+-+   |    +-------+-+
  58.  *               mtlb
  59.  *
  60.  *
  61.  *   p    - $primaryEntitySelect
  62.  *   ls   - $leftSelect
  63.  *   rs   - $rightSelect
  64.  *   mtlb - $moveToLeftButton
  65.  *   mtrb - $moveToRightButton
  66.  *</code>
  67.  *
  68.  * @package    forms
  69.  * @subpackage items
  70.  * @version    0.1.3
  71.  * @author     Daniel Plücken <daniel@debakel.net>
  72.  * @license    http://www.gnu.org/copyleft/lesser.html
  73.  *              GNU Lesser General Public License
  74.  * @copyright  Copyright (C) 2005 Daniel Plücken <daniel@debakel.net>
  75.  *
  76.  *  This library is free software; you can redistribute it and/or
  77.  *  modify it under the terms of the GNU Lesser General Public
  78.  *  License as published by the Free Software Foundation; either
  79.  *  version 2.1 of the License.
  80.  *
  81.  *  This library is distributed in the hope that it will be useful,
  82.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  83.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  84.  *  GNU Lesser General Public License for more details.
  85.  *
  86.  *  You should have received a copy of the GNU Lesser General
  87.  *  Public License along with this library; if not, write to the
  88.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  89.  *  Boston, MA 02111-1307 USA
  90.  */
  91. {
  92.   /**
  93.    * @var    object $primaryEntityDBTObject 
  94.    * @access public
  95.    */
  96.  
  97.   /**
  98.    * @var    object $secondaryEntityDBTObject 
  99.    * @access public
  100.    */
  101.  
  102.   /**
  103.    * @var    object $targetDBTObject 
  104.    * @access public
  105.    */
  106.  
  107.   /**
  108.    * @var    string $primaryEntityPrimaryKey 
  109.    * @access public
  110.    */
  111.   var $primaryEntityPrimaryKey = "";
  112.  
  113.   /**
  114.    * @var    array  $primaryEntityLabelFieldArr 
  115.    * @access public
  116.    */
  117.   var $primaryEntityLabelFieldArr = array();
  118.  
  119.   /**
  120.    * @var    string $primaryEntitySelectedValue 
  121.    * @access public
  122.    */
  123.  
  124.   /**
  125.    * @var    string $secondaryEntityPrimaryKey 
  126.    * @access public
  127.    */
  128.  
  129.   /**
  130.    * @var    array  $secondaryEntityLabelFieldArr 
  131.    * @access public
  132.    */
  133.   var $secondaryEntityLabelFieldArr = array();
  134.  
  135.   /**
  136.    * @var    string $targetPrimaryEntityKey 
  137.    * @access public
  138.    */
  139.   var $targetPrimaryEntityKey = "";
  140.  
  141.   /**
  142.    * @var    string $targetSecondaryEntityKey 
  143.    * @access public
  144.    */
  145.   var $targetSecondaryEntityKey = "";
  146.  
  147.   /**
  148.    * @var    string $primaryEntityWhereClause 
  149.    * @access public
  150.    */
  151.   var $primaryEntityWhereClause = "";
  152.  
  153.   /**
  154.    * @var    string $secondaryEntityWhereClause 
  155.    * @access public
  156.    */
  157.  
  158.   /**
  159.    * @var    string $targetDBTWhereClause 
  160.    * @access public
  161.    */
  162.   var $targetDBTWhereClause = "";
  163.  
  164.   /**
  165.    * @var    integer $leftSelectSize 
  166.    * @access public
  167.    */
  168.   var $leftSelectSize;
  169.  
  170.   /**
  171.    * @var    integer $rightSelectSize 
  172.    * @access public
  173.    */
  174.  
  175.   /**
  176.    * @var    string $moveToRightButtonLabel 
  177.    * @access public
  178.    */
  179.   var $moveToRightButtonLabel = "";
  180.  
  181.   /**
  182.    * @var    string $moveToLeftButtonLabel 
  183.    * @access public
  184.    */
  185.   var $moveToLeftButtonLabel = "";
  186.  
  187.   /**
  188.    * @var    string $serializedStandardValue 
  189.    * @access public
  190.    */
  191.   var $serializedStandardValue = "";
  192.  
  193.   /**
  194.    * @var    string $moveToRightButtonStyle 
  195.    * @access public
  196.    */
  197.   var $moveToRightButtonStyle = "";
  198.  
  199.   /**
  200.    * @var    string $moveToLeftButtonStyle 
  201.    * @access public
  202.    */
  203.   var $moveToLeftButtonStyle = "";
  204.  
  205.   /**
  206.    * @var    string $primaryEntitySelectStyle 
  207.    * @access public
  208.    */
  209.   var $primaryEntitySelectStyle = "";
  210.  
  211.   /**
  212.    * @var    string $leftSelectStyle 
  213.    * @access public
  214.    */
  215.   var $leftSelectStyle = "";
  216.  
  217.   /**
  218.    * @var    string $rightSelectStyle 
  219.    * @access public
  220.    */
  221.   var $rightSelectStyle = "";
  222.  
  223.   /**
  224.    * @var    string $form_name 
  225.    * @access public
  226.    */
  227.   var $form_name = "";
  228.  
  229.   /**
  230.    * @var    HTMLHiddenInput $hiddenValueInput 
  231.    * @access public
  232.    */
  233.  
  234.   /**
  235.    * @var    string $layout_table_head 
  236.    * @access public
  237.    */
  238.   var $layout_table_head = "";
  239.  
  240.  
  241.   /**
  242.    * Constructor
  243.    *
  244.    * @version 1.5
  245.    * @since   0.1.0
  246.    * @author  Daniel Plücken <daniel@debakel.net>
  247.    * @access  public
  248.    * @param   object $primaryEntityDBTObject       The databasetable object of
  249.    *                                                the entity which should
  250.    *                                                multiple connected to another
  251.    *                                                entity.
  252.    *                                                For example one Person is a
  253.    *                                                member of different Groups.
  254.    *                                                The group is the primary
  255.    *                                                entity if you want to assign
  256.    *                                                persons to an afore selected
  257.    *                                                group.
  258.    * @param   string $primaryEntityPrimaryKey      The field of the primary
  259.    *                                                entity which should used for
  260.    *                                                the relationship to the
  261.    *                                                secondary entity.
  262.    * @param   array  $primaryEntityLabelFieldArr   The fieldnames of the primary
  263.    *                                                entity for the use of labels
  264.    *                                                in the select of the primary
  265.    *                                                entity, so that the primary
  266.    *                                                entity could be identified by
  267.    *                                                the user of the select.
  268.    * @param   string $primaryEntitySelectedValue   The selected value on primary
  269.    *                                                entity side.
  270.    * @param   object $secondaryEntityDBTObject     The databasetable object of
  271.    *                                                the entity which should
  272.    *                                                multiple  connected to
  273.    *                                                another entity.
  274.    *                                                For example some different
  275.    *                                                Groups each have the same
  276.    *                                                Person as a member.
  277.    *                                                The person is the seconary
  278.    *                                                entity if you want to assign
  279.    *                                                persons to an afore selected
  280.    *                                                group.
  281.    * @param   string $secondaryEntityPrimaryKey    The field of the secondary
  282.    *                                                entity which should used for
  283.    *                                                the relationship to the
  284.    *                                                primary entity.
  285.    * @param   array  $secondaryEntityLabelFieldArr The fieldnames which should
  286.    *                                                act as labels for the
  287.    *                                                secondary entity, so the user
  288.    *                                                of the select is able to
  289.    *                                                understand the meaning of
  290.    *                                                the entity.
  291.    * @param   object $targetDBTObject              The databasetable object of
  292.    *                                                the table that should keep
  293.    *                                                the relation of the connected
  294.    *                                                entities.
  295.    * @param   string $targetPrimaryEntityKey       The fieldname where the
  296.    *                                                value of the primary key of
  297.    *                                                the primaray entity should
  298.    *                                                stored.
  299.    * @param   string $targetSecondaryEntityKey     The fieldname where the
  300.    *                                                value of the primary key of
  301.    *                                                the secondary entity should
  302.    *                                                stored.
  303.    * @param   string $primaryEntityWhereClause     This is to filter the primary
  304.    *                                                entities. If their count is
  305.    *                                                only one, the primary entity
  306.    *                                                select will not be shown.
  307.    * @param  integer $leftSelectSize 
  308.    * @param  integer $rightSelectSize 
  309.    * @param   string $moveToRightButtonLabel       The label of the button by
  310.    *                                                which the items of the
  311.    *                                                primary entity should
  312.    *                                                combined with the secondary
  313.    *                                                entity.
  314.    * @param   string $moveToLeftButtonLabel        The label of the button by
  315.    *                                                which the items of the
  316.    *                                                primary entity should
  317.    *                                                lose their connection to the
  318.    *                                                secondary entity.
  319.    * @param   string $serializedStandardValue      The content of the select on
  320.    *                                                the right side. This
  321.    *                                                parameter overules the real
  322.    *                                                value in the databasetable
  323.    *                                                if it is not empty.
  324.    * @return  object 
  325.    */
  326.   function MultiRelationSelect(
  327.                                 $name,
  328.                                 &$primaryEntityDBTObject,
  329.                                 $primaryEntityPrimaryKey,
  330.                                 $primaryEntityLabelFieldArr,
  331.                                 $primaryEntitySelectedValue,
  332.                                 &$secondaryEntityDBTObject,
  333.                                 $secondaryEntityPrimaryKey,
  334.                                 $secondaryEntityLabelFieldArr,
  335.                                 &$targetDBTObject,
  336.                                 $targetPrimaryEntityKey,
  337.                                 $targetSecondaryEntityKey,
  338.                                 $primaryEntityWhereClause  "",
  339.                                 $leftSelectSize            10,
  340.                                 $rightSelectSize           10,
  341.                                 $moveToRightButtonLabel    "&raquo;",
  342.                                 $moveToLeftButtonLabel     "&laquo;",
  343.                                 $serializedStandardValue   ""
  344.                               )
  345.   {
  346.     $this->name = $name;
  347.     $this->primaryEntityDBTObject       = &$primaryEntityDBTObject;
  348.     $this->primaryEntityPrimaryKey      = $primaryEntityPrimaryKey;
  349.     $this->primaryEntityLabelFieldArr   = $primaryEntityLabelFieldArr;
  350.     $this->primaryEntitySelectedValue   = $primaryEntitySelectedValue;
  351.     $this->secondaryEntityDBTObject     = &$secondaryEntityDBTObject;
  352.     $this->secondaryEntityPrimaryKey    = $secondaryEntityPrimaryKey;
  353.     $this->secondaryEntityLabelFieldArr = $secondaryEntityLabelFieldArr;
  354.     $this->targetDBTObject              = &$targetDBTObject;
  355.     $this->targetPrimaryEntityKey       = $targetPrimaryEntityKey;
  356.     $this->targetSecondaryEntityKey     = $targetSecondaryEntityKey;
  357.     $this->primaryEntityWhereClause     = $primaryEntityWhereClause;
  358.     $this->leftSelectSize               = $leftSelectSize;
  359.     $this->rightSelectSize              = $rightSelectSize;
  360.     $this->moveToRightButtonLabel       = $moveToRightButtonLabel;
  361.     $this->moveToLeftButtonLabel        = $moveToLeftButtonLabel;
  362.     $this->serializedStandardValue      = $serializedStandardValue;
  363.   }
  364.  
  365.  
  366.  
  367.   /**
  368.    * Sets the size of the select appering on the left side.
  369.    *
  370.    * @version 1.0
  371.    * @since   0.1.0
  372.    * @author  Daniel Plücken <daniel@debakel.net>
  373.    * @access  public
  374.    * @param   string $int 
  375.    * @return  void 
  376.    */
  377.   function setLeftSelectSize$int )
  378.   $this->leftSelectSize = $int}
  379.  
  380.  
  381.  
  382.   /**
  383.    * Sets the size of the select appering on the right side.
  384.    *
  385.    * @version 1.0
  386.    * @since   0.1.0
  387.    * @author  Daniel Plücken <daniel@debakel.net>
  388.    * @access  public
  389.    * @param   string $int 
  390.    * @return  void 
  391.    */
  392.   function setRightSelectSize$int )
  393.   $this->rightSelectSize = $int}
  394.  
  395.  
  396.  
  397.   /**
  398.    * Sets the styleclass of the select appering on the left side.
  399.    *
  400.    * @version 1.0
  401.    * @since   0.1.0
  402.    * @author  Daniel Plücken <daniel@debakel.net>
  403.    * @access  public
  404.    * @param   string $string 
  405.    * @return  void 
  406.    */
  407.   function setLeftSelectStyle$string )
  408.   $this->leftSelectStyle = $string}
  409.  
  410.  
  411.  
  412.   /**
  413.    * Sets the styleclass of the select appering on the right side.
  414.    *
  415.    * @version 1.0
  416.    * @since   0.1.0
  417.    * @author  Daniel Plücken <daniel@debakel.net>
  418.    * @access  public
  419.    * @param   string $string 
  420.    * @return  void 
  421.    */
  422.   function setRightSelectStyle$string )
  423.   $this->rightSelectStyle = $string}
  424.  
  425.  
  426.  
  427.   /**
  428.    * Sets the styleclass of the button thats function is to move the items from
  429.    * the select on the left side to the select on the right side.
  430.    *
  431.    * @version 1.0
  432.    * @since   0.1.0
  433.    * @author  Daniel Plücken <daniel@debakel.net>
  434.    * @access  public
  435.    * @param   string $string 
  436.    * @return  void 
  437.    */
  438.   function setMoveToRightButtonStyle$string )
  439.   $this->moveToRightButtonStyle = $string}
  440.  
  441.  
  442.  
  443.   /**
  444.    * Sets the styleclass of the button thats function is to move the items from
  445.    * the select on the right side to the select on the left side.
  446.    *
  447.    * @version 1.0
  448.    * @since   0.1.0
  449.    * @author  Daniel Plücken <daniel@debakel.net>
  450.    * @access  public
  451.    * @param   string $string 
  452.    * @return  void 
  453.    */
  454.   function setMoveToLeftButtonStyle$string )
  455.   $this->moveToLeftButtonStyle = $string}
  456.  
  457.  
  458.  
  459.   /**
  460.    * Sets the styleclass of the select appering on the top of the select on the
  461.    * right side.
  462.    *
  463.    * @version 1.0
  464.    * @since   0.1.0
  465.    * @author  Daniel Plücken <daniel@debakel.net>
  466.    * @access  public
  467.    * @param   string $string 
  468.    * @return  void 
  469.    */
  470.   function setPrimaryEntitySelectStyle$string )
  471.   $this->primaryEntitySelectStyle = $string}
  472.  
  473.  
  474.  
  475.   /**
  476.    * Somtimes it can be usefule to filter the achievement from the Target
  477.    * database table.
  478.    *
  479.    * @version 1.0
  480.    * @since   0.1.0
  481.    * @author  Daniel Plücken <daniel@debakel.net>
  482.    * @access  public
  483.    * @param   string $string 
  484.    * @return  void 
  485.    */
  486.   function setWhereClauseOfTargetDBT$string )
  487.   $this->targetDBTWhereClause = $string}
  488.  
  489.  
  490.  
  491.   /**
  492.    * Somtimes it can be usefule to filter the achievement from the secondary
  493.    * entity database table.
  494.    *
  495.    * @version 1.01
  496.    * @since   0.1.0
  497.    * @author  Daniel Plücken <daniel@debakel.net>
  498.    * @access  public
  499.    * @param   string $string 
  500.    * @return  void 
  501.    */
  502.   function setWhereClauseOfsecondaryEntityDBT$string )
  503.   $this->secondaryEntityWhereClause = $string}
  504.  
  505.  
  506.  
  507.   /**
  508.    * Somtimes it can be usefule to filter the achievement from the Target
  509.    * database table.
  510.    *
  511.    * @version 1.0
  512.    * @since   0.1.0
  513.    * @author  Daniel Plücken <daniel@debakel.net>
  514.    * @access  public
  515.    * @param   string $string 
  516.    * @return  void 
  517.    */
  518.   function setNameOfForm$string )
  519.   $this->form_name = $string}
  520.  
  521.  
  522.  
  523.   /**
  524.    * This is for example to add a filter select for the target database table to
  525.    * the top of this select. Then you will be able to align it flush with the
  526.    * right side of this select.
  527.    *
  528.    * @version 1.0
  529.    * @since   0.1.0
  530.    * @author  Daniel Plücken <daniel@debakel.net>
  531.    * @access  public
  532.    * @param   string $string 
  533.    * @return  void 
  534.    */
  535.   function setLayoutTableHead$string )
  536.   $this->layout_table_head = $string}
  537.  
  538.  
  539.  
  540.   /**
  541.    * Returns a generated string based on the attributes of this object.
  542.    *
  543.    * @version 1.41
  544.    * @since   0.1.0
  545.    * @author  Daniel Plücken <daniel@debakel.net>
  546.    * @access  public
  547.    * @return  string 
  548.    */
  549.   function get()
  550.   {
  551.     static $JSoutput 0;
  552.  
  553.     if$JSoutput )
  554.     {
  555.       $GLOBALS["javascript_content"][HTMLSelect::getJS2moveItemfalse );
  556.       $GLOBALS["javascript_content"][HTMLSelect::getJS2getAllValuesFromfalse );
  557.       $GLOBALS["javascript_content"][JavaScript::getSerializefalse );
  558.       $JSoutput++;
  559.     }
  560.  
  561.  
  562.     $tmpArr $this->targetDBTObject->getDatasetsWithFields(
  563.                  array$this->targetSecondaryEntityKey ),
  564.                  $this->targetPrimaryEntityKey." = "
  565.                       ."'".$this->primaryEntitySelectedValue."'"
  566.                 .(
  567.                    !empty$this->targetDBTWhereClause )
  568.                    ? "AND ( ".$this->targetDBTWhereClause." )"
  569.                    : ""
  570.                  )
  571.                                                            );
  572.  
  573.     $movedArr Arrays::getIndexAsArray(
  574.                            $this->targetSecondaryEntityKey$tmpArr
  575.                                        );
  576.  
  577.     if !empty$this->serializedStandardValue ) )
  578.        $movedArr unserialize$this->serializedStandardValue );
  579.  
  580.     $where_list "";
  581.     if is_array$movedArr ) )
  582.        $where_list implode"', '"$movedArr );
  583.  
  584.     $tmpLeftSelect new DBKeySelect(
  585.                              $this->name."leftMultiSelect""",
  586.                              $this->secondaryEntityDBTObject,
  587.                              $this->secondaryEntityLabelFieldArr,
  588.                              $this->secondaryEntityPrimaryKey,
  589.                              $this->secondaryEntityPrimaryKey." NOT IN "
  590.                                                 ."( '".$where_list."' )"
  591.                             .(
  592.                                !empty$this->secondaryEntityWhereClause )
  593.                                ? " AND ".$this->secondaryEntityWhereClause
  594.                                : ""
  595.                              )
  596.                                     );
  597.     $tmpLeftSelect->do_not_disable true;
  598.     $tmpLeftSelect->setSize$this->leftSelectSize );
  599.     $tmpLeftSelect->showStandardLabelfalse );
  600.     $tmpLeftSelect->setMultiple();
  601.     $tmpLeftSelect->setStyle"leftSelectStyle" );
  602.     $tmpLeftSelect->showAltoughOnZeroLabelCount();
  603.  
  604.     $tmpRightSelect =new DBKeySelect(
  605.                              $this->name."rightMultiSelect""",
  606.                              $this->secondaryEntityDBTObject,
  607.                              $this->secondaryEntityLabelFieldArr,
  608.                              $this->secondaryEntityPrimaryKey,
  609.                              $this->secondaryEntityPrimaryKey." IN "
  610.                                             ."( '".$where_list."' )"
  611.                             .(
  612.                                !empty$this->secondaryEntityWhereClause )
  613.                                ? " AND ".$this->secondaryEntityWhereClause
  614.                                : ""
  615.                              )
  616.                                       );
  617.     $tmpRightSelect->do_not_disable true;
  618.     $tmpRightSelect->setSize$this->rightSelectSize );
  619.     $tmpRightSelect->showStandardLabelfalse );
  620.     $tmpRightSelect->setMultiple();
  621.     $tmpRightSelect->setStyle"rightSelectStyle" );
  622.     $tmpRightSelect->showAltoughOnZeroLabelCount();
  623.  
  624.  
  625.     ifempty$primaryEntitySelectedValue ) )
  626.       $primaryEntitySelectedValue $_REQUEST["PrimarySelect"];
  627.  
  628.     $tmpPrimaryEntitySelect new DBKeySelect(
  629.                                        $this->name."PrimarySelect",
  630.                                        $this->primaryEntitySelectedValue,
  631.                                        $this->primaryEntityDBTObject,
  632.                                        $this->primaryEntityLabelFieldArr,
  633.                                        $this->primaryEntityPrimaryKey,
  634.                                        $this->primaryEntityWhereClause,
  635.                                        $this->primarySelectChangeOrder /* todo */
  636.                                              );
  637.     $tmpPrimaryEntitySelect->setStyle"primaryEntitySelectStyle" );
  638.  
  639.  
  640.     $tmpHiddenValueInput =new HTMLHiddenInput(
  641.                      $this->name."_serialized_arr",
  642.                      str_replace(
  643.                                   "\"""&quot;",
  644.                                   serialize$tmpRightSelect->getValueArr() )
  645.                                 )
  646.                                                );
  647.  
  648.     $tmpMoveToLeftButton =new HTMLButton(
  649.                                              "movingToLeftButton",
  650.                                              $this->moveToLeftButtonLabel
  651.                                           );
  652.     $tmpMoveToLeftButton->setStyle"moveToRightButtonStyle" );
  653.  
  654.     $tmpMoveToRightButton =new HTMLButton(
  655.                                              "movingToRightButton",
  656.                                              $this->moveToRightButtonLabel
  657.                                            );
  658.     $tmpMoveToRightButton->setStyle"moveToLeftButtonStyle" );
  659.  
  660.  
  661.     $tmp_add_hidden_item false;
  662.     if(
  663.         !function_exists"is_a" )
  664.      && (
  665.           get_class$this->parentform == "htmlform"
  666.        || get_parent_class$this->parentform == "htmlform"
  667.         )
  668.       )
  669.     {
  670.       $this->parentform->addHiddenFormItem$tmpHiddenValueInput );
  671.       $tmp_parent_form_name $this->parentform->name;
  672.     }
  673.     else
  674.     if(
  675.         function_exists"is_a" )
  676.      && (
  677.           is_a$this->parentform"HTMLForm" )
  678.        || is_subclass_of$this->parentform"HTMLForm" )
  679.         )
  680.       )
  681.     {
  682.       $this->parentform->addHiddenFormItem$tmpHiddenValueInput );
  683.       $tmp_parent_form_name $this->parentform->name;
  684.     }
  685.     else
  686.     {
  687.       $tmp_add_hidden_item  true;
  688.       $tmp_parent_form_name $this->form_name;
  689.     }
  690.  
  691.     $tmpMoveToLeftButton->setOnMouseUp(
  692.                    "window.moveItemTo( "
  693.                               ."document."
  694.                                .$tmp_parent_form_name."."
  695.                                .$this->name."rightMultiSelect, "
  696.                               ."document."
  697.                                .$tmp_parent_form_name."."
  698.                                .$this->name."leftMultiSelect "
  699.                                    .");"
  700.                    ."document.".$tmp_parent_form_name."."
  701.                                .$this->name."_serialized_arr.value "
  702.                  ."= php_serialize( "
  703.                        ."getAllValuesFrom( document."
  704.                                           .$tmp_parent_form_name."."
  705.                                           .$tmpRightSelect->name." "
  706.                                        .") "
  707.                             .");"
  708.                                       );
  709.  
  710.     $tmpMoveToRightButton->setOnMouseUp(
  711.                             "window.moveItemTo( "
  712.                                                ."document."
  713.                                                .$tmp_parent_form_name."."
  714.                                                .$this->name."leftMultiSelect, "
  715.                                                ."document."
  716.                                                .$tmp_parent_form_name."."
  717.                                                .$this->name."rightMultiSelect "
  718.                                             .");"
  719.                    ."document.".$tmp_parent_form_name."."
  720.                                .$this->name."_serialized_arr.value "
  721.                  ."= php_serialize( "
  722.                        ."getAllValuesFrom( document."
  723.                                           .$tmp_parent_form_name."."
  724.                                           .$tmpRightSelect->name." "
  725.                                        .") "
  726.                                 .");"
  727.                                       );
  728.  
  729.     $rows          "";
  730.     $width         "";
  731.     $height        "";
  732.     $cellWidthArr  "";
  733.     $cellHeightArr "";
  734.     $tbl =new HTMLTable(
  735.                            3$rows$width$height,
  736.                            $cellWidthArr$cellHeightArr,
  737.                            $cellpadding 0$cellspacing 0,
  738.                            $border 0$style "MultiRelationSelect",
  739.                            $noformat false
  740.                          );
  741.     if!empty$this->layout_table_head ) )
  742.     {
  743.       $tbl->addCol(
  744.                     $this->layout_table_head,
  745.                     "MultiRelationSelectHead"3
  746.                   );
  747.     }
  748.  
  749.     ifcount$tmpPrimaryEntitySelect->ValueArr )
  750.     {
  751.       $tbl->addCol"""");
  752.       $tbl->addCol(
  753.                     $tmpPrimaryEntitySelect->get(),
  754.                     "MultiRelationSelectPE"
  755.                   );
  756.     }
  757.  
  758.     # Select-Left
  759.     $tbl->addCol(
  760.                   $tmpLeftSelect->get(),
  761.                   "MultiRelationSelectSL"
  762.                 );
  763.  
  764.     # Buttons
  765.     $tbl->addCol(
  766.                   $tmpMoveToRightButton->get()."\r\n"
  767.                  ."<br><br>\r\n"
  768.                  .$tmpMoveToLeftButton->get()."\r\n"
  769.                  .(
  770.                     $tmp_add_hidden_item
  771.                     ? $tmpHiddenValueInput->get()
  772.                     : ""
  773.                   ),
  774.                   "MultiRelationSelectBT"
  775.                 );
  776.  
  777.     # Select-Right
  778.     $tbl->addCol(
  779.                   $tmpRightSelect->get(),
  780.                   "MultiRelationSelectSR"
  781.                 );
  782.  
  783.     return $tbl->get();
  784.   }
  785. // End of class MultiRelationSelect
  786. ?>

Documentation generated on Thu, 05 Jun 2008 19:13:52 +0200 by phpDocumentor 1.4.1