maj version dans config.xml
[mtweb] / mw / libs / tiny_mce / plugins / tinybrowser / edit.php
1 <?php\r
2 require_once('config_tinybrowser.php');\r
3 // Set language\r
4 if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))\r
5         {\r
6         require_once('langs/'.$tinybrowser['language'].'.php'); \r
7         }\r
8 else\r
9         {\r
10         require_once('langs/en.php'); // Falls back to English\r
11         }\r
12 require_once('fns_tinybrowser.php');\r
13 \r
14 // Check session, if it exists\r
15 if(session_id() != '')\r
16         {\r
17         if(!isset($_SESSION[$tinybrowser['sessioncheck']]))\r
18                 {\r
19                 echo TB_DENIED;\r
20                 exit;\r
21                 }\r
22         }\r
23         \r
24 if(!$tinybrowser['allowedit'] && !$tinybrowser['allowdelete'])\r
25         {\r
26         echo TB_EDDENIED;\r
27         exit;\r
28         }\r
29 \r
30 // Assign file operation variables\r
31 $validtypes = array('image','media','file');\r
32 $typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');\r
33 $foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));\r
34 $destfolder = (isset($_POST['destination']) ? $tinybrowser['path'][$typenow].urldecode($_POST['destination']) : '');\r
35 $destfoldernow = (isset($_POST['destination']) ? urldecode($_POST['destination']) : $foldernow);\r
36 \r
37 // Assign edit and thumbnail path\r
38 $editpath = $tinybrowser['path'][$typenow].$foldernow;\r
39 $thumbpath = $tinybrowser[$tinybrowser['thumbsrc']][$typenow].$foldernow;\r
40 \r
41 // Assign browsing options\r
42 $sortbynow = (isset($_REQUEST['sortby']) ? $_REQUEST['sortby'] : $tinybrowser['order']['by']);\r
43 $sorttypenow = (isset($_REQUEST['sorttype']) ? $_REQUEST['sorttype'] : $tinybrowser['order']['type']);\r
44 $sorttypeflip = ($sorttypenow == 'asc' ? 'desc' : 'asc');  \r
45 $viewtypenow = 'detail';\r
46 $findnow = (isset($_REQUEST['find']) && !empty($_REQUEST['find']) ? $_REQUEST['find'] : false);\r
47 $actionnow = (isset($_REQUEST['action']) ? $_REQUEST['action'] : $tinybrowser['defaultaction'] );\r
48 $showpagenow = (isset($_REQUEST['showpage']) ? $_REQUEST['showpage'] : 0);\r
49 \r
50 // Assign url pass variables\r
51 $passfolder = '&folder='.urlencode($foldernow);\r
52 $passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');\r
53 $passaction = '&action='.$actionnow;\r
54 $passsortby = '&sortby='.$sortbynow.'&sorttype='.$sorttypenow;\r
55 \r
56 // Assign sort parameters for column header links\r
57 $sortbyget = array();\r
58 $sortbyget['name'] = '&sortby=name';\r
59 $sortbyget['size'] = '&sortby=size'; \r
60 $sortbyget['type'] = '&sortby=type'; \r
61 $sortbyget['modified'] = '&sortby=modified';\r
62 $sortbyget['dimensions'] = '&sortby=dimensions'; \r
63 $sortbyget[$sortbynow] .= '&sorttype='.$sorttypeflip;\r
64 \r
65 // Assign css style for current sort type column\r
66 $thclass = array();\r
67 $thclass['name'] = '';\r
68 $thclass['size'] = ''; \r
69 $thclass['type'] = ''; \r
70 $thclass['modified'] = '';\r
71 $thclass['dimensions'] = ''; \r
72 $thclass[$sortbynow] = ' class="'.$sorttypenow.'"';\r
73 \r
74 // Initalise alert array\r
75 $notify = array(\r
76         'type' => array(),\r
77         'message' => array()\r
78 );\r
79 $deleteqty = 0;\r
80 $renameqty = 0;\r
81 $resizeqty = 0;\r
82 $rotateqty = 0;\r
83 $moveqty = 0;\r
84 $errorqty = 0;\r
85         \r
86 // Set when rotating images to force thumbnail refresh\r
87 $imagerefresh ='';\r
88 \r
89 // Delete any checked files\r
90 if(isset($_POST['deletefile']))\r
91         {\r
92         foreach($_POST['deletefile'] as $delthis => $val)\r
93                 {\r
94                 $delthisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$delthis];\r
95                 if (file_exists($delthisfile) && unlink($delthisfile)) $deleteqty++; else $errorqty++;\r
96                 if($typenow=='image')\r
97                         {\r
98                         $delthisthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$delthis];\r
99                         if (file_exists($delthisthumb)) unlink($delthisthumb);\r
100                         }\r
101                 }\r
102         }\r
103         \r
104 // Rename any files with changed name\r
105 if(isset($_POST['renamefile']))\r
106         {\r
107         foreach($_POST['renamefile'] as $namethis => $newname)\r
108                 {\r
109                 if($_POST['actionfile'][$namethis] != $newname.$_POST['renameext'][$namethis])\r
110                         {\r
111                         $namethisfilefrom = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$namethis];\r
112                         $namethisfileto = $tinybrowser['docroot'].$editpath.clean_filename($newname.$_POST['renameext'][$namethis]);\r
113                         if (file_exists($namethisfilefrom) && rename($namethisfilefrom,$namethisfileto)) $renameqty++; else $errorqty++;\r
114                         if($typenow=='image')\r
115                            {\r
116                                 $namethisthumbfrom = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$namethis];\r
117                                 $namethisthumbto = $tinybrowser['docroot'].$editpath.'_thumbs/_'.clean_filename($newname.$_POST['renameext'][$namethis]);\r
118                                 if (file_exists($namethisthumbfrom)) rename($namethisthumbfrom,$namethisthumbto);\r
119                            }\r
120                         }\r
121                 }\r
122         }\r
123         \r
124 // Move any checked files\r
125 if(isset($_POST['movefile']))\r
126         {\r
127         foreach($_POST['movefile'] as $movethis => $val)\r
128                 {\r
129                 $movethisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$movethis];\r
130                 $movefiledest = $tinybrowser['docroot'].$destfolder.$_POST['actionfile'][$movethis];\r
131                 if (!file_exists($movefiledest) && file_exists($movethisfile) && copy($movethisfile,$movefiledest))\r
132          {\r
133          $moveqty++;\r
134          unlink($movethisfile);\r
135          if($typenow=='image')\r
136                            {\r
137                            $movethisthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$movethis];\r
138                            $movethumbdest = $tinybrowser['docroot'].$destfolder.'_thumbs/_'.$_POST['actionfile'][$movethis];\r
139                            if (file_exists($movethisthumb) && copy($movethisthumb,$movethumbdest)) unlink($movethisthumb);\r
140                            }\r
141          }\r
142       else $errorqty++;\r
143                 }\r
144         }\r
145         \r
146 // Resize any files with new size\r
147 if(isset($_POST['resizefile']))\r
148         {\r
149         foreach($_POST['resizefile'] as $sizethis => $newsize)\r
150                 {\r
151                 $newsize = intval($newsize);\r
152                 if($newsize)\r
153                    {\r
154                         // detect silly sizes\r
155                         if($newsize > $tinybrowser['thumbsize'])\r
156                                 {\r
157                                 // do image resize\r
158                                 $targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$sizethis];\r
159                                 if (file_exists($targetimg))\r
160                                    {\r
161                                         $mime = getimagesize($targetimg);\r
162                                         if($_POST['resizetype'][$sizethis]=='width')\r
163                                            {\r
164                                                 $rw = $newsize;\r
165                                                 $rh = $mime[1];\r
166                                                 }\r
167                                         else\r
168                                            {\r
169                                                 $rw = $mime[0];\r
170                                                 $rh = $newsize;\r
171                                                 }\r
172                                         $im = convert_image($targetimg,$mime['mime']);\r
173                                         resizeimage($im,$rw,$rh,$targetimg,$tinybrowser['imagequality'],$mime['mime']);\r
174                                         imagedestroy($im);\r
175                                         $resizeqty++;\r
176                                    }\r
177                                 else $errorqty++;\r
178                                 }\r
179          else $errorqty++;\r
180                         }\r
181                 }\r
182         }\r
183 \r
184 // Rotate any selected files\r
185 if(isset($_POST['rotatefile']))\r
186         {\r
187         $imagerefresh = '?refresh='.uniqid('');\r
188         foreach($_POST['rotatefile'] as $rotatethis => $direction)\r
189                 {\r
190                 if($direction != 'none')\r
191                         {\r
192                         $targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$rotatethis];\r
193                         if (file_exists($targetimg))\r
194                                 {\r
195                                 // rotate image\r
196                                 if($direction == 'clock') $degree=270; else $degree=90;\r
197                                 $mime = getimagesize($targetimg);\r
198                                 $im = convert_image($targetimg,$mime['mime']);\r
199                                 \r
200                                 // additional processing for png / gif transparencies (credit to Dirk Bohl)\r
201                                 if($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')\r
202                                         {\r
203                                         imagealphablending($newim, false);\r
204                                         imagesavealpha($newim, true);\r
205                                         }\r
206                                 elseif($mime['mime'] == 'image/gif')\r
207                                         {\r
208                                         $originaltransparentcolor = imagecolortransparent( $im );\r
209                                         if($originaltransparentcolor >= 0 && $originaltransparentcolor < imagecolorstotal( $im ))\r
210                                                 {\r
211                                                 $transparentcolor = imagecolorsforindex( $im, $originaltransparentcolor );\r
212                                                 $newtransparentcolor = imagecolorallocate($newim,$transparentcolor['red'],$transparentcolor['green'],$transparentcolor['blue']);\r
213                                                 imagefill( $newim, 0, 0, $newtransparentcolor );\r
214                                                 imagecolortransparent( $newim, $newtransparentcolor );\r
215                                                 }\r
216                                         }\r
217                                 $newim = imagerotate($im, $degree, 0);\r
218                                 imagedestroy($im);\r
219                                 \r
220             if($mime['mime'] == 'image/pjpeg' || $mime['mime'] == 'image/jpeg')\r
221                 imagejpeg ($newim,$targetimg,$tinybrowser['imagequality']);\r
222             elseif($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')\r
223                imagepng ($newim,$targetimg,substr($tinybrowser['imagequality'],0,1));\r
224             elseif($mime['mime'] == 'image/gif')\r
225                imagegif ($newim,$targetimg);\r
226                                 imagedestroy($newim);\r
227                                 $rotateqty++;\r
228 \r
229                                 // delete and recreate thumbnail image\r
230                                 $targetthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$rotatethis];\r
231                                 if (file_exists($targetthumb)) unlink($targetthumb);\r
232                                 $mime = getimagesize($targetimg);\r
233                                 $im = convert_image($targetimg,$mime['mime']);\r
234                                 resizeimage($im,$tinybrowser['thumbsize'],$tinybrowser['thumbsize'],$targetthumb,$tinybrowser['thumbquality'],$mime['mime']);\r
235                                 imagedestroy($im);\r
236                                 }\r
237                         else $errorqty++;\r
238                         }\r
239                 }\r
240         }\r
241 \r
242 // Read directory contents and populate $file array\r
243 $dh = opendir($tinybrowser['docroot'].$editpath);\r
244 $file = array();\r
245 while (($filename = readdir($dh)) !== false)\r
246         {\r
247         // get file extension\r
248         $nameparts = explode('.',$filename);\r
249         $ext = end($nameparts);\r
250 \r
251         // filter directories and prohibited file types\r
252         if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$editpath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext))))\r
253                 {\r
254                 // search file name if search term entered\r
255                 if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));\r
256 \r
257                 // assign file details to array, for all files or those that match search\r
258                 if(!$findnow || ($findnow && $exists !== false))\r
259                         {\r
260                         $file['name'][] = $filename;\r
261                         $file['sortname'][] = strtolower($filename);\r
262                         $file['modified'][] = filemtime($tinybrowser['docroot'].$editpath.$filename);\r
263                         $file['size'][] = filesize($tinybrowser['docroot'].$editpath.$filename);\r
264 \r
265                         // image specific info or general\r
266                         if($typenow=='image' && $imginfo = getimagesize($tinybrowser['docroot'].$editpath.$filename))\r
267                                 {\r
268                                 $file['width'][] = $imginfo[0];\r
269                                 $file['height'][] = $imginfo[1];\r
270                                 $file['dimensions'][] = $imginfo[0] + $imginfo[1];\r
271                                 $file['type'][] = $imginfo['mime'];\r
272                                 }\r
273                         else\r
274                                 {\r
275                                 $file['width'][] = 'N/A';\r
276                                 $file['height'][] = 'N/A';\r
277                                 $file['dimensions'][] = 'N/A';\r
278                                 $file['type'][] = returnMIMEType($filename);\r
279                                 }\r
280                         }\r
281                 }\r
282         }\r
283 closedir($dh);\r
284 \r
285 // Assign directory structure to array\r
286 $editdirs=array();\r
287 dirtree($editdirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);\r
288 \r
289 // generate alert if files deleted\r
290 if($deleteqty>0)\r
291    {\r
292         $notify['type'][]='success';\r
293         $notify['message'][]=sprintf(TB_MSGDELETE, $deleteqty);\r
294         }\r
295 // generate alert if files renamed\r
296 elseif($renameqty>0)\r
297    {\r
298         $notify['type'][]='success';\r
299         $notify['message'][]=sprintf(TB_MSGRENAME, $renameqty);\r
300         }\r
301 // generate alert if files renamed\r
302 elseif($moveqty>0)\r
303    {\r
304         $notify['type'][]='success';\r
305         $notify['message'][]=sprintf(TB_MSGMOVE, $moveqty);\r
306         }\r
307 // generate alert if images resized\r
308 elseif($resizeqty>0)\r
309    {\r
310         $notify['type'][]='success';\r
311         $notify['message'][]=sprintf(TB_MSGRESIZE, $resizeqty);\r
312         }\r
313 // generate alert if images rotated\r
314 elseif($rotateqty>0)\r
315    {\r
316         $notify['type'][]='success';\r
317         $notify['message'][]=sprintf(TB_MSGROTATE, $rotateqty);\r
318         }\r
319         \r
320 // generate alert if file errors encountered\r
321 if($errorqty>0)\r
322    {\r
323         $notify['type'][]='failure';\r
324         $notify['message'][]=sprintf(TB_MSGEDITERR, $errorqty);\r
325         }\r
326 \r
327 // determine sort order\r
328 $sortorder = ($sorttypenow == 'asc' ? SORT_ASC : SORT_DESC);\r
329 $num_of_files = (isset($file['name']) ? count($file['name']) : 0);\r
330 \r
331 if($num_of_files>0)\r
332         {\r
333         // sort files by selected order\r
334         sortfileorder($sortbynow,$sortorder,$file);\r
335         }\r
336 \r
337 // determine pagination\r
338 if($tinybrowser['pagination']>0)\r
339         {\r
340         $showpagestart = ($showpagenow ? ($_REQUEST['showpage']*$tinybrowser['pagination'])-$tinybrowser['pagination'] : 0);\r
341         $showpageend = $showpagestart+$tinybrowser['pagination'];\r
342         if($showpageend>$num_of_files) $showpageend = $num_of_files;\r
343         }\r
344 else\r
345         {\r
346         $showpagestart = 0;\r
347         $showpageend = $num_of_files;\r
348         }\r
349 ?>\r
350 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
351 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
352 <head>\r
353 <title>TinyBrowser :: <?php echo TB_EDIT; ?></title>\r
354 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
355 <meta http-equiv="Pragma" content="no-cache" />\r
356 <?php\r
357 if(empty($passfeid) && $tinybrowser['integration']=='tinymce')\r
358         {\r
359         ?><link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php \r
360         }\r
361 else\r
362         {\r
363         ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php \r
364         }\r
365 ?>\r
366 <link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />\r
367 <script language="javascript" type="text/javascript" src="js/tinybrowser.js.php"></script>\r
368 </head>\r
369 <body onload="rowHighlight();">\r
370 <?php\r
371 if(count($notify['type'])>0) alert($notify);\r
372 form_open('foldertab',false,'edit.php','?type='.$typenow.$passfeid);\r
373 ?>\r
374 <div class="tabs">\r
375 <ul>\r
376 <li id="browse_tab"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_BROWSE; ?></a></span></li>\r
377 <?php\r
378 if($tinybrowser['allowupload']) \r
379         {\r
380         ?><li id="upload_tab"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_UPLOAD; ?></a></span></li>\r
381         <?php \r
382         } ?>\r
383 <li id="edit_tab" class="current"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_EDIT; ?></a></span></li>\r
384 <?php\r
385 if($tinybrowser['allowfolders'])\r
386         {\r
387         ?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php\r
388         }\r
389 // Display folder select, if multiple exist\r
390 if(count($editdirs)>1)\r
391         {\r
392         ?><li id="folder_tab" class="right"><span><?php\r
393         form_select($editdirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);\r
394         form_hidden_input('sortby',$sortbynow);\r
395    form_hidden_input('sorttype',$sorttypenow);\r
396    form_hidden_input('showpage',$showpagenow);\r
397         form_hidden_input('action',$actionnow);\r
398         ?></span></li><?php\r
399         }\r
400 ?>\r
401 </ul>\r
402 </div>\r
403 </form>\r
404 <div class="panel_wrapper">\r
405 <div id="general_panel" class="panel currentmod">\r
406 <fieldset>\r
407 <legend><?php echo TB_EDITFILES; ?></legend>\r
408 <?php\r
409 form_open('edit','custom','edit.php','?type='.$typenow.$passfolder.$passfeid);\r
410 ?>\r
411 <div class="pushleft">\r
412 <?php\r
413 \r
414 // Assign edit actions based on file type and permissions\r
415 $select = array();\r
416 if($tinybrowser['allowdelete']) $select[] = array('delete',TB_DELETE);\r
417 if($tinybrowser['allowedit']) $select[] = array('rename',TB_RENAME);\r
418 if($tinybrowser['allowfolders']) $select[] = array('move',TB_MOVE);\r
419 if($typenow=='image' && $tinybrowser['allowedit'])\r
420         {\r
421         $select[] = array('resize',TB_RESIZE);\r
422         $select[] = array('rotate',TB_ROTATE);\r
423         }\r
424 form_select($select,'action',TB_ACTION,$actionnow,true);\r
425 \r
426 // Show page select if pagination is set\r
427 if($tinybrowser['pagination']>0)\r
428         {\r
429         $pagelimit = ceil($num_of_files/$tinybrowser['pagination'])+1;\r
430         $page = array();\r
431         for($i=1;$i<$pagelimit;$i++)\r
432                 {\r
433                 $page[] = array($i,TB_PAGE.' '.$i);\r
434                 }\r
435         if($i>2) form_select($page,'showpage',SHOW,$showpagenow,true);\r
436         }\r
437 ?></div><div class="pushright"><?php\r
438 \r
439 form_hidden_input('sortby',$sortbynow);\r
440 form_hidden_input('sorttype',$sorttypenow);\r
441 form_text_input('find',false,$findnow,25,50);\r
442 form_submit_button('search',TB_SEARCH,'');\r
443 ?></div><?php\r
444 \r
445 form_open('actionform','custom','edit.php','?type='.$typenow.$passfolder.$passfeid);\r
446 \r
447 if($actionnow=='move')\r
448    { ?><div class="pushleft"><?php\r
449    form_select($editdirs,'destination',TB_FOLDERDEST,urlencode($destfoldernow),false);\r
450    ?></div><?php\r
451    } \r
452 \r
453 if($typenow=='image')\r
454         {\r
455         $selectresize = array(\r
456                 array('width',TB_WIDTH),\r
457                 array('height',TB_HEIGHT)\r
458                 );\r
459         }\r
460 \r
461 switch($actionnow) \r
462         {\r
463         case 'delete':\r
464                 $actionhead = TB_DELETE;\r
465                 break;\r
466         case 'rename':\r
467                 $actionhead = TB_RENAME;\r
468                 break;\r
469         case 'resize':\r
470                 $actionhead = TB_RESIZE;\r
471                 break;\r
472         case 'rotate':\r
473                 $actionhead = TB_ROTATE;\r
474                 break;\r
475         case 'move':\r
476                 $actionhead = TB_MOVE;\r
477                 break;\r
478         default:\r
479                 // do nothing\r
480         }\r
481 ?><div class="tabularwrapper"><table class="browse"><tr>\r
482 <th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['name']; ?>"<?php echo $thclass['name']; ?>><?php echo TB_FILENAME; ?></a></th>\r
483 <th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['size']; ?>"<?php echo $thclass['size']; ?>><?php echo TB_SIZE; ?></a></th>\r
484 <th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['type']; ?>"<?php echo $thclass['type']; ?>><?php echo TB_TYPE; ?></th>\r
485 <th class="nohvr"><?php echo $actionhead; ?></th></tr>\r
486 <?php\r
487 \r
488 for($i=$showpagestart;$i<$showpageend;$i++)\r
489         {\r
490         $alt = (IsOdd($i) ? 'r1' : 'r0');\r
491         echo '<tr class="'.$alt.'">';\r
492         if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="return false;" title="'.$file['name'][$i].'&#13;&#10;'.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i].'&#13;&#10;'.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'"><img src="'.$thumbpath.'_thumbs/_'.$file['name'][$i].$imagerefresh.'" alt="" />' .truncate_text($file['name'][$i],30).'</a></td>';\r
493         else echo '<td title="'.$file['name'][$i].'&#13;&#10;'.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'">'.truncate_text($file['name'][$i],30).'</td>';\r
494         echo '<td>'.bytestostring($file['size'][$i],1).'</td><td>'.$file['type'][$i].'</td>'\r
495         .'<td>';\r
496         form_hidden_input('actionfile['.$i.']',$file['name'][$i]);\r
497         switch($actionnow) \r
498                 {\r
499                 case 'delete':\r
500                         echo '<input class="del" type="checkbox" name="deletefile['.$i.']" value="1" />';       \r
501                         break;\r
502                 case 'rename':\r
503                         // get file extension\r
504                         $nameparts = explode('.',$file['name'][$i]);\r
505                         $ext = end($nameparts);\r
506                         form_hidden_input('renameext['.$i.']',$ext);\r
507                         form_text_input('renamefile['.$i.']',false,basename($file['name'][$i],$ext),30,120); echo $ext;\r
508                         break;\r
509                 case 'resize':\r
510                         form_text_input('resizefile['.$i.']',false,'',4,4); form_select($selectresize,'resizetype['.$i.']',false,'',false);\r
511                         break;\r
512                 case 'rotate':\r
513                         echo '<img src="img/rotate_c.gif" alt="'.TB_ROTATECW.'" /><input class="rad" type="radio" name="rotatefile['.$i.']" value="clock"><img src="img/rotate_ac.gif" alt="'.TB_ROTATECCW.'" /><input class="rad" type="radio" name="rotatefile['.$i.']" value="anticlock">'.TB_NONE.'<input class="rad" type="radio" name="rotatefile['.$i.']" value="none" checked>';\r
514                         break;\r
515                 case 'move':\r
516                         echo '<input class="del" type="checkbox" name="movefile['.$i.']" value="1" />';\r
517                         break;\r
518                 default:\r
519                         // do nothing\r
520                 }\r
521         echo "</td></tr>\n";\r
522         }\r
523 \r
524 echo "</table></div>\n".'<div class="pushright">';\r
525 if($tinybrowser['allowdelete'] || $tinybrowser['allowedit'])\r
526         {\r
527         form_hidden_input('sortby',$sortbynow);\r
528         form_hidden_input('sorttype',$sorttypenow);\r
529         form_hidden_input('find',$findnow);\r
530         form_hidden_input('showpage',$showpagenow);\r
531         form_hidden_input('action',$actionnow);\r
532         form_submit_button('commit',$actionhead.' '.TB_FILES,'edit');\r
533         }\r
534 ?>\r
535 </div></fieldset></div></div>\r
536 </body>\r
537 </html>\r