| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: bro_main.php,v 1.11 2004/09/06 18:14:36 anonymous Exp $ |
|---|
| 4 | ---------------------------------------------------------------------- |
|---|
| 5 | AlternC - Web Hosting System |
|---|
| 6 | Copyright (C) 2002 by the AlternC Development Team. |
|---|
| 7 | http://alternc.org/ |
|---|
| 8 | ---------------------------------------------------------------------- |
|---|
| 9 | Based on: |
|---|
| 10 | Valentin Lacambre's web hosting softwares: http://altern.org/ |
|---|
| 11 | ---------------------------------------------------------------------- |
|---|
| 12 | LICENSE |
|---|
| 13 | |
|---|
| 14 | This program is free software; you can redistribute it and/or |
|---|
| 15 | modify it under the terms of the GNU General Public License (GPL) |
|---|
| 16 | as published by the Free Software Foundation; either version 2 |
|---|
| 17 | of the License, or (at your option) any later version. |
|---|
| 18 | |
|---|
| 19 | This program is distributed in the hope that it will be useful, |
|---|
| 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 22 | GNU General Public License for more details. |
|---|
| 23 | |
|---|
| 24 | To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|---|
| 25 | ---------------------------------------------------------------------- |
|---|
| 26 | Original Author of file: Benjamin Sonntag, Remi |
|---|
| 27 | Purpose of file: Online file Browser of AlternC |
|---|
| 28 | TODO : Voir ??? + Déplacer / Copier |
|---|
| 29 | ---------------------------------------------------------------------- |
|---|
| 30 | */ |
|---|
| 31 | require_once("../class/config.php"); |
|---|
| 32 | include_once ("head.php"); |
|---|
| 33 | |
|---|
| 34 | $fields = array ( |
|---|
| 35 | "R" => array ("request", "string", ""), |
|---|
| 36 | "o" => array ("request", "array", ""), |
|---|
| 37 | "d" => array ("request", "array", ""), |
|---|
| 38 | "perm" => array ("post", "array", array()), |
|---|
| 39 | "formu" => array ("request", "integer", ""), |
|---|
| 40 | "actextract" => array ("request", "string", ""), |
|---|
| 41 | "fileextract" => array ("request", "string", ""), |
|---|
| 42 | "actperms" => array ("request", "string", ""), |
|---|
| 43 | "actdel" => array ("request", "string", ""), |
|---|
| 44 | "actcopy" => array ("request", "string", ""), |
|---|
| 45 | "actrename" => array ("request", "string", ""), |
|---|
| 46 | "actmove" => array ("request", "string", ""), |
|---|
| 47 | "actmoveto" => array ("request", "string", ""), |
|---|
| 48 | "nomfich" => array ("request", "string", ""), |
|---|
| 49 | "del_confirm" => array ("request", "string", ""), |
|---|
| 50 | "cancel" => array ("request", "string", ""), |
|---|
| 51 | "showdirsize" => array ("request", "integer", "0"), |
|---|
| 52 | "nomfich" => array ("request", "string", ""), |
|---|
| 53 | ); |
|---|
| 54 | getFields($fields); |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | $p=$bro->GetPrefs(); |
|---|
| 58 | if (! isset($R)) $R=''; |
|---|
| 59 | if (!$R && $p["golastdir"]) { |
|---|
| 60 | $R=$p["lastdir"]; |
|---|
| 61 | } |
|---|
| 62 | $R=$bro->convertabsolute($R,1); |
|---|
| 63 | // on fait ? |
|---|
| 64 | if (!empty($formu) && $formu) { |
|---|
| 65 | switch ($formu) { |
|---|
| 66 | case 1: // Créer le répertoire $R.$nomfich |
|---|
| 67 | if (!$bro->CreateDir($R,$nomfich)) { |
|---|
| 68 | $error = $err->errstr(); |
|---|
| 69 | } |
|---|
| 70 | $p=$bro->GetPrefs(); |
|---|
| 71 | break; |
|---|
| 72 | case 6: // Créer le fichier $R.$nomfich |
|---|
| 73 | if (!$bro->CreateFile($R,$nomfich)) { |
|---|
| 74 | $error = $err->errstr(); |
|---|
| 75 | } |
|---|
| 76 | $p=$bro->GetPrefs(); |
|---|
| 77 | if ($p["createfile"]==1) { |
|---|
| 78 | $editfile=$nomfich; |
|---|
| 79 | include("bro_editor.php"); |
|---|
| 80 | exit(); |
|---|
| 81 | } |
|---|
| 82 | break; |
|---|
| 83 | case 2: // act vaut Supprimer Copier ou Renommer. |
|---|
| 84 | if ($actdel) { |
|---|
| 85 | if (!empty($del_confirm) ) { |
|---|
| 86 | if (!$bro->DeleteFile($d,$R)) { |
|---|
| 87 | $error = $err->errstr(); |
|---|
| 88 | } |
|---|
| 89 | } elseif (empty($cancel) && is_array($d)) { |
|---|
| 90 | include_once("head.php"); |
|---|
| 91 | ?> |
|---|
| 92 | <h3><?php printf(_("Deleting files and/or directories")); ?> : </h3> |
|---|
| 93 | <form action="bro_main.php" method="post" name="main" id="main"> |
|---|
| 94 | <input type="hidden" name="formu" value="2" /> |
|---|
| 95 | <input type="hidden" name="actdel" value="1" /> |
|---|
| 96 | <input type="hidden" name="R" value="<?php echo ehe($R)?>" /> |
|---|
| 97 | <p class="error"><?php __("WARNING: Confirm the deletion of this files"); ?></p> |
|---|
| 98 | <?php foreach($d as $editfile){ ?> |
|---|
| 99 | <p><?php echo stripslashes($editfile); ?></p> |
|---|
| 100 | <input type="hidden" name="d[]" value="<?php echo htmlentities(stripslashes($editfile)); ?>" /> |
|---|
| 101 | <?php } ?> |
|---|
| 102 | <blockquote> |
|---|
| 103 | <input type="submit" class="inb" name="del_confirm" value="<?php __("Yes"); ?>" /> |
|---|
| 104 | <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> |
|---|
| 105 | </blockquote> |
|---|
| 106 | </form> |
|---|
| 107 | <?php |
|---|
| 108 | include_once("foot.php"); |
|---|
| 109 | exit(); |
|---|
| 110 | } |
|---|
| 111 | } |
|---|
| 112 | if ($actcopy) { |
|---|
| 113 | if (!$bro->CopyFile($d,$R,$actmoveto)) { |
|---|
| 114 | $error = $err->errstr(); |
|---|
| 115 | } |
|---|
| 116 | } |
|---|
| 117 | if ($actmove) { |
|---|
| 118 | if (!$bro->MoveFile($d,$R,$actmoveto)) { |
|---|
| 119 | $error = $err->errstr(); |
|---|
| 120 | } |
|---|
| 121 | } |
|---|
| 122 | break; |
|---|
| 123 | case 4: // Renommage Effectif... |
|---|
| 124 | if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names |
|---|
| 125 | $error = $err->errstr(); |
|---|
| 126 | } |
|---|
| 127 | break; |
|---|
| 128 | case 3: // Upload de fichier... |
|---|
| 129 | if (!$bro->UploadFile($R)) { |
|---|
| 130 | $error = $err->errstr(); |
|---|
| 131 | } |
|---|
| 132 | break; |
|---|
| 133 | case 7: // Changement de permissions [ML] |
|---|
| 134 | if (!@$bro->ChangePermissions($R, $d, $perm)) { |
|---|
| 135 | $error = $err->errstr(); |
|---|
| 136 | } |
|---|
| 137 | break; |
|---|
| 138 | } |
|---|
| 139 | } |
|---|
| 140 | |
|---|
| 141 | if (isset($actextract) && $actextract) { |
|---|
| 142 | print _("extracting...")."<br />\n"; flush(); |
|---|
| 143 | if ($bro->ExtractFile($R. '/' . $fileextract, $R)) { |
|---|
| 144 | echo "<p class=\"error\">"; |
|---|
| 145 | print $err->errstr(); |
|---|
| 146 | print _("failed")."<br />\n"; |
|---|
| 147 | echo "</p>"; |
|---|
| 148 | } else { |
|---|
| 149 | print _("done")."<br />\n"; |
|---|
| 150 | } |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | ?> |
|---|
| 154 | <h3><?php __("File browser"); ?></h3> |
|---|
| 155 | <table border="0" width="100%" cellspacing="0"> |
|---|
| 156 | <tr><td> |
|---|
| 157 | |
|---|
| 158 | <hr /> |
|---|
| 159 | |
|---|
| 160 | <p class="breadcrumb"> |
|---|
| 161 | <?php __("Path"); ?> / <a href="bro_main.php?R=/"><?php echo $mem->user["login"]; ?></a> / <?php echo $bro->PathList($R,"bro_main.php") ?> |
|---|
| 162 | </p> |
|---|
| 163 | |
|---|
| 164 | <?php |
|---|
| 165 | /* Creation de la liste des fichiers courants */ |
|---|
| 166 | $c=$bro->filelist($R, $showdirsize ); |
|---|
| 167 | if ($c===false) { |
|---|
| 168 | echo "<p class=\"error\">".$err->errstr()."</p>"; |
|---|
| 169 | require_once('foot.php'); |
|---|
| 170 | exit; |
|---|
| 171 | } |
|---|
| 172 | |
|---|
| 173 | if (isset($error) && $error) echo "<p class=\"error\">$error</p>"; |
|---|
| 174 | ?> |
|---|
| 175 | |
|---|
| 176 | <table><tr> |
|---|
| 177 | <td class="formcell"> |
|---|
| 178 | |
|---|
| 179 | <form action="bro_main.php" enctype="multipart/form-data" method="post"> |
|---|
| 180 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 181 | <input type="hidden" name="formu" value="3" /> |
|---|
| 182 | |
|---|
| 183 | <?php __("Send one file:"); ?><br /> |
|---|
| 184 | <input class="int" name="userfile" type="file" /> |
|---|
| 185 | <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> |
|---|
| 186 | <br /> |
|---|
| 187 | <input type="submit" id="sendthisfile" class="ina" value="<?php __("Send this file"); ?>" /> |
|---|
| 188 | |
|---|
| 189 | </form> |
|---|
| 190 | |
|---|
| 191 | </td> |
|---|
| 192 | <td style="width: 20px"> </td> |
|---|
| 193 | <td class="formcell"> |
|---|
| 194 | |
|---|
| 195 | <?php __("New file or folder:"); ?><br /> |
|---|
| 196 | <form action="bro_main.php" method="post" name="nn" id="nn"> |
|---|
| 197 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 198 | <table><tr> |
|---|
| 199 | <td><input type="text" class="int" name="nomfich" id="nomfich" size="22" maxlength="255" /></td> |
|---|
| 200 | <td><input type="submit" class="ina" value="<?php __("Create"); ?>" /></td> |
|---|
| 201 | </tr><tr><td> |
|---|
| 202 | <input type="radio" class="inc" id="nfile" onclick="document.nn.nomfich.focus();" name="formu" value="6" <?php if (!$p["crff"]) echo "checked=\"checked\""; ?> /><label for="nfile"> <?php __("File"); ?></label> |
|---|
| 203 | <input type="radio" class="inc" id="nfold" onclick="document.nn.nomfich.focus();" name="formu" value="1" <?php if ($p["crff"]) echo "checked=\"checked\""; ?> /><label for="nfold"> <?php __("Folder"); ?></label> |
|---|
| 204 | </td><td></td></tr></table> |
|---|
| 205 | </form> |
|---|
| 206 | </td></tr> |
|---|
| 207 | </table> |
|---|
| 208 | |
|---|
| 209 | |
|---|
| 210 | </td></tr> |
|---|
| 211 | <tr><td valign="top"> |
|---|
| 212 | |
|---|
| 213 | <?php |
|---|
| 214 | /* Renommer / Copier / Déplacer les fichiers : */ |
|---|
| 215 | if (isset($formu) && $formu==2 && isset($actrename) && $actrename && count($d)) { |
|---|
| 216 | echo "<table cellpadding=\"6\">\n"; |
|---|
| 217 | echo "<form action=\"bro_main.php\" method=\"post\">\n"; |
|---|
| 218 | echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n"; |
|---|
| 219 | echo "<input type=\"hidden\" name=\"formu\" value=\"4\" />\n"; |
|---|
| 220 | echo "<tr><th colspan=\"2\">"._("Rename")."</th></tr>"; |
|---|
| 221 | for ($i=0;$i<count($d);$i++) { |
|---|
| 222 | $d[$i]=ssla($d[$i]); |
|---|
| 223 | echo "<tr><td><input type=\"hidden\" name=\"o[$i]\" value=\"".$d[$i]."\" />".$d[$i]."</td>"; |
|---|
| 224 | echo "<td><input type=\"text\" class=\"int\" name=\"d[$i]\" value=\"".$d[$i]."\" /></td></tr>"; |
|---|
| 225 | } |
|---|
| 226 | echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Rename")."\" /></td></tr>"; |
|---|
| 227 | echo "</table></form>\n"; |
|---|
| 228 | echo "<hr />\n"; |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | /* [ML] Changer les permissions : */ |
|---|
| 232 | if ($formu==2 && ! (empty($actperms)) && count($d)) { |
|---|
| 233 | echo "<form action=\"bro_main.php\" method=\"post\">\n"; |
|---|
| 234 | echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n"; |
|---|
| 235 | echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n"; |
|---|
| 236 | echo "<p>"._("Permissions")."</p>"; |
|---|
| 237 | |
|---|
| 238 | $tmp_absdir = $bro->convertabsolute($R,0); |
|---|
| 239 | |
|---|
| 240 | echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"0\">"; |
|---|
| 241 | echo "<tr>"; |
|---|
| 242 | echo "<th>" . _("File") . "</th><th>"._("Permissions")."</th>"; |
|---|
| 243 | echo "</tr>"; |
|---|
| 244 | |
|---|
| 245 | for ($i=0;$i<count($d);$i++) { |
|---|
| 246 | $d[$i]=ssla($d[$i]); |
|---|
| 247 | $stats = stat($tmp_absdir . '/' . $d[$i]); |
|---|
| 248 | $modes = $stats[2]; |
|---|
| 249 | |
|---|
| 250 | echo "<tr>"; |
|---|
| 251 | echo "<td>".$d[$i]."</td>"; |
|---|
| 252 | |
|---|
| 253 | // Owner |
|---|
| 254 | echo "<td>"; |
|---|
| 255 | echo "<input type=\"hidden\" name=\"d[$i]\" value=\"".$d[$i]."\" />"; |
|---|
| 256 | echo "<label for=\"permw$i\">"._("write")."</label> <input type=\"checkbox\" id=\"permw$i\" name=\"perm[$i][w]\" value=\"1\" ". (($modes & 0000200) ? 'checked="checked"' : '') ." />"; |
|---|
| 257 | echo "</td>"; |
|---|
| 258 | |
|---|
| 259 | echo "</tr>"; |
|---|
| 260 | } |
|---|
| 261 | |
|---|
| 262 | echo "</table>"; |
|---|
| 263 | |
|---|
| 264 | echo "<p><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Change permissions")."\" /></p>"; |
|---|
| 265 | echo "</form>\n"; |
|---|
| 266 | echo "<hr />\n"; |
|---|
| 267 | } |
|---|
| 268 | |
|---|
| 269 | /* We draw the file list and button bar only if there is files here ! */ |
|---|
| 270 | if (count($c)) { |
|---|
| 271 | |
|---|
| 272 | ?> |
|---|
| 273 | <form action="bro_main.php" method="post" name="main" id="main"> |
|---|
| 274 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 275 | <input type="hidden" name="formu" value="2" /> |
|---|
| 276 | |
|---|
| 277 | <br /> |
|---|
| 278 | |
|---|
| 279 | |
|---|
| 280 | <table width="100%" style="border: 0px"> |
|---|
| 281 | <tr><td class="" style="padding: 4px 4px 8px 4px"> |
|---|
| 282 | |
|---|
| 283 | <input type="submit" class="ina" name="actdel" value="<?php __("Delete"); ?>" /> |
|---|
| 284 | <input type="submit" class="ina" name="actrename" value="<?php __("Rename"); ?>" /> |
|---|
| 285 | <input type="submit" class="ina" name="actperms" value="<?php __("Permissions"); ?>" /> |
|---|
| 286 | | |
|---|
| 287 | <input type="submit" class="ina" name="actcopy" value="<?php __("Copy"); ?>" onClick=" return actmoveto_not_empty();"/> |
|---|
| 288 | <input type="submit" class="ina" name="actmove" value="<?php __("Move"); ?>" onClick=" return actmoveto_not_empty();"/> |
|---|
| 289 | <?php __("To"); ?> |
|---|
| 290 | <input type="text" class="int" id='actmoveto' name="actmoveto" value="" /> |
|---|
| 291 | <?php display_browser( "" , "main.actmoveto" ); ?> |
|---|
| 292 | |
|---|
| 293 | </td></tr> |
|---|
| 294 | |
|---|
| 295 | </table> |
|---|
| 296 | |
|---|
| 297 | <script type="text/javascript"> |
|---|
| 298 | function actmoveto_not_empty() { |
|---|
| 299 | if ( $('#actmoveto').val() =='' ) { |
|---|
| 300 | alert("<?php __("Please select a destination folder");?>"); |
|---|
| 301 | return false; |
|---|
| 302 | } |
|---|
| 303 | return true; |
|---|
| 304 | } |
|---|
| 305 | </script> |
|---|
| 306 | |
|---|
| 307 | |
|---|
| 308 | |
|---|
| 309 | <?php |
|---|
| 310 | switch ($p["listmode"]) { |
|---|
| 311 | case 0: |
|---|
| 312 | /* AFFICHE 1 COLONNE DETAILLEE */ |
|---|
| 313 | reset($c); |
|---|
| 314 | echo "<table width=\"100%\" class=\"tlist\" style=\"border: 0px\" cellpadding=\"2\" cellspacing=\"0\">"; |
|---|
| 315 | ?> |
|---|
| 316 | <tr><th> |
|---|
| 317 | <script type="text/javascript"> |
|---|
| 318 | <!-- |
|---|
| 319 | document.write("<input type=\"checkbox\" id=\"checkall\" value=\"1\" class=\"inb\" onclick=\"CheckAll();\" />"); |
|---|
| 320 | // --> |
|---|
| 321 | </script> |
|---|
| 322 | </th> |
|---|
| 323 | <?php if ($p["showicons"]) { ?> |
|---|
| 324 | <th style="text-align: center;"><?php if (!empty($R)) { echo $bro->PathList($R,"bro_main.php",true); }?></th> |
|---|
| 325 | <?php } ?> |
|---|
| 326 | <th><?php __("Filename"); ?></th> |
|---|
| 327 | <th><?php __("Size"); ?></th> |
|---|
| 328 | <th><?php __("Last modification"); ?></th> |
|---|
| 329 | <?php if ($p["showtype"]) { ?> |
|---|
| 330 | <th><?php __("File Type"); ?></th> |
|---|
| 331 | <?php } ?> |
|---|
| 332 | <th></th> |
|---|
| 333 | </tr> |
|---|
| 334 | <?php |
|---|
| 335 | |
|---|
| 336 | $col=1; |
|---|
| 337 | for($i=0;$i<count($c);$i++) { |
|---|
| 338 | $col=3-$col; |
|---|
| 339 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 340 | if ($c[$i]["type"]) { |
|---|
| 341 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>"; |
|---|
| 342 | if ($p["showicons"]) { |
|---|
| 343 | echo "<td style='text-align: center;' width=\"28\"><img src=\"icon/".$bro->icon($c[$i]["name"])."\" width=\"16\" height=\"16\" alt=\"\" /></td>"; |
|---|
| 344 | } |
|---|
| 345 | echo "<td><a href=\""; |
|---|
| 346 | $canedit = $bro->can_edit($R,$c[$i]["name"]); |
|---|
| 347 | if ($canedit) { |
|---|
| 348 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 349 | } else { |
|---|
| 350 | echo "bro_downloadfile.php?dir=".urlencode($R)."&file=".urlencode($c[$i]["name"]); |
|---|
| 351 | } |
|---|
| 352 | echo "\">"; ehe($c[$i]["name"]); |
|---|
| 353 | echo"</a></td>\n"; |
|---|
| 354 | echo " <td>".format_size($c[$i]["size"])."</td>"; |
|---|
| 355 | echo "<td>".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$c[$i]["date"]))."<br /></td>"; |
|---|
| 356 | if ($p["showtype"]) { |
|---|
| 357 | echo "<td>"._($bro->mime($c[$i]["name"]))."</td>"; |
|---|
| 358 | } |
|---|
| 359 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 360 | if ($vu) { |
|---|
| 361 | echo "<td><a href=\"$vu\">"._("View")."</a>"; |
|---|
| 362 | } else { |
|---|
| 363 | echo "<td> "; |
|---|
| 364 | } |
|---|
| 365 | $e = $bro->is_extractable($R,$c[$i]["name"]); |
|---|
| 366 | if ($e) { |
|---|
| 367 | echo " <a href=\"bro_main.php?actextract=1&fileextract=".urlencode($c[$i]["name"])."&R=".urlencode($R)."\">"; |
|---|
| 368 | echo _("Extract"); |
|---|
| 369 | echo "</a>"; |
|---|
| 370 | } |
|---|
| 371 | $ez = $bro->is_sqlfile($R,$c[$i]["name"]); |
|---|
| 372 | if ($ez) { |
|---|
| 373 | echo " <a href=\"javascript:;\" onClick=\"$('#rest_db_$i').toggle();\">"; |
|---|
| 374 | echo _("Restore SQL"); |
|---|
| 375 | echo "</a>"; |
|---|
| 376 | echo "<div id='rest_db_$i' style='display:none;'><fieldset><legend>"._("Restore SQL")."</legend>"._("In which database to you want to restore this dump?"); |
|---|
| 377 | echo "<br/>"; |
|---|
| 378 | echo "<input type='hidden' name ='filename' value='".htmlentities($R."/".$c[$i]["name"])."' />"; |
|---|
| 379 | $dbl=array(); foreach ($mysql->get_dblist() as $v) { $dbl[]=$v['db'];} |
|---|
| 380 | echo "<select id='db_name_$i'>"; eoption($dbl,'',true); echo "</select>" ; |
|---|
| 381 | echo "<a href='javascript:;' onClick='window.location=\"sql_restore.php?filename=".urlencode($R."/".$c[$i]["name"])."&id=\"+encodeURIComponent($(\"#db_name_$i\").val()) ;'>"._("Restore it")."</a>"; |
|---|
| 382 | echo "</fieldset></div>"; |
|---|
| 383 | } |
|---|
| 384 | |
|---|
| 385 | echo "</td>\n"; |
|---|
| 386 | } else { // DOSSIER : |
|---|
| 387 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>"; |
|---|
| 388 | if ($p["showicons"]) { |
|---|
| 389 | echo "<td width=\"28\" style='text-align: center;'><img src=\"icon/folder.png\" width=\"16\" height=\"16\" alt=\"\" /></td>"; |
|---|
| 390 | } |
|---|
| 391 | echo "<td><b><a href=\""; |
|---|
| 392 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 393 | echo "\">"; ehe($c[$i]["name"]); echo "/</a></b></td>\n"; |
|---|
| 394 | echo " <td>".format_size($c[$i]["size"])."</td>"; |
|---|
| 395 | echo "<td>".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d h:i:s",$c[$i]["date"]))."<br /></td>"; |
|---|
| 396 | if ($p["showtype"]) { |
|---|
| 397 | echo "<td>"._("Folder")."</td>"; |
|---|
| 398 | } |
|---|
| 399 | echo "<td> "; |
|---|
| 400 | echo "</td>\n"; |
|---|
| 401 | } |
|---|
| 402 | |
|---|
| 403 | echo "</tr>\n"; |
|---|
| 404 | } |
|---|
| 405 | echo "</table>"; |
|---|
| 406 | break; |
|---|
| 407 | case 1: |
|---|
| 408 | /* AFFICHE 2 COLONNES COURTES */ |
|---|
| 409 | reset($c); |
|---|
| 410 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 411 | echo "<tr><td valign=\"top\" width=\"50%\">"; |
|---|
| 412 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 413 | $col=1; |
|---|
| 414 | for($i=0;$i<round(count($c)/2);$i++) { |
|---|
| 415 | $col=3-$col; |
|---|
| 416 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 417 | if ($c[$i]["type"]) { |
|---|
| 418 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\" /></td><td><a href=\""; |
|---|
| 419 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 420 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 421 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 422 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 423 | if ($vu) { |
|---|
| 424 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 425 | } else { |
|---|
| 426 | echo "<td> "; |
|---|
| 427 | } |
|---|
| 428 | echo "</td>\n"; |
|---|
| 429 | } else { |
|---|
| 430 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 431 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 432 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 433 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 434 | echo " "; |
|---|
| 435 | echo "</td>\n"; |
|---|
| 436 | } |
|---|
| 437 | |
|---|
| 438 | echo "</tr>\n"; |
|---|
| 439 | } |
|---|
| 440 | echo "</table>"; |
|---|
| 441 | echo "</td><td valign=\"top\" width=\"50%\">"; |
|---|
| 442 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 443 | $col=1; |
|---|
| 444 | for($i=round(count($c)/2);$i<count($c);$i++) { |
|---|
| 445 | $col=3-$col; |
|---|
| 446 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 447 | if ($c[$i]["type"]) { |
|---|
| 448 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 449 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 450 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 451 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 452 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 453 | if ($vu) { |
|---|
| 454 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 455 | } else { |
|---|
| 456 | echo "<td> "; |
|---|
| 457 | } |
|---|
| 458 | echo "</td>\n"; |
|---|
| 459 | } else { |
|---|
| 460 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 461 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 462 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 463 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 464 | echo " "; |
|---|
| 465 | echo "</td>\n"; |
|---|
| 466 | } |
|---|
| 467 | |
|---|
| 468 | echo "</tr>\n"; |
|---|
| 469 | } |
|---|
| 470 | echo "</table>"; |
|---|
| 471 | echo "</td></tr>"; |
|---|
| 472 | echo "</table>"; |
|---|
| 473 | break; |
|---|
| 474 | case 2: |
|---|
| 475 | /* AFFICHE 3 COLONNES COURTES */ |
|---|
| 476 | reset($c); |
|---|
| 477 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 478 | echo "<tr><td valign=\"top\" width=\"33%\">"; |
|---|
| 479 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 480 | $col=1; |
|---|
| 481 | for($i=0;$i<round(count($c)/3);$i++) { |
|---|
| 482 | $col=3-$col; |
|---|
| 483 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 484 | if ($c[$i]["type"]) { |
|---|
| 485 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 486 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 487 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 488 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 489 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 490 | if ($vu) { |
|---|
| 491 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 492 | } else { |
|---|
| 493 | echo "<td> "; |
|---|
| 494 | } |
|---|
| 495 | echo "</td>\n"; |
|---|
| 496 | } else { |
|---|
| 497 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 498 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 499 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 500 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 501 | echo " "; |
|---|
| 502 | echo "</td>\n"; |
|---|
| 503 | } |
|---|
| 504 | |
|---|
| 505 | echo "</tr>\n"; |
|---|
| 506 | } |
|---|
| 507 | echo "</table>"; |
|---|
| 508 | echo "</td><td valign=\"top\" width=\"33%\">"; |
|---|
| 509 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 510 | $col=1; |
|---|
| 511 | for($i=round(count($c)/3);$i<round(2*count($c)/3);$i++) { |
|---|
| 512 | $col=3-$col; |
|---|
| 513 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 514 | if ($c[$i]["type"]) { |
|---|
| 515 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 516 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 517 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 518 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 519 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 520 | if ($vu) { |
|---|
| 521 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 522 | } else { |
|---|
| 523 | echo "<td> "; |
|---|
| 524 | } |
|---|
| 525 | |
|---|
| 526 | echo "</td>\n"; |
|---|
| 527 | } else { |
|---|
| 528 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 529 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 530 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 531 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 532 | echo " "; |
|---|
| 533 | echo "</td>\n"; |
|---|
| 534 | } |
|---|
| 535 | |
|---|
| 536 | echo "</tr>\n"; |
|---|
| 537 | } |
|---|
| 538 | echo "</table>"; |
|---|
| 539 | echo "</td><td valign=\"top\" width=\"33%\">"; |
|---|
| 540 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 541 | $col=1; |
|---|
| 542 | for($i=round(2*count($c)/3);$i<count($c);$i++) { |
|---|
| 543 | $col=3-$col; |
|---|
| 544 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 545 | if ($c[$i]["type"]) { |
|---|
| 546 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 547 | echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 548 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 549 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 550 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 551 | if ($vu) { |
|---|
| 552 | echo "<td><a href=\"$vu\">"._("View")."</a>"; |
|---|
| 553 | } else { |
|---|
| 554 | echo "<td> "; |
|---|
| 555 | } |
|---|
| 556 | echo "</td>\n"; |
|---|
| 557 | } else { |
|---|
| 558 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 559 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 560 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 561 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 562 | echo " "; |
|---|
| 563 | echo "</td>\n"; |
|---|
| 564 | } |
|---|
| 565 | |
|---|
| 566 | echo "</tr>\n"; |
|---|
| 567 | } |
|---|
| 568 | echo "</table>"; |
|---|
| 569 | echo "</td></tr>"; |
|---|
| 570 | echo "</table>"; |
|---|
| 571 | break; |
|---|
| 572 | } |
|---|
| 573 | ?> |
|---|
| 574 | </form> |
|---|
| 575 | <?php |
|---|
| 576 | } // is there any files here ? |
|---|
| 577 | else { |
|---|
| 578 | echo "<p class=\"error\">"._("No files in this folder")."</p>"; |
|---|
| 579 | } |
|---|
| 580 | ?> |
|---|
| 581 | |
|---|
| 582 | </td></tr> |
|---|
| 583 | <tr><td colspan="2" style=""> |
|---|
| 584 | |
|---|
| 585 | <br/> |
|---|
| 586 | |
|---|
| 587 | <p> |
|---|
| 588 | <span class="ina"><a href="bro_main.php?R=<?php echo $R; ?>&showdirsize=1"><?php __("Show size of directories"); ?></a></span> <?php __("(slow)"); ?> |
|---|
| 589 | </p><p> </p><p> |
|---|
| 590 | <span class="ina"><?php |
|---|
| 591 | if ($hta->is_protected($R)) { |
|---|
| 592 | echo "<a href=\"hta_edit.php?dir=".(($R)?$R:"/")."\">"._("Edit this folder's protection")."</a>"; |
|---|
| 593 | } |
|---|
| 594 | else { |
|---|
| 595 | echo "<a href=\"hta_add.php?dir=".(($R)?$R:"/")."\">"._("Protect this folder")."</a>"; |
|---|
| 596 | } |
|---|
| 597 | ?></span> <?php __("with a login and a password"); ?> |
|---|
| 598 | </p><p> |
|---|
| 599 | <span class="ina"> |
|---|
| 600 | <a href="bro_tgzdown.php?dir=<?php echo $R; ?>"><?php __("Download this folder"); ?></a> |
|---|
| 601 | </span> |
|---|
| 602 | <?php printf(_("as a %s file"),$bro->l_tgz[$p["downfmt"]]); ?> |
|---|
| 603 | </p> |
|---|
| 604 | <?php |
|---|
| 605 | |
|---|
| 606 | if ($id=$ftp->is_ftp($R)) { |
|---|
| 607 | ?> |
|---|
| 608 | <span class="ina"> |
|---|
| 609 | <a href="ftp_edit.php?amp;id=<?php ehe($id); ?>"><?php __("Edit the ftp account"); ?></a> |
|---|
| 610 | </span> <?php __("that exists in this folder"); ?> |
|---|
| 611 | <?php |
|---|
| 612 | } |
|---|
| 613 | else { |
|---|
| 614 | ?> |
|---|
| 615 | <span class="ina"> |
|---|
| 616 | <a href="ftp_edit.php?create=1&dir=<?php ehe($R); ?>"><?php __("Create an ftp account in this folder"); ?></a> |
|---|
| 617 | </span> |
|---|
| 618 | <?php |
|---|
| 619 | } |
|---|
| 620 | |
|---|
| 621 | ?> |
|---|
| 622 | <p> </p> |
|---|
| 623 | <p> |
|---|
| 624 | <span class="ina"> |
|---|
| 625 | <a href="bro_pref.php"><?php __("Configure the file editor"); ?></a> |
|---|
| 626 | </span> |
|---|
| 627 | </p> |
|---|
| 628 | </td></tr></table> |
|---|
| 629 | <?php include_once("foot.php"); ?> |
|---|