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
00054 require ('init.php');
00055 require ('template.php');
00056 require_once (PATH_t3lib.'class.t3lib_tcemain.php');
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00078 class SC_tce_db {
00079
00080
00081 var $flags;
00082 var $data;
00083 var $cmd;
00084 var $mirror;
00085 var $cacheCmd;
00086 var $redirect;
00087 var $prErr;
00088 # var $_disableRTE;
00089 var $CB;
00090 var $vC;
00091 var $uPT;
00092 var $generalComment;
00093
00094
00095 var $include_once=array();
00096 var $tce;
00097
00098
00099
00100
00106 function init() {
00107 global $BE_USER;
00108
00109
00110 $this->flags = t3lib_div::_GP('flags');
00111 $this->data = t3lib_div::_GP('data');
00112 $this->cmd = t3lib_div::_GP('cmd');
00113 $this->mirror = t3lib_div::_GP('mirror');
00114 $this->cacheCmd = t3lib_div::_GP('cacheCmd');
00115 $this->redirect = t3lib_div::_GP('redirect');
00116 $this->prErr = t3lib_div::_GP('prErr');
00117 $this->_disableRTE = t3lib_div::_GP('_disableRTE');
00118 $this->CB = t3lib_div::_GP('CB');
00119 $this->vC = t3lib_div::_GP('vC');
00120 $this->uPT = t3lib_div::_GP('uPT');
00121 $this->generalComment = t3lib_div::_GP('generalComment');
00122
00123
00124 $this->tce = t3lib_div::makeInstance('t3lib_TCEmain');
00125 $this->tce->stripslashes_values=0;
00126 $this->tce->generalComment = $this->generalComment;
00127
00128
00129 if ($BE_USER->uc['recursiveDelete']) {
00130 $this->tce->deleteTree = 1;
00131 }
00132 if ($BE_USER->uc['copyLevels']) {
00133 $this->tce->copyTree = t3lib_div::intInRange($BE_USER->uc['copyLevels'],0,100);
00134 }
00135 if ($BE_USER->uc['neverHideAtCopy']) {
00136 $this->tce->neverHideAtCopy = 1;
00137 }
00138
00139 $TCAdefaultOverride = $BE_USER->getTSConfigProp('TCAdefaults');
00140 if (is_array($TCAdefaultOverride)) {
00141 $this->tce->setDefaultsFromUserTS($TCAdefaultOverride);
00142 }
00143
00144
00145 if ($this->flags['reverseOrder']) {
00146 $this->tce->reverseOrder=1;
00147 }
00148
00149 # $this->tce->disableRTE = $this->_disableRTE;
00150
00151
00152 if (is_array($this->CB)) {
00153 $this->include_once[]=PATH_t3lib.'class.t3lib_clipboard.php';
00154 }
00155 }
00156
00162 function initClipboard() {
00163 if (is_array($this->CB)) {
00164 $clipObj = t3lib_div::makeInstance('t3lib_clipboard');
00165 $clipObj->initializeClipboard();
00166 if ($this->CB['paste']) {
00167 $clipObj->setCurrentPad($this->CB['pad']);
00168 $this->cmd = $clipObj->makePasteCmdArray($this->CB['paste'],$this->cmd);
00169 }
00170 if ($this->CB['delete']) {
00171 $clipObj->setCurrentPad($this->CB['pad']);
00172 $this->cmd = $clipObj->makeDeleteCmdArray($this->cmd);
00173 }
00174 }
00175 }
00176
00182 function main() {
00183 global $BE_USER,$TYPO3_CONF_VARS;
00184
00185
00186 $this->tce->start($this->data,$this->cmd);
00187 if (is_array($this->mirror)) {$this->tce->setMirror($this->mirror);}
00188
00189
00190 $refInfo=parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
00191 $httpHost = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');
00192 if ($httpHost!=$refInfo['host'] && $this->vC!=$BE_USER->veriCode() && !$TYPO3_CONF_VARS['SYS']['doNotCheckReferer']) {
00193 $this->tce->log('',0,0,0,1,'Referer host "%s" and server host "%s" did not match and veriCode was not valid either!',1,array($refInfo['host'],$httpHost));
00194 } else {
00195
00196 $this->tce->process_uploads($_FILES);
00197
00198
00199 $this->tce->process_datamap();
00200 $this->tce->process_cmdmap();
00201
00202
00203 $this->tce->clear_cacheCmd($this->cacheCmd);
00204
00205
00206 if ($this->uPT && (isset($this->data['pages'])||isset($this->cmd['pages']))) {
00207 t3lib_BEfunc::getSetUpdateSignal('updatePageTree');
00208 }
00209 }
00210 }
00211
00218 function finish() {
00219
00220 if ($this->prErr) {
00221 $this->tce->printLogErrorMessages($this->redirect);
00222 }
00223
00224 if ($this->redirect && !$this->tce->debug) {
00225 Header('Location: '.t3lib_div::locationHeaderUrl($this->redirect));
00226 }
00227 }
00228 }
00229
00230
00231 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/tce_db.php']) {
00232 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/tce_db.php']);
00233 }
00234
00235
00236
00237
00238
00239
00240
00241
00242 $SOBE = t3lib_div::makeInstance('SC_tce_db');
00243 $SOBE->init();
00244
00245
00246 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
00247
00248 $SOBE->initClipboard();
00249 $SOBE->main();
00250 $SOBE->finish();
00251 ?>