00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00052 $BACK_PATH='';
00053 require ('init.php');
00054 require ('template.php');
00055 $LANG->includeLLFile('EXT:lang/locallang_wizards.xml');
00056 require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00076 class SC_wizard_edit {
00077
00078
00079 var $P;
00080 var $doClose;
00081
00082
00083
00084
00090 function init() {
00091 $this->P = t3lib_div::_GP('P');
00092 $this->doClose = t3lib_div::_GP('doClose');
00093 }
00094
00101 function main() {
00102 global $TCA;
00103
00104 if ($this->doClose) {
00105 $this->closeWindow();
00106 } else {
00107
00108
00109 $table = $this->P['table'];
00110 $field = $this->P['field'];
00111 t3lib_div::loadTCA($table);
00112 $config = $TCA[$table]['columns'][$field]['config'];
00113 $fTable = $this->P['currentValue']<0 ? $config['neg_foreign_table'] : $config['foreign_table'];
00114
00115
00116 if (is_array($config) && $config['type']=='select' && !$config['MM'] && $config['maxitems']<=1 && t3lib_div::testInt($this->P['currentValue']) && $this->P['currentValue'] && $fTable) {
00117 header('Location: '.t3lib_div::locationHeaderUrl('alt_doc.php?returnUrl='.rawurlencode('wizard_edit.php?doClose=1').'&edit['.$fTable.']['.$this->P['currentValue'].']=edit'));
00118 } elseif (is_array($config) && $this->P['currentSelectedValues'] && (($config['type']=='select' && $config['foreign_table']) || ($config['type']=='group' && $config['internal_type']=='db'))) {
00119
00120
00121 $allowedTables = $config['type']=='group' ? $config['allowed'] : $config['foreign_table'].','.$config['neg_foreign_table'];
00122 $prependName=1;
00123 $params='';
00124
00125
00126 $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
00127 $dbAnalysis->start($this->P['currentSelectedValues'],$allowedTables);
00128 $value = $dbAnalysis->getValueArray($prependName);
00129
00130
00131 foreach($value as $rec) {
00132 $recTableUidParts = t3lib_div::revExplode('_',$rec,2);
00133 $params.='&edit['.$recTableUidParts[0].']['.$recTableUidParts[1].']=edit';
00134 }
00135
00136
00137 header('Location: '.t3lib_div::locationHeaderUrl('alt_doc.php?returnUrl='.rawurlencode('wizard_edit.php?doClose=1').$params));
00138 } else {
00139 $this->closeWindow();
00140 }
00141 }
00142 }
00143
00149 function closeWindow() {
00150 echo '<script language="javascript" type="text/javascript">close();</script>';
00151 exit;
00152 }
00153 }
00154
00155
00156 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_edit.php']) {
00157 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_edit.php']);
00158 }
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 $SOBE = t3lib_div::makeInstance('SC_wizard_edit');
00173 $SOBE->init();
00174 $SOBE->main();
00175 ?>