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{ |
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 |
} |
} |