📄 index.php
字号:
$row[] = ' <tr class="bgColor4"> <td><strong>'.$LANG->getLL('makeconfig_excludeElements',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'excludedElements', $GLOBALS['BACK_PATH'],'').'</td> <td>'.$excludeHiddenFields.' '.(count($inData['exclude']) ? '<em>'.implode(', ',array_keys($inData['exclude'])).'</em><hr/><label for="checkExclude">'.$LANG->getLL('makeconfig_clearAllExclusions',1).'</label> <input type="checkbox" name="tx_impexp[exclude]" id="checkExclude" value="1" />' : $LANG->getLL('makeconfig_noExcludedElementsYet',1)).' </td> </tr>'; // Add buttons: $row[] = ' <tr class="bgColor4"> <td> </td> <td> <input type="submit" value="'.$LANG->getLL('makeadvanc_update',1).'" /> <input type="hidden" name="tx_impexp[download_export_name]" value="'.substr($nameSuggestion,0,30).'" /> </td> </tr>'; } /** * Create advanced options form * * @param array Form configurat data * @param array Table row accumulation variable. This is filled with table rows. * @return void Sets content in $this->content */ function makeAdvancedOptionsForm($inData, &$row) { global $LANG; // Soft references $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">'.$LANG->getLL('makeadvanc_softReferences',1).'</td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><label for="checkExcludeHTMLfileResources"><strong>'.$LANG->getLL('makeadvanc_excludeHtmlCssFile',1).'</strong></label>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'htmlCssResources', $GLOBALS['BACK_PATH'],'').'</td> <td><input type="checkbox" name="tx_impexp[excludeHTMLfileResources]" id="checkExcludeHTMLfileResources" value="1"'.($inData['excludeHTMLfileResources'] ? ' checked="checked"' : '').' /></td> </tr>'; // Extensions $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">'.$LANG->getLL('makeadvanc_extensionDependencies',1).'</td> </tr>'; $row[] = ' <tr class="bgColor4"> <td><strong>'.$LANG->getLL('makeadvanc_selectExtensionsThatThe',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'extensionDependencies', $GLOBALS['BACK_PATH'],'').'</td> <td>'.$this->extensionSelector('tx_impexp[extension_dep]',$inData['extension_dep']).'</td> </tr>'; // Add buttons: $row[] = ' <tr class="bgColor4"> <td> </td> <td> <input type="submit" value="'.$LANG->getLL('makesavefo_update',1).'" /> <input type="hidden" name="tx_impexp[download_export_name]" value="'.substr($nameSuggestion,0,30).'" /> </td> </tr>'; } /** * Create configuration form * * @param array Form configurat data * @param array Table row accumulation variable. This is filled with table rows. * @return void Sets content in $this->content */ function makeSaveForm($inData, &$row) { global $LANG; // Presets: $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">'.$LANG->getLL('makesavefo_presets',1).'</td> </tr>'; $opt = array(''); $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( '*', 'tx_impexp_presets', '(public>0 || user_uid='.intval($GLOBALS['BE_USER']->user['uid']).')'. ($inData['pagetree']['id'] ? ' AND (item_uid='.intval($inData['pagetree']['id']).' OR item_uid=0)' : '') ); if (is_array($presets)) { foreach($presets as $presetCfg) { $opt[$presetCfg['uid']] = $presetCfg['title'].' ['.$presetCfg['uid'].']'. ($presetCfg['public'] ? ' [Public]' : ''). ($presetCfg['user_uid']===$GLOBALS['BE_USER']->user['uid'] ? ' [Own]' : ''); } } $row[] = ' <tr class="bgColor4"> <td><strong>'.$LANG->getLL('makesavefo_presets',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'presets', $GLOBALS['BACK_PATH'],'').'</td> <td> '.$LANG->getLL('makesavefo_selectPreset',1).'<br/> '.$this->renderSelectBox('preset[select]','',$opt).' <br/> <input type="submit" value="'.$LANG->getLL('makesavefo_load',1).'" name="preset[load]" /> <input type="submit" value="'.$LANG->getLL('makesavefo_save',1).'" name="preset[save]" onclick="return confirm(\''.$LANG->getLL('makesavefo_areYouSure',1).'\');" /> <input type="submit" value="'.$LANG->getLL('makesavefo_delete',1).'" name="preset[delete]" onclick="return confirm(\''.$LANG->getLL('makesavefo_areYouSure',1).'\');" /> <input type="submit" value="'.$LANG->getLL('makesavefo_merge',1).'" name="preset[merge]" onclick="return confirm(\''.$LANG->getLL('makesavefo_areYouSure',1).'\');" /> <br/> '.$LANG->getLL('makesavefo_titleOfNewPreset',1).' <input type="text" name="tx_impexp[preset][title]" value="'.htmlspecialchars($inData['preset']['title']).'"'.$this->doc->formWidth(30).' /><br/> <label for="checkPresetPublic">'.$LANG->getLL('makesavefo_public',1).'</label> <input type="checkbox" name="tx_impexp[preset][public]" id="checkPresetPublic" value="1"'.($inData['preset']['public'] ? ' checked="checked"' : '').' /><br/> </td> </tr>'; // Output options: $row[] = ' <tr class="tableheader bgColor5"> <td colspan="2">'.$LANG->getLL('makesavefo_outputOptions',1).'</td> </tr>'; // Meta data: $tempDir = $this->userTempFolder(); if ($tempDir) { $thumbnails = t3lib_div::getFilesInDir($tempDir,'png,gif,jpg'); array_unshift($thumbnails,''); } else $thumbnails = FALSE; $row[] = ' <tr class="bgColor4"> <td><strong>'.$LANG->getLL('makesavefo_metaData',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'metadata', $GLOBALS['BACK_PATH'],'').'</td> <td> '.$LANG->getLL('makesavefo_title',1).' <br/> <input type="text" name="tx_impexp[meta][title]" value="'.htmlspecialchars($inData['meta']['title']).'"'.$this->doc->formWidth(30).' /><br/> '.$LANG->getLL('makesavefo_description',1).' <br/> <input type="text" name="tx_impexp[meta][description]" value="'.htmlspecialchars($inData['meta']['description']).'"'.$this->doc->formWidth(30).' /><br/> '.$LANG->getLL('makesavefo_notes',1).' <br/> <textarea name="tx_impexp[meta][notes]"'.$this->doc->formWidth(30,1).'>'.t3lib_div::formatForTextarea($inData['meta']['notes']).'</textarea><br/> '.(is_array($thumbnails) ? ' '.$LANG->getLL('makesavefo_thumbnail',1).'<br/> '.$this->renderSelectBox('tx_impexp[meta][thumbnail]',$inData['meta']['thumbnail'],$thumbnails).'<br/> '.($inData['meta']['thumbnail'] ? '<img src="'.$this->doc->backPath.'../'.substr($tempDir,strlen(PATH_site)).$thumbnails[$inData['meta']['thumbnail']].'" vspace="5" style="border: solid black 1px;" alt="" /><br/>' : '').' '.$LANG->getLL('makesavefo_uploadThumbnail',1).'<br/> <input type="file" name="upload_1" '.$this->doc->formWidth(30).' size="30" /><br/> <input type="hidden" name="file[upload][1][target]" value="'.htmlspecialchars($tempDir).'" /> <input type="hidden" name="file[upload][1][data]" value="1" /><br /> ' : '').' </td> </tr>'; // Add file options: $savePath = $this->userSaveFolder(); $opt = array(); if ($this->export->compress) { $opt['t3d_compressed'] = $LANG->getLL('makesavefo_t3dFileCompressed'); } $opt['t3d'] = $LANG->getLL('makesavefo_t3dFile'); $opt['xml'] = $LANG->getLL('makesavefo_xml'); $row[] = ' <tr class="bgColor4"> <td><strong>'.$LANG->getLL('makesavefo_fileFormat',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'fileFormat', $GLOBALS['BACK_PATH'],'').'</td> <td>'.$this->renderSelectBox('tx_impexp[filetype]',$inData['filetype'],$opt).'<br/> '.$LANG->getLL('makesavefo_maxSizeOfFiles',1).'<br/> <input type="text" name="tx_impexp[maxFileSize]" value="'.htmlspecialchars($inData['maxFileSize']).'"'.$this->doc->formWidth(10).' /><br/> '.($savePath ? sprintf($LANG->getLL('makesavefo_filenameSavedInS',1),substr($savePath,strlen(PATH_site))).'<br/> <input type="text" name="tx_impexp[filename]" value="'.htmlspecialchars($inData['filename']).'"'.$this->doc->formWidth(30).' /><br/>' : '').' </td> </tr>'; // Add buttons: $row[] = ' <tr class="bgColor4"> <td> </td> <td><input type="submit" value="'.$LANG->getLL('makesavefo_update',1).'" /> - <input type="submit" value="'.$LANG->getLL('makesavefo_downloadExport',1).'" name="tx_impexp[download_export]" />'. ($savePath ? ' - <input type="submit" value="'.$LANG->getLL('importdata_saveToFilename',1).'" name="tx_impexp[save_export]" />' : '').'</td> </tr>'; } /************************** * * IMPORT FUNCTIONS * **************************/ /** * Import part of module * * @param array Content of POST VAR tx_impexp[].. * @return void Setting content in $this->content */ function importData($inData) { global $TCA,$LANG,$BE_USER; $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) { if ($BE_USER->user['admin'] && !$this->id) { $this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0); } $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50); $this->content.= $this->doc->section('',$headerSection); if ($inData['new_import']) { unset($inData['import_mode']); } $import = t3lib_div::makeInstance('tx_impexp'); $import->init(0,'import'); $import->update = $inData['do_update']; $import->import_mode = $inData['import_mode']; $import->enableLogging = $inData['enableLogging']; $import->global_ignore_pid = $inData['global_ignore_pid']; $import->force_all_UIDS = $inData['force_all_UIDS']; $import->showDiff = !$inData['notShowDiff']; $import->allowPHPScripts = $inData['allowPHPScripts']; $import->softrefInputValues = $inData['softrefInputValues']; // OUTPUT creation: $menuItems = array(); // Make input selector: $path = 'fileadmin/'; // must have trailing slash. $filesInDir = t3lib_div::getFilesInDir(PATH_site.$path,'t3d,xml',1,1); if (is_dir(PATH_site.$path.'export/')) { $filesInDir = array_merge($filesInDir, t3lib_div::getFilesInDir(PATH_site.$path.'export/','t3d,xml',1,1)); } $tempFolder = $this->userTempFolder(); if ($tempFolder) { $temp_filesInDir = t3lib_div::getFilesInDir($tempFolder,'t3d,xml',1,1); $filesInDir = array_merge($filesInDir, $temp_filesInDir); } // Configuration $row = array(); $opt = array(''); foreach($filesInDir as $file) { $opt[$file] = substr($file,strlen(PATH_site)); } $row[] = '<tr class="bgColor5"> <td colspan="2"><strong>'.$LANG->getLL('importdata_selectFileToImport',1).'</strong></td> </tr>'; $row[] = '<tr class="bgColor4"> <td><strong>'.$LANG->getLL('importdata_file',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'importFile', $GLOBALS['BACK_PATH'],'').'</td> <td>'. $this->renderSelectBox('tx_impexp[file]',$inData['file'],$opt).'<br />'.sprintf($LANG->getLL('importdata_fromPathS',1),$path). (!$import->compress ? '<br /><span class="typo3-red">'.$LANG->getLL('importdata_noteNoDecompressorAvailable',1).'</span>':''). '</td> </tr>'; $row[] = '<tr class="bgColor5"> <td colspan="2"><strong>'.$LANG->getLL('importdata_importOptions',1).'</strong></td> </tr>'; $row[] = '<tr class="bgColor4"> <td><strong>'.$LANG->getLL('importdata_update',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'update', $GLOBALS['BACK_PATH'],'').'</td> <td> <input type="checkbox" name="tx_impexp[do_update]" id="checkDo_update" value="1"'.($inData['do_update'] ? ' checked="checked"' : '').' /> <label for="checkDo_update">'.$LANG->getLL('importdata_updateRecords',1).'</label><br/> <em>('.$LANG->getLL('importdata_thisOptionRequiresThat',1).')</em>'. ($inData['do_update'] ? ' <hr/> <input type="checkbox" name="tx_impexp[global_ignore_pid]" id="checkGlobal_ignore_pid" value="1"'.($inData['global_ignore_pid'] ? ' checked="checked"' : '').' /> <label for="checkGlobal_ignore_pid">'.$LANG->getLL('importdata_ignorePidDifferencesGlobally',1).'</label><br/> <em>('.$LANG->getLL('importdata_ifYouSetThis',1).')</em> ' : '' ).'</td> </tr>'; $row[] = '<tr class="bgColor4"> <td><strong>'.$LANG->getLL('importdata_options',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'options', $GLOBALS['BACK_PATH'],'').'</td> <td> <input type="checkbox" name="tx_impexp[notShowDiff]" id="checkNotShowDiff" value="1"'.($inData['notShowDiff'] ? ' checked="checked"' : '').' /> <label for="checkNotShowDiff">'.$LANG->getLL('importdata_doNotShowDifferences',1).'</label><br/> <em>('.$LANG->getLL('importdata_greenValuesAreFrom',1).')</em> <br/><br/> '.($GLOBALS['BE_USER']->isAdmin() ? ' <input type="checkbox" name="tx_impexp[allowPHPScripts]" id="checkAllowPHPScripts" value="1"'.($inData['allowPHPScripts'] ? ' checked="checked"' : '').' /> <label for="checkAllowPHPScripts">'.$LANG->getLL('importdata_allowToWriteBanned',1).'</label><br/>' : ''). (!$inData['do_update'] && $GLOBALS['BE_USER']->isAdmin() ? ' <br/> <input type="checkbox" name="tx_impexp[force_all_UIDS]" id="checkForce_all_UIDS" value="1"'.($inData['force_all_UIDS'] ? ' checked="checked"' : '').' /> <label for="checkForce_all_UIDS"><span class="typo3-red">'.$LANG->getLL('importdata_force_all_UIDS',1).'</span></label><br/> <em>('.$LANG->getLL('importdata_force_all_UIDS_descr',1).')</em>' : ''). ' </td> </tr>'; $row[] = '<tr class="bgColor4"> <td><strong>'.$LANG->getLL('importdata_action',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'action', $GLOBALS['BACK_PATH'],'').'</td> <td>'. (!$inData['import_file'] ? '<input type="submit" value="'.$LANG->getLL('importdata_preview',1).'" />'.($inData['file'] ? ' - <input type="submit" value="'.($inData['do_update']?$LANG->getLL('importdata_update_299e',1):$LANG->getLL('importdata_import',1)).'" name="tx_impexp[import_file]" onclick="return confirm(\''.$LANG->getLL('importdata_areYouSure',1).'\');" />':''):'<input type="submit" name="tx_impexp[new_import]" value="'.$LANG->getLL('importdata_newImport',1).'" />').' <input type="hidden" name="tx_impexp[action]" value="import" /></td> </tr>'; $row[] = '<tr class="bgColor4"> <td><strong>'.$LANG->getLL('importdata_enableLogging',1).'</strong>'.t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'enableLogging', $GLOBALS['BACK_PATH'],'').'</td> <td> <input type="checkbox" name="tx_impexp[enableLogging]" id="checkEnableLogging" value="1"'.($inData['enableLogging'] ? ' checked="checked"' : '').' /> <label for="checkEnableLogging">'.$LANG->getLL('importdata_writeIndividualDbActions',1).'</label><br/> <em>('.$LANG->getLL('importdata_thisIsDisabledBy',1).')</em> </td> </tr>'; $menuItems[] = array( 'label' => $LANG->getLL('importdata_import',1), 'content' => ' <table border="0" cellpadding="1" cellspacing="1"> '.implode(' ',$row).' </table> ' ); // Upload file: $tempFolder = $this->userTempFolder(); if ($tempFolder) { $row = array(); $row[] = '<tr class="bgColor5"> <td colspan="2"><strong>'.$LANG->getLL('importdata_uploadFileFromLocal',1).'</strong></td> </tr>'; $row[] = '<tr class="bgColor4"> <td>'.$LANG->getLL('importdata_browse',1).t3lib_BEfunc::cshItem('xMOD_tx_impexp', 'upload', $GLOBALS['BACK_PATH'],'').'</td> <td> <input type="file" name="upload_1"'.$this->doc->formWidth(35).' size="40" /> <input type="hidden" name="file[upload][1][target]" value="'.htmlspecialchars($tempFolder).'" /> <input type="hidden" name="file[upload][1][data]" value="1" /><br /> <input type="submit" name="_upload" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.submit',1).'" /> <input type="checkbox" name="overwriteExistingFiles" id="checkOverwriteExistingFiles" value="1" checked="checked" /> <label for="checkOverwriteExistingFiles">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.php:overwriteExistingFiles',1).'</label> </td> </tr>'; if (t3lib_div::_POST('_upload')) { $row[] = '<tr class="bgColor4"> <td>'.$LANG->getLL('importdata_uploadStatus',1).'</td> <td>'.($this->fileProcessor->internalUploadMap[1] ? $LANG->getLL('importdata_success',1).' '.substr($this->fileProcessor->internalUploadMap[1],strlen(PATH_site)) : '<span class="typo3-red">'.$LANG->getLL('importdata_failureNoFileUploaded',1).'</span>').'</td> </tr>'; } $menuItems[] = array( 'label' => $LANG->getLL('importdata_upload'), 'content' => ' <table border="0" cellpadding="1" cellspacing="1"> '.implode(' ',$row).' </table> ' ); } // Perform import or preview depending: $overviewContent = ''; $extensionInstallationMessage = ''; $emURL = ''; $inFile = t3lib_div::getFileAbsFileName($inData['file']); if ($inFile && @is_file($inFile)) { $trow = array(); if ($import->loadFile($inFile,1)) { // Check extension dependencies: $extKeysToInstall = array(); if (is_array($import->dat['header']['extensionDependencies'])) { foreach($import->dat['header']['extensionDependencies'] as $extKey) { if (!t3lib_extMgm::isLoaded($extKey)) { $extKeysToInstall[] = $extKey; } } } if (count($extKeysToInstall)) { $passParams = t3lib_div::_POST('tx_impexp'); unset($passParams['import_mode']); unset($passParams['import_file']); $thisScriptUrl = t3lib_div::getIndpEnv('REQUEST_URI').'?M=xMOD_tximpexp&id='.$this->id.t3lib_div::implodeArrayForUrl('tx_impexp',$passParams); $emURL = $this->doc->backPath.'mod/tools/em/index.php?CMD[requestInstallExtensions]='.implode(',',$extKeysToInstall).'&returnUrl='.rawurlencode($thisScriptUrl); $extensionInstallationMessage = 'Before you can install this T3D file you need to install the extensions "'.implode('", "',$extKeysToInstall).'". Clicking Import will first take you to the Extension Manager so these dependencies can be resolved.'; } if ($inData['import_file']) { if (!count($extKeysToInstall)) { $import->importData($this->id); t3lib_BEfunc::getSetUpdateSignal('updatePageTree'); } else { header('Location: '.t3lib_div::locationHeaderUrl($emURL)); exit; } } $import->display_import_pid_record = $this->pageinfo; $overviewContent = $import->displayContentOverview(); } // Meta data output: $trow[] = '<tr class="bgColor5"> <td colspan="2"><strong>'.$LANG->getLL('importdata_metaData',1).'</strong></td> </tr>'; $opt = array('');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -