Public Member Functions | |
| init () | |
| Constructor function for class. | |
| main () | |
| Main function, rendering the main module content. | |
| printContent () | |
| Outputting the accumulated content to screen. | |
Public Attributes | |
| $folderNumber = 10 | |
| $doc | |
| $basicff | |
| $icon | |
| $shortPath | |
| $title | |
| $number | |
| $target | |
| $returnUrl | |
| $content | |
|
|
Constructor function for class.
Definition at line 101 of file file_newfolder.php. 00101 {
00102 global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
00103
00104 // Initialize GPvars:
00105 $this->number = t3lib_div::_GP('number');
00106 $this->target = t3lib_div::_GP('target');
00107 $this->returnUrl = t3lib_div::_GP('returnUrl');
00108
00109 // Init basic-file-functions object:
00110 $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
00111 $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
00112
00113 // Cleaning and checking target
00114 $this->target=$this->basicff->is_directory($this->target);
00115 $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
00116 if (!$this->target || !$key) {
00117 t3lib_BEfunc::typo3PrintError ('Parameter Error','Target was not a directory!','');
00118 exit;
00119 }
00120
00121 // Finding the icon
00122 switch($GLOBALS['FILEMOUNTS'][$key]['type']) {
00123 case 'user': $this->icon = 'gfx/i/_icon_ftp_user.gif'; break;
00124 case 'group': $this->icon = 'gfx/i/_icon_ftp_group.gif'; break;
00125 default: $this->icon = 'gfx/i/_icon_ftp.gif'; break;
00126 }
00127
00128 // Relative path to filemount, $key:
00129 $this->shortPath = substr($this->target,strlen($GLOBALS['FILEMOUNTS'][$key]['path']));
00130
00131 // Setting title:
00132 $this->title = $GLOBALS['FILEMOUNTS'][$key]['name'].': '.$this->shortPath;
00133
00134 // Setting template object
00135 $this->doc = t3lib_div::makeInstance('smallDoc');
00136 $this->doc->docType = 'xhtml_trans';
00137 $this->doc->backPath = $BACK_PATH;
00138 $this->doc->form='<form action="tce_file.php" method="post" name="editform">';
00139 $this->doc->JScode=$this->doc->wrapScriptTags('
00140 var path = "'.$this->target.'";
00141
00142 function reload(a) { //
00143 if (!changed || (changed && confirm('.$LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')).'))) {
00144 var params = "&target="+escape(path)+"&number="+a;
00145 document.location = "file_newfolder.php?"+params;
00146 }
00147 }
00148 function backToList() { //
00149 top.goToModule("file_list");
00150 }
00151
00152 var changed = 0;
00153 ');
00154 }
|
|
|
Main function, rendering the main module content.
Definition at line 161 of file file_newfolder.php. References $a, $LANG, and t3lib_BEfunc::cshItem(). 00161 {
00162 global $LANG;
00163
00164 // Make page header:
00165 $this->content='';
00166 $this->content.=$this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle'));
00167 $this->content.=$this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle'));
00168 $this->content.=$this->doc->spacer(5);
00169 $this->content.=$this->doc->section('',$this->doc->getFileheader($this->title,$this->shortPath,$this->icon));
00170 $this->content.=$this->doc->divider(5);
00171
00172
00173 // Making the selector box for the number of concurrent folder-creations
00174 $this->number = t3lib_div::intInRange($this->number,1,10);
00175 $code='
00176 <div id="c-select">
00177 <select name="number" onchange="reload(this.options[this.selectedIndex].value);">';
00178 for ($a=1;$a<=$this->folderNumber;$a++) {
00179 $code.='
00180 <option value="'.$a.'"'.($this->number==$a?' selected="selected"':'').'>'.$a.' '.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.folders',1).'</option>';
00181 }
00182 $code.='
00183 </select>
00184 </div>
00185 ';
00186
00187 // Making the number of new-folder boxes needed:
00188 $code.='
00189 <div id="c-createFolders">
00190 ';
00191 for ($a=0;$a<$this->number;$a++) {
00192 $code.='
00193 <input'.$this->doc->formWidth(20).' type="text" name="file[newfolder]['.$a.'][data]" onchange="changed=true;" />
00194 <input type="hidden" name="file[newfolder]['.$a.'][target]" value="'.htmlspecialchars($this->target).'" />
00195 ';
00196 }
00197 $code.='
00198 </div>
00199 ';
00200
00201 // Making submit button for folder creation:
00202 $code.='
00203 <div id="c-submitFolders">
00204 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.submit',1).'" />
00205 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
00206 <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
00207 </div>
00208 ';
00209
00210 // CSH:
00211 $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_newfolder', $GLOBALS['BACK_PATH'],'<br/>');
00212
00213 $this->content.= $this->doc->section('',$code);
00214
00215
00216
00217 // Add spacer:
00218 $this->content.= $this->doc->spacer(10);
00219
00220 // Switching form tags:
00221 $this->content.= $this->doc->sectionEnd();
00222 $this->content.= '</form><form action="tce_file.php" method="post" name="editform2">';
00223
00224 // Add form fields for creation of a new, blank text file:
00225 $code='
00226 <div id="c-newFile">
00227 <p>['.htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext']).']</p>
00228 <input'.$this->doc->formWidth(20).' type="text" name="file[newfile][0][data]" onchange="changed=true;" />
00229 <input type="hidden" name="file[newfile][0][target]" value="'.htmlspecialchars($this->target).'" />
00230 </div>
00231 ';
00232
00233 // Submit button for creation of a new file:
00234 $code.='
00235 <div id="c-submitFiles">
00236 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.newfile_submit',1).'" />
00237 <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
00238 <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
00239 </div>
00240 ';
00241
00242 // CSH:
00243 $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_newfile', $GLOBALS['BACK_PATH'],'<br/>');
00244
00245 // Add the HTML as a section:
00246 $this->content.= $this->doc->section($LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.newfile'),$code);
00247
00248 // Ending page
00249 $this->content.= $this->doc->endPage();
00250 }
|
|
|
Outputting the accumulated content to screen.
Definition at line 257 of file file_newfolder.php. 00257 {
00258
00259 echo $this->content;
00260 }
|
|
|
Definition at line 81 of file file_newfolder.php. |
|
|
Definition at line 92 of file file_newfolder.php. |
|
|
Definition at line 80 of file file_newfolder.php. |
|
|
Definition at line 77 of file file_newfolder.php. |
|
|
Definition at line 82 of file file_newfolder.php. |
|
|
Definition at line 87 of file file_newfolder.php. |
|
|
Definition at line 89 of file file_newfolder.php. |
|
|
Definition at line 83 of file file_newfolder.php. |
|
|
Definition at line 88 of file file_newfolder.php. |
|
|
Definition at line 84 of file file_newfolder.php. |
1.3.8-20040913