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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 require_once(PATH_t3lib.'class.t3lib_extobjbase.php');
00053 t3lib_extMgm::isLoaded('impexp',1);
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class tx_impexp_modfunc1 extends mod_user_task {
00064
00065
00066
00067
00068
00069
00070
00071 function overview_main() {
00072 global $LANG;
00073
00074 $presets = $this->getPresets();
00075 $opt = array();
00076 if (is_array($presets)) {
00077 foreach($presets as $presetCfg) {
00078 $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '['.$presetCfg['uid'].']';
00079 $opt[] = '
00080 <tr class="bgColor4">
00081 <td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display='.$presetCfg['uid'].'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($title,30)).'</a> </td>
00082 <td>'.($presetCfg['item_uid'] ? $presetCfg['item_uid'] : ' ').'</td>
00083 <td>'.($presetCfg['public'] ? '[Public]' : ' ').'</td>
00084 <td>'.($presetCfg['user_uid']===$GLOBALS['BE_USER']->user['uid'] ? '[Own]' : ' ').'</td>
00085 </tr>';
00086 }
00087 if(sizeof($opt)>0) {
00088 $presets = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">'.implode('',$opt).'</table>';
00089 $presets .= '<a href="index.php?SET[function]=tx_impexp"><em>'.$LANG->getLL('link_allRecs').'</em></a>';
00090 } else {
00091 $presets = '';
00092 }
00093
00094 $icon = '<img src="'.$this->backPath.t3lib_extMgm::extRelPath('impexp').'export.gif" width="18" height="16" class="absmiddle" alt="" />';
00095 $config= $this->mkMenuConfig($icon.$this->headLink('tx_impexp_modfunc1',1),'',$presets);
00096 }
00097
00098 return $config;
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108 function main() {
00109 if($id = t3lib_div::_GP('display')) {
00110 return $this->urlInIframe($this->backPath.t3lib_extMgm::extRelPath('impexp').'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]='.$id,1);
00111 } else {
00112
00113 $tempDir = $this->userTempFolder();
00114 if ($tempDir) {
00115 $thumbnails = t3lib_div::getFilesInDir($tempDir,'png,gif,jpg',1);
00116 }
00117
00118 $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00119 $usernames = t3lib_BEfunc::getUserNames();
00120
00121
00122 $presets = $this->getPresets();
00123 $opt = array();
00124 $opt[] = '
00125 <tr class="bgColor5 tableheader">
00126 <td>Icon:</td>
00127 <td>Preset Title:</td>
00128 <td>Public</td>
00129 <td>Owner:</td>
00130 <td>Page:</td>
00131 <td>Path:</td>
00132 <td>Meta data:</td>
00133 </tr>';
00134 if (is_array($presets)) {
00135 foreach($presets as $presetCfg) {
00136 $configuration = unserialize($presetCfg['preset_data']);
00137 $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
00138 $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '['.$presetCfg['uid'].']';
00139
00140 $opt[] = '
00141 <tr class="bgColor4">
00142 <td>'.($thumbnailFile ? '<img src="'.$this->backPath.'../'.substr($tempDir,strlen(PATH_site)).basename($thumbnailFile).'" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br/>' : ' ').'</td>
00143 <td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display='.$presetCfg['uid'].'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($title,30)).'</a> </td>
00144 <td>'.($presetCfg['public'] ? 'Yes' : ' ').'</td>
00145 <td>'.($presetCfg['user_uid']===$GLOBALS['BE_USER']->user['uid'] ? 'Own' : '['.$usernames[$presetCfg['user_uid']]['username'].']').'</td>
00146 <td>'.($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : ' ').'</td>
00147 <td>'.htmlspecialchars($configuration['pagetree']['id'] ? t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'],$clause,20) : '[Single Records]').'</td>
00148 <td>
00149 <b>'.htmlspecialchars($configuration['meta']['title']).'</b><br/>'.
00150 htmlspecialchars($configuration['meta']['description']).
00151 ($configuration['meta']['notes'] ? '<br/><br/><b>Notes:</b> <em>'.htmlspecialchars($configuration['meta']['notes']).'</em>' : '').
00152 '
00153 </td>
00154 </tr>';
00155 }
00156 $content = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">'.implode('',$opt).'</table>';
00157 }
00158 }
00159
00160
00161 $theOutput.= $this->pObj->doc->spacer(5);
00162 $theOutput.= $this->pObj->doc->section('Export presets',$content,0,1);
00163
00164 return $theOutput;
00165 }
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191 function getPresets() {
00192 $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
00193 '*',
00194 'tx_impexp_presets',
00195 '(public>0 || user_uid='.intval($GLOBALS['BE_USER']->user['uid']).')',
00196 '',
00197 'item_uid DESC, title'
00198 );
00199
00200 return $presets;
00201 }
00202
00203
00204
00205
00206
00207
00208 function userTempFolder() {
00209 global $FILEMOUNTS;
00210
00211 foreach($FILEMOUNTS as $filePathInfo) {
00212 $tempFolder = $filePathInfo['path'].'_temp_/';
00213 if (@is_dir($tempFolder)) {
00214 return $tempFolder;
00215 }
00216 }
00217 }
00218 }
00219
00220 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/modfunc1/class.tx_impexp_modfunc1.php']) {
00221 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/modfunc1/class.tx_impexp_modfunc1.php']);
00222 }
00223 ?>