/** * Constructor function for class * * @return void */ function init() { global $LANG, $BACK_PATH, $TYPO3_CONF_VARS; // Initialize GPvars: $this->number = t3lib_div::_GP('number'); $this->target = t3lib_div::_GP('target'); $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')); // Init basic-file-functions object: $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $this->basicff->init($GLOBALS['FILEMOUNTS'], $TYPO3_CONF_VARS['BE']['fileExtensions']); // Init basic-charset-functions object: $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs'); // Cleaning and checking target $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet); $this->target = $this->basicff->is_directory($this->target); $key = $this->basicff->checkPathAgainstMounts($this->target . '/'); if (!$this->target || !$key) { $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE); $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE); throw new RuntimeException($title . ': ' . $message); } // Finding the icon switch ($GLOBALS['FILEMOUNTS'][$key]['type']) { case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break; case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break; default: $this->icon = 'gfx/i/_icon_ftp.gif'; break; } $this->icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, $this->icon, 'width="18" height="16"') . ' title="" alt="" />'; // Relative path to filemount, $key: $this->shortPath = substr($this->target, strlen($GLOBALS['FILEMOUNTS'][$key]['path'])); // Setting title: $this->title = $this->icon . htmlspecialchars($GLOBALS['FILEMOUNTS'][$key]['name']) . ': ' . $this->shortPath; // Setting template object $this->doc = t3lib_div::makeInstance('template'); $this->doc->setModuleTemplate('templates/file_newfolder.html'); $this->doc->backPath = $BACK_PATH; $this->doc->JScode = $this->doc->wrapScriptTags(' var path = "' . $this->target . '"; function reload(a) { // if (!changed || (changed && confirm(' . $LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . '))) { var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8')) . '"; window.location.href = "file_newfolder.php?"+params; } } function backToList() { // top.goToModule("file_list"); } var changed = 0; '); }
/** * Constructor function for class * * @return void */ function init() { //TODO remove global global $LANG, $BACK_PATH, $TYPO3_CONF_VARS; // Initialize GPvars: $this->target = t3lib_div::_GP('target'); $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')); // Init basic-file-functions object: $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $this->basicff->init($GLOBALS['FILEMOUNTS'], $TYPO3_CONF_VARS['BE']['fileExtensions']); // Cleaning and checking target if (file_exists($this->target)) { $this->target = $this->basicff->cleanDirectoryName($this->target); // Cleaning and checking target (file or dir) } else { $this->target = ''; } $key = $this->basicff->checkPathAgainstMounts($this->target . '/'); if (!$this->target || !$key) { $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE); $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE); throw new RuntimeException($title . ': ' . $message); } // Finding the icon switch ($GLOBALS['FILEMOUNTS'][$key]['type']) { case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break; case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break; default: $this->icon = 'gfx/i/_icon_ftp.gif'; break; } $this->icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, $this->icon, 'width="18" height="16"') . ' title="" alt="" />'; // Relative path to filemount, $key: $this->shortPath = substr($this->target, strlen($GLOBALS['FILEMOUNTS'][$key]['path'])); // Setting title: $this->title = $this->icon . htmlspecialchars($GLOBALS['FILEMOUNTS'][$key]['name']) . ': ' . $this->shortPath; // Setting template object $this->doc = t3lib_div::makeInstance('template'); $this->doc->setModuleTemplate('templates/file_rename.html'); $this->doc->backPath = $BACK_PATH; $this->doc->JScode = $this->doc->wrapScriptTags(' function backToList() { // top.goToModule("file_list"); } '); }
/** * Constructor for initializing the class * * @return void */ function init() { // Initialize GPvars: $this->number = t3lib_div::_GP('number'); $this->target = t3lib_div::_GP('target'); $this->returnUrl = t3lib_div::_GP('returnUrl'); $this->returnUrl = $this->returnUrl ? $this->returnUrl : t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'file_list.php?id=' . rawurlencode($this->target); // set the number of input fields if (empty($this->number)) { $this->number = $GLOBALS['BE_USER']->getTSConfigVal('options.defaultFileUploads'); } $this->number = t3lib_div::intInRange($this->number, 1, $this->uploadNumber); // Init basic-file-functions object: $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); $this->basicff->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']); // Init basic-charset-functions object: $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs'); // Cleaning and checking target $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet); $this->target = $this->basicff->is_directory($this->target); $key = $this->basicff->checkPathAgainstMounts($this->target . '/'); if (!$this->target || !$key) { t3lib_BEfunc::typo3PrintError($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), ''); exit; } // Finding the icon switch ($GLOBALS['FILEMOUNTS'][$key]['type']) { case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break; case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break; default: $this->icon = 'gfx/i/_icon_ftp.gif'; break; } $this->icon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $this->icon, 'width="18" height="16"') . ' title="" alt="" />'; // Relative path to filemount, $key: $this->shortPath = substr($this->target, strlen($GLOBALS['FILEMOUNTS'][$key]['path'])); // Setting title: $this->title = $this->icon . htmlspecialchars($GLOBALS['FILEMOUNTS'][$key]['name']) . ': ' . $this->shortPath; // Setting template object $this->doc = t3lib_div::makeInstance('template'); $this->doc->setModuleTemplate('templates/file_upload.html'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">'; if ($GLOBALS['BE_USER']->jsConfirmation(1)) { $confirm = ' && confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . ')'; } else { $confirm = ''; } $this->doc->JScode = $this->doc->wrapScriptTags(' var path = "' . $this->target . '"; function reload(a) { // if (!changed || (changed ' . $confirm . ')) { var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8')) . '"; window.location.href = "file_upload.php?"+params; } } function backToList() { // top.goToModule("file_list"); } var changed = 0; '); }