File: Upload of files * * @author Kasper Skaarhoj * @package TYPO3 * @subpackage core * */ $BACK_PATH=""; require ("init.php"); require ("template.php"); include ("sysext/lang/locallang_misc.php"); require_once (PATH_t3lib."class.t3lib_basicfilefunc.php"); // *************************** // Script Classes // *************************** class SC_file_upload { var $content; var $number; var $uploadNumber=10; var $basicff; var $shortPath; var $title; var $icon; var $target; var $doc; function init() { global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS; $this->number = t3lib_div::GPvar("number"); $this->target = t3lib_div::GPvar("target"); $this->basicff = t3lib_div::makeInstance("t3lib_basicFileFunctions"); $this->basicff->init($GLOBALS["FILEMOUNTS"],$TYPO3_CONF_VARS["BE"]["fileExtensions"]); $this->target=$this->basicff->is_directory($this->target); // Cleaning and checking target $key=$this->basicff->checkPathAgainstMounts($this->target."/"); if (!$this->target || !$key) { t3lib_BEfunc::typo3PrintError ("Parameter Error","Target was not a directory!",""); 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->shortPath = substr($this->target,strlen($GLOBALS["FILEMOUNTS"][$key]["path"])); $this->title = $GLOBALS["FILEMOUNTS"][$key]["name"].": ".$this->shortPath; // *************************** // Setting template object // *************************** $this->doc = t3lib_div::makeInstance("smallDoc"); $this->doc->backPath = $BACK_PATH; $this->doc->JScode=' '; $this->doc->form='
'; } function main() { global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS; $this->content=""; $this->content.=$this->doc->startPage($LANG->sL("LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle")); $this->content.=$this->doc->header($LANG->sL("LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle")); $this->content.=$this->doc->spacer(5); $this->content.=$this->doc->section('',$this->doc->getFileheader($this->title,$this->shortPath,$this->icon)); $this->content.=$this->doc->divider(5); // making the selector box $this->number = t3lib_div::intInRange($this->number,1,10); $code='

'; $code.=' '.$LANG->getLL("overwriteExistingFiles")."
"; for ($a=0;$a<$this->number;$a++) { $code.='formWidth(35).' onClick="changed=1;">
'; } $code.='
  '; $this->content.= $this->doc->section("",$code); } function printContent() { global $SOBE; $this->content.= $this->doc->spacer(10); $this->content.= $this->doc->middle(); $this->content.= $this->doc->endPage(); echo $this->content; } // *************************** // OTHER FUNCTIONS: // *************************** } // Include extension? if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/file_upload.php"]) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/file_upload.php"]); } // Make instance: $SOBE = t3lib_div::makeInstance("SC_file_upload"); $SOBE->init(); $SOBE->main(); $SOBE->printContent(); ?>