Public Member Functions | |
init () | |
Initialization of the script. | |
main () | |
Main function Makes a header-location redirect to an edit form IF POSSIBLE from the passed data - otherwise the window will just close. | |
closeWindow () | |
Printing a little JavaScript to close the open window. | |
Public Attributes | |
$P | |
$doClose |
|
Printing a little JavaScript to close the open window.
Definition at line 149 of file wizard_edit.php. Referenced by main(). 00149 { 00150 echo '<script language="javascript" type="text/javascript">close();</script>'; 00151 exit; 00152 }
|
|
Initialization of the script.
Definition at line 90 of file wizard_edit.php. 00090 { 00091 $this->P = t3lib_div::_GP('P'); 00092 $this->doClose = t3lib_div::_GP('doClose'); // Used for the return URL to alt_doc.php so that we can close the window. 00093 }
|
|
Main function Makes a header-location redirect to an edit form IF POSSIBLE from the passed data - otherwise the window will just close.
Definition at line 101 of file wizard_edit.php. References $TCA, closeWindow(), header(), and table(). 00101 { 00102 global $TCA; 00103 00104 if ($this->doClose) { 00105 $this->closeWindow(); 00106 } else { 00107 00108 // Initialize: 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 // Detecting the various allowed field type setups and acting accordingly. 00116 if (is_array($config) && $config['type']=='select' && !$config['MM'] && $config['maxitems']<=1 && t3lib_div::testInt($this->P['currentValue']) && $this->P['currentValue'] && $fTable) { // SINGLE value: 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'))) { // MULTIPLE VALUES: 00119 00120 // Init settings: 00121 $allowedTables = $config['type']=='group' ? $config['allowed'] : $config['foreign_table'].','.$config['neg_foreign_table']; 00122 $prependName=1; 00123 $params=''; 00124 00125 // Selecting selected values into an array: 00126 $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); 00127 $dbAnalysis->start($this->P['currentSelectedValues'],$allowedTables); 00128 $value = $dbAnalysis->getValueArray($prependName); 00129 00130 // Traverse that array and make parameters for alt_doc.php: 00131 foreach($value as $rec) { 00132 $recTableUidParts = t3lib_div::revExplode('_',$rec,2); 00133 $params.='&edit['.$recTableUidParts[0].']['.$recTableUidParts[1].']=edit'; 00134 } 00135 00136 // Redirect to alt_doc.php: 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 }
|
|
Definition at line 80 of file wizard_edit.php. |
|
Definition at line 79 of file wizard_edit.php. |