* @package TYPO3 * @subpackage cal */ require_once(PATH_typo3.'wizard_edit.php'); class ux_SC_wizard_edit extends SC_wizard_edit { function main() { global $TCA; if ($this->doClose) { $this->closeWindow(); } else { // Initialize: $table = $this->P['table']; $field = $this->P['field']; t3lib_div::loadTCA($table); $config = $TCA[$table]['columns'][$field]['config']; $fTable = $this->P['currentValue']<0 ? $config['neg_foreign_table'] : $config['foreign_table']; if( !empty( $this->P['params']['table'] ) ) { $fTable = $this->P['currentValue']<0 ? $this->P['params']['neg_table'] : $this->P['params']['table']; } // Detecting the various allowed field type setups and acting accordingly. if (is_array($config) && $config['type']=='select' && !$config['MM'] && $config['maxitems']<=1 && t3lib_div::testInt($this->P['currentValue']) && $this->P['currentValue'] && $fTable) { // SINGLE value: header('Location: '.t3lib_div::locationHeaderUrl('alt_doc.php?returnUrl='.rawurlencode('wizard_edit.php?doClose=1').'&edit['.$fTable.']['.$this->P['currentValue'].']=edit')); } elseif (is_array($config) && $this->P['currentSelectedValues'] && (($config['type']=='select' && $config['foreign_table']) || ($config['type']=='group' && $config['internal_type']=='db'))) { // MULTIPLE VALUES: // Init settings: $allowedTables = $config['type']=='group' ? $config['allowed'] : $config['foreign_table'].','.$config['neg_foreign_table']; $prependName=1; $params=''; // Selecting selected values into an array: $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); $dbAnalysis->start($this->P['currentSelectedValues'],$allowedTables); $value = $dbAnalysis->getValueArray($prependName); // Traverse that array and make parameters for alt_doc.php: foreach($value as $rec) { $recTableUidParts = t3lib_div::revExplode('_',$rec,2); $params.='&edit['.$recTableUidParts[0].']['.$recTableUidParts[1].']=edit'; } // Redirect to alt_doc.php: header('Location: '.t3lib_div::locationHeaderUrl('alt_doc.php?returnUrl='.rawurlencode('wizard_edit.php?doClose=1').$params)); } else { $this->closeWindow(); } } } } if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cal/xclass/class.ux_edit_wizard.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cal/xclass/class.ux_edit_wizard.php']); } ?>