/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEListBoxMaster.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FEListBoxMaster.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Thu May 6 16:57:29 2004 UTC revision 1.2 by jonen, Thu Aug 11 14:09:59 2005 UTC
# Line 50  class FEListBoxMaster extends FEListBox Line 50  class FEListBoxMaster extends FEListBox
50       *       *
51       * @param the slave       * @param the slave
52       */       */
53      function set_slave_data(&$slave,$value) {      function set_slave_data(&$slave, $value) {
54            
55            $flipped_array = array_flip($this->_data_list);
56            if (isset($flipped_array[$value])) $value = $flipped_array[$value];
57                  
58          if (isset($value) && isset($this->_mdata[$value]["slave"])) {          if (isset($value) && isset($this->_mdata[$value]["slave"])) {
59              $slave->set_list_data($this->_mdata[$value]["slave"]);              $slave->set_list_data($this->_mdata[$value]["slave"]);
60          }else{          }else{
# Line 80  class FEListBoxMaster extends FEListBox Line 84  class FEListBoxMaster extends FEListBox
84              //Create the JS array that will be used to populate the slave when master value changes              //Create the JS array that will be used to populate the slave when master value changes
85              $js_array = "slave_".$slave_name." = new Array();\n";              $js_array = "slave_".$slave_name." = new Array();\n";
86              foreach($this->_mdata as $master => $rec){              foreach($this->_mdata as $master => $rec){
87                  if(isset($rec['slave']) && is_array($rec['slave'])){  
88                      $js_array .= "slave_".$slave_name."[\"".$master."\"] = new Array();\n";                  if(isset($rec['slave']) && is_array($rec['slave'])){                    
89                        $js_array .= "slave_".$slave_name."[\"".$rec['code']."\"] = new Array();\n";
90                      foreach($rec['slave'] as $slave => $slave_rec){                      foreach($rec['slave'] as $slave => $slave_rec){
91                          $js_array .= "slave_".$slave_name."[\"".$master."\"][\"".$slave_rec."\"] = '".$slave."';\n";                          $js_array .= "slave_".$slave_name."[\"".$rec['code']."\"][\"".$slave_rec."\"] = '".$slave."';\n";
92                      }                      }
93                  }                  }
94              }              }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed