Public Member Functions | |
init () | |
Constructor function for class. | |
main () | |
Main function, rendering the content of the rename form. | |
printContent () | |
Outputting the accumulated content to screen. | |
Public Attributes | |
$doc | |
$basicff | |
$icon | |
$shortPath | |
$title | |
$target | |
$returnUrl | |
$content |
|
Constructor function for class.
Definition at line 96 of file file_rename.php. 00096 { 00097 global $LANG,$BACK_PATH,$TYPO3_CONF_VARS; 00098 00099 // Initialize GPvars: 00100 $this->target = t3lib_div::_GP('target'); 00101 $this->returnUrl = t3lib_div::_GP('returnUrl'); 00102 00103 // Init basic-file-functions object: 00104 $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions'); 00105 $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']); 00106 00107 // Cleaning and checking target 00108 if (@file_exists($this->target)) { 00109 $this->target=$this->basicff->cleanDirectoryName($this->target); // Cleaning and checking target (file or dir) 00110 } else { 00111 $this->target=''; 00112 } 00113 $key=$this->basicff->checkPathAgainstMounts($this->target.'/'); 00114 if (!$this->target || !$key) { 00115 t3lib_BEfunc::typo3PrintError ('Parameter Error','Target was not a directory!',''); 00116 exit; 00117 } 00118 00119 // Finding the icon 00120 switch($GLOBALS['FILEMOUNTS'][$key]['type']) { 00121 case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break; 00122 case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break; 00123 default: $this->icon = 'gfx/i/_icon_ftp.gif'; break; 00124 } 00125 00126 // Relative path to filemount, $key: 00127 $this->shortPath = substr($this->target,strlen($GLOBALS['FILEMOUNTS'][$key]['path'])); 00128 00129 // Setting title: 00130 $this->title = $GLOBALS['FILEMOUNTS'][$key]['name'].': '.$this->shortPath; 00131 00132 // Setting template object 00133 $this->doc = t3lib_div::makeInstance('smallDoc'); 00134 $this->doc->docType = 'xhtml_trans'; 00135 $this->doc->backPath = $BACK_PATH; 00136 $this->doc->form='<form action="tce_file.php" method="post" name="editform">'; 00137 $this->doc->JScode=$this->doc->wrapScriptTags(' 00138 function backToList() { // 00139 top.goToModule("file_list"); 00140 } 00141 '); 00142 }
|
|
Main function, rendering the content of the rename form.
Definition at line 149 of file file_rename.php. References t3lib_BEfunc::cshItem(). 00149 { 00150 global $LANG; 00151 00152 // Make page header: 00153 $this->content=''; 00154 $this->content.=$this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.pagetitle')); 00155 $this->content.=$this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.pagetitle')); 00156 $this->content.=$this->doc->spacer(5); 00157 $this->content.=$this->doc->section('',$this->doc->getFileheader($this->title,$this->shortPath,$this->icon)); 00158 $this->content.=$this->doc->divider(5); 00159 00160 00161 // Making the formfields for renaming: 00162 $code=' 00163 00164 <div id="c-rename"> 00165 <input type="text" name="file[rename][0][data]" value="'.htmlspecialchars(basename($this->shortPath)).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /> 00166 <input type="hidden" name="file[rename][0][target]" value="'.htmlspecialchars($this->target).'" /> 00167 </div> 00168 '; 00169 00170 // Making submit button: 00171 $code.=' 00172 <div id="c-submit"> 00173 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.submit',1).'" /> 00174 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" /> 00175 <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" /> 00176 </div> 00177 '; 00178 00179 // CSH: 00180 $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH'],'<br/>'); 00181 00182 // Add the HTML as a section: 00183 $this->content.= $this->doc->section('',$code); 00184 00185 // Ending page 00186 $this->content.= $this->doc->endPage(); 00187 }
|
|
Outputting the accumulated content to screen.
Definition at line 194 of file file_rename.php. 00194 { 00195 00196 echo $this->content; 00197 }
|
|
Definition at line 78 of file file_rename.php. |
|
Definition at line 88 of file file_rename.php. |
|
Definition at line 77 of file file_rename.php. |
|
Definition at line 79 of file file_rename.php. |
|
Definition at line 85 of file file_rename.php. |
|
Definition at line 80 of file file_rename.php. |
|
Definition at line 84 of file file_rename.php. |
|
Definition at line 81 of file file_rename.php. |