- function mergeConfig($table, $conf, $render)
- {
- $this->mapcols[$table] = array();
- $options = &PEAR::getStaticProperty('DB_DataObject','options');
- if (isset($options['modtables'])) {
- $this->modtables = $options['modtables'];
- $this->modmap = $options['modmap'];
- $this->modsql = $options['modsql'];
- }
-
-
- foreach($conf as $ocol=>$info) {
- // format col => showval..
- //list($rtc, $rshow) = explode(':', $info);
- list($tab,$col) = explode(':', $info);
- //print_r($render);
- $rshow = $render[$tab];
-
- $this->mapcols[$table][$ocol] = array('table'=>$tab, 'col' => $col);
-
- // for the grid...
-
- // reader:
- //- just add an extra line..
- if (!isset($this->def['readers'][$tab][$rshow])){
- echo "WARNING in links.ini TABLE $tab does not have renderer $rshow <BR>\n";
- continue;
- }
-
- // for the readers.. we need to merge all the columns in the left to the right...
-
- // table => original
- // ocol => column in table
- // tab => remote table
- // col => right col linked to...
-
- $rdef = $this->_definitions[$tab];
-
-
- foreach($rdef as $t) {
- //copy typedata from old coll
- $this->def['readers'][$table][$ocol.'-'. $t->name] = $this->def['readers'][$tab][$t->name];
- $this->def['readers'][$table][$ocol.'-'. $t->name]['name'] = $ocol.'_'. $t->name;
- }
-
-
-
-
-
- // remove the def column from the id one..
- if (isset($this->def['colmodels'][$table][$ocol])) {
- unset($this->def['colmodels'][$table][$ocol]);
- }
- $this->def['colmodels'][$table][$ocol.'-'. $rshow] =
- $this->def['colmodels'][$tab][$rshow];
-
- // change the header name (merge of two..)
- list($colname,) = explode('_',$ocol,2);
-
- $this->def['colmodels'][$table][$ocol.'-'. $rshow]['dataIndex'] = $ocol.'_'. $rshow;
- $this->def['colmodels'][$table][$ocol.'-'. $rshow]['id'] = $ocol.'-'. $rshow;
-
- $this->def['colmodels'][$table][$ocol.'-'. $rshow]['header'] = ucwords($colname . ' ' .
- $this->def['colmodels'][$tab][$rshow]['header']);
-
- // last of all add replace the old $col, with
- $p = array_search($ocol, empty($this->def['order'][$table]) ? array() : $this->def['order'][$table]);
- $this->def['order'][$table][$p] = $ocol.'-'. $rshow;
- $this->def['order'][$table][] = $ocol;
-
- // --- now for forms!!!!
-
-
- }