Index: typo3/sysext/impexp/ext_autoload.php =================================================================== --- typo3/sysext/impexp/ext_autoload.php (revision 0) +++ typo3/sysext/impexp/ext_autoload.php (revision 0) @@ -0,0 +1,10 @@ + $extensionPath . 'task/class.tx_impexp_task.php', +); +?> \ No newline at end of file Index: typo3/sysext/impexp/ext_emconf.php =================================================================== --- typo3/sysext/impexp/ext_emconf.php (revision 7339) +++ typo3/sysext/impexp/ext_emconf.php (working copy) @@ -3,7 +3,7 @@ ######################################################################## # Extension Manager/Repository config file for ext "impexp". # -# Auto generated 25-11-2009 22:01 +# Auto generated 13-04-2010 13:49 # # Manual updates: # Only the data in the array - everything else is removed by next @@ -34,9 +34,10 @@ 'CGLcompliance' => '', 'CGLcompliance_note' => '', 'version' => '0.3.0', - '_md5_values_when_last_written' => 'a:42:{s:19:"class.tx_impexp.php";s:4:"3441";s:29:"class.tx_impexp_clickmenu.php";s:4:"75f1";s:10:"export.gif";s:4:"3b59";s:14:"ext_tables.php";s:4:"5508";s:14:"ext_tables.sql";s:4:"c4c7";s:10:"import.gif";s:4:"374c";s:17:"locallang_csh.xml";s:4:"63eb";s:13:"app/clear.gif";s:4:"cc11";s:12:"app/conf.php";s:4:"6593";s:13:"app/index.php";s:4:"60dd";s:17:"app/locallang.xml";s:4:"a173";s:17:"app/template.html";s:4:"29f0";s:22:"cshimages/diffview.png";s:4:"ee3c";s:24:"cshimages/excludebox.png";s:4:"6ece";s:20:"cshimages/export.png";s:4:"e850";s:21:"cshimages/export1.png";s:4:"8e9a";s:21:"cshimages/export2.png";s:4:"ec12";s:20:"cshimages/extdep.png";s:4:"9349";s:24:"cshimages/fileformat.png";s:4:"eed0";s:21:"cshimages/htmlcss.png";s:4:"1f13";s:20:"cshimages/impexp.png";s:4:"eef2";s:25:"cshimages/impexp_misc.png";s:4:"f8c7";s:26:"cshimages/impexp_misc1.png";s:4:"80d3";s:26:"cshimages/impexp_misc2.png";s:4:"f530";s:26:"cshimages/impexp_misc3.png";s:4:"3c82";s:26:"cshimages/impexp_misc4.png";s:4:"2ea9";s:20:"cshimages/import.png";s:4:"35fc";s:31:"cshimages/import_selectfile.png";s:4:"7df9";s:22:"cshimages/metadata.png";s:4:"de32";s:25:"cshimages/pagetreecfg.png";s:4:"3ed8";s:20:"cshimages/phpext.png";s:4:"06c7";s:24:"cshimages/references.png";s:4:"ed7c";s:25:"cshimages/references1.png";s:4:"e817";s:25:"cshimages/references2.png";s:4:"960f";s:26:"cshimages/singlerecord.png";s:4:"885b";s:20:"cshimages/static.png";s:4:"db15";s:21:"cshimages/static1.png";s:4:"83ea";s:23:"cshimages/tablelist.png";s:4:"6b64";s:20:"cshimages/update.png";s:4:"e013";s:12:"doc/TODO.txt";s:4:"1967";s:37:"modfunc1/class.tx_impexp_modfunc1.php";s:4:"a85b";s:22:"modfunc1/locallang.xml";s:4:"3fe4";}', + '_md5_values_when_last_written' => 'a:44:{s:19:"class.tx_impexp.php";s:4:"3441";s:29:"class.tx_impexp_clickmenu.php";s:4:"75f1";s:10:"export.gif";s:4:"3b59";s:16:"ext_autoload.php";s:4:"e335";s:14:"ext_tables.php";s:4:"6707";s:14:"ext_tables.sql";s:4:"c4c7";s:10:"import.gif";s:4:"374c";s:17:"locallang_csh.xml";s:4:"ec50";s:13:"app/clear.gif";s:4:"cc11";s:12:"app/conf.php";s:4:"6593";s:13:"app/index.php";s:4:"60dd";s:17:"app/locallang.xml";s:4:"a173";s:17:"app/template.html";s:4:"29f0";s:22:"cshimages/diffview.png";s:4:"ee3c";s:24:"cshimages/excludebox.png";s:4:"6ece";s:20:"cshimages/export.png";s:4:"e850";s:21:"cshimages/export1.png";s:4:"8e9a";s:21:"cshimages/export2.png";s:4:"ec12";s:20:"cshimages/extdep.png";s:4:"9349";s:24:"cshimages/fileformat.png";s:4:"eed0";s:21:"cshimages/htmlcss.png";s:4:"1f13";s:20:"cshimages/impexp.png";s:4:"eef2";s:25:"cshimages/impexp_misc.png";s:4:"f8c7";s:26:"cshimages/impexp_misc1.png";s:4:"80d3";s:26:"cshimages/impexp_misc2.png";s:4:"f530";s:26:"cshimages/impexp_misc3.png";s:4:"3c82";s:26:"cshimages/impexp_misc4.png";s:4:"2ea9";s:20:"cshimages/import.png";s:4:"35fc";s:31:"cshimages/import_selectfile.png";s:4:"7df9";s:22:"cshimages/metadata.png";s:4:"de32";s:25:"cshimages/pagetreecfg.png";s:4:"3ed8";s:20:"cshimages/phpext.png";s:4:"06c7";s:24:"cshimages/references.png";s:4:"ed7c";s:25:"cshimages/references1.png";s:4:"e817";s:25:"cshimages/references2.png";s:4:"960f";s:26:"cshimages/singlerecord.png";s:4:"885b";s:20:"cshimages/static.png";s:4:"db15";s:21:"cshimages/static1.png";s:4:"83ea";s:23:"cshimages/tablelist.png";s:4:"6b64";s:20:"cshimages/update.png";s:4:"e013";s:12:"doc/TODO.txt";s:4:"1967";s:37:"modfunc1/class.tx_impexp_modfunc1.php";s:4:"a85b";s:22:"modfunc1/locallang.xml";s:4:"3fe4";s:29:"task/class.tx_impexp_task.php";s:4:"8421";}', 'constraints' => array( 'depends' => array( + 'taskcenter' => '1.0.0-0.0.0', 'php' => '5.1.0-0.0.0', 'typo3' => '4.3.0-0.0.0', ), Index: typo3/sysext/impexp/ext_tables.php =================================================================== --- typo3/sysext/impexp/ext_tables.php (revision 7339) +++ typo3/sysext/impexp/ext_tables.php (working copy) @@ -1,17 +1,20 @@ 'tx_impexp_clickmenu', 'path' => t3lib_extMgm::extPath($_EXTKEY).'class.tx_impexp_clickmenu.php' ); - t3lib_extMgm::insertModuleFunction( - 'user_task', - 'tx_impexp_modfunc1', - t3lib_extMgm::extPath($_EXTKEY).'modfunc1/class.tx_impexp_modfunc1.php', - 'LLL:EXT:impexp/app/locallang.xml:moduleFunction.tx_impexp_modfunc1' + + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['impexp']['tasks'] = array ( + 'title' => 'LLL:EXT:impexp/locallang_csh.xml:.alttitle', + 'description' => 'LLL:EXT:impexp/locallang_csh.xml:.description', + 'icon' => 'EXT:impexp/export.gif', + 'task' => 'tx_impexp_task', ); t3lib_extMgm::addLLrefForTCAdescr('xMOD_tx_impexp','EXT:impexp/locallang_csh.xml'); Index: typo3/sysext/impexp/locallang_csh.xml =================================================================== --- typo3/sysext/impexp/locallang_csh.xml (revision 7339) +++ typo3/sysext/impexp/locallang_csh.xml (working copy) @@ -170,6 +170,19 @@ + + + + + + + + + + + + + \ No newline at end of file Index: typo3/sysext/impexp/task/class.tx_impexp_task.php =================================================================== --- typo3/sysext/impexp/task/class.tx_impexp_task.php (revision 0) +++ typo3/sysext/impexp/task/class.tx_impexp_task.php (revision 0) @@ -0,0 +1,226 @@ + + * @author Georg Ringer + * @package TYPO3 + * @subpackage impexp + * + */ +class tx_impexp_task implements tx_taskcenter_Task { + /** + * Back-reference to the calling reports module + * + * @var tx_reports_Module $taskObject + */ + protected $taskObject; + + /** + * Constructor + */ + public function __construct(SC_mod_user_task_index $taskObject) { + $this->taskObject = $taskObject; + $GLOBALS['LANG']->includeLLFile('EXT:impexp/locallang_csh.xml'); + } + + /** + * This method renders the report + * + * @return string The status report as HTML + */ + public function getTask() { + return $this->main(); + } + + /** + * Render an optional additional information for the 1st view in taskcenter. + * Empty for this task + * + * @return string Overview as HTML + */ + public function getOverview() { + return ''; + } + + + + /** + * Main Task center module + * + * @return string HTML content. + */ + public function main() { + $content = ''; + $id = intval(t3lib_div::_GP('display')); + + // if a preset is found, it is rendered using an iframe + if($id > 0) { + $url = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id; + return $this->taskObject->urlInIframe($url, 1); + } else { + // header + $content .= $this->taskObject->description( + $GLOBALS['LANG']->getLL('.alttitle'), + $GLOBALS['LANG']->getLL('.description') + ); + + $thumbnails = $lines = array(); + + // Thumbnail folder and files: + $tempDir = $this->userTempFolder(); + if ($tempDir) { + $thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1); + } + + $clause = $GLOBALS['BE_USER']->getPagePermsClause(1); + $usernames = t3lib_BEfunc::getUserNames(); + + // Create preset links: + $presets = $this->getPresets(); + + // if any presets found + if (is_array($presets)) { + foreach($presets as $key => $presetCfg) { + $configuration = unserialize($presetCfg['preset_data']); + $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']]; + $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '['.$presetCfg['uid'].']'; + + if ($thumbnailFile && 1==2) { + // @todo: create icon or maybe completly remove it because where to display? + $src= '../' . $GLOBALS['BACK_PATH'] . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile); + $icon = $src; + } else { + $icon = 'EXT:impexp/export.gif'; + } + + $description = array(); + + // is public? + if ($presetCfg['public']) { + $description[] = $GLOBALS['LANG']->getLL('task.public') . ': ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes'); + } + + // owner + $description[] = $GLOBALS['LANG']->getLL('task.owner') . ': ' . (($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid']) ? $GLOBALS['LANG']->getLL('task.own') : '[' . htmlspecialchars($usernames[$presetCfg['user_uid']]['username']) . ']'); + + // page & path + if ($configuration['pagetree']['id']) { + $description[] = $GLOBALS['LANG']->getLL('task.page') . ': ' . $configuration['pagetree']['id']; + $description[] = $GLOBALS['LANG']->getLL('task.path') . ': ' . htmlspecialchars(t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'], $clause, 20)); + } else { + $description[] = $GLOBALS['LANG']->getLL('single-record'); + } + + // Meta information + if ($configuration['meta']['title'] || $configuration['meta']['description'] || $configuration['meta']['notes']) { + $metaInformation = ''; + if ($configuration['meta']['title']) { + $metaInformation .= '' . htmlspecialchars($configuration['meta']['title']) . '
'; + } + if ($configuration['meta']['description']) { + $metaInformation .= htmlspecialchars($configuration['meta']['description']); + } + if ($configuration['meta']['notes']) { + $metaInformation .= '

+ ' . $GLOBALS['LANG']->getLL('notes') . ': + ' . htmlspecialchars($configuration['meta']['notes']) . ''; + } + + $description[] = '
' . $metaInformation; + } + + // collect all preset information + $lines[$key] = array( + 'icon' => $icon, + 'title' => htmlspecialchars($title), + 'descriptionHtml' => implode('
', $description), + 'link' => 'index.php?M=tools_txtaskcenterM1&SET[function]=impexp.tasks&display=' . $presetCfg['uid'] + ); + + } + + // render preset list + $content .= $this->taskObject->renderListMenu($lines); + } else { + // no presets found + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('no-presets'), + '', + t3lib_FlashMessage::NOTICE + + ); + $content .= $flashMessage->render(); + } + } + + return $content; + } + + + /** + * Select presets for this user + * + * @return array Array of preset records + */ + function getPresets() { + $presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + '*', + 'tx_impexp_presets', + '(public > 0 OR user_uid=' . $GLOBALS['BE_USER']->user['uid'] . ')', + '', + 'item_uid DESC, title' + ); + + return $presets; + } + + /** + * Returns first temporary folder of the user account (from $FILEMOUNTS) + * + * @return string Absolute path to first "_temp_" folder of the current user, otherwise blank. + */ + function userTempFolder() { + foreach($GLOBALS['FILEMOUNTS'] as $filePathInfo) { + $tempFolder = $filePathInfo['path'] . '_temp_/'; + if (@is_dir($tempFolder)) { + return $tempFolder; + } + } + } + + +} + + +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']) { + include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/impexp/task/class.tx_impexp_task.php']); +} + +?> \ No newline at end of file