| 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 | ---------------------------------------------------------------------- |
|---|
| 29 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | |
|---|
| 32 | $p=$bro->GetPrefs(); |
|---|
| 33 | if (!$R && $p["golastdir"]) { |
|---|
| 34 | $R=$p["lastdir"]; |
|---|
| 35 | } |
|---|
| 36 | $R=$bro->convertabsolute($R,1); |
|---|
| 37 | // on fait ? |
|---|
| 38 | if ($formu) { |
|---|
| 39 | switch ($formu) { |
|---|
| 40 | case 1: // Créer le répertoire $R.$nomfich |
|---|
| 41 | if (!$bro->CreateDir($R,$nomfich)) { |
|---|
| 42 | print $err->errstr(); |
|---|
| 43 | } |
|---|
| 44 | $p=$bro->GetPrefs(); |
|---|
| 45 | break; |
|---|
| 46 | case 6: // Créer le fichier $R.$nomfich |
|---|
| 47 | if (!$bro->CreateFile($R,$nomfich)) { |
|---|
| 48 | print $err->errstr(); |
|---|
| 49 | } |
|---|
| 50 | $p=$bro->GetPrefs(); |
|---|
| 51 | if ($p["createfile"]==1) { |
|---|
| 52 | $file=$nomfich; |
|---|
| 53 | include("bro_editor.php"); |
|---|
| 54 | exit(); |
|---|
| 55 | } |
|---|
| 56 | break; |
|---|
| 57 | case 2: // act vaut Supprimer Copier ou Renommer. |
|---|
| 58 | if ($actdel) { |
|---|
| 59 | if ($del_confirm != "") { |
|---|
| 60 | if (!$bro->DeleteFile($d,$R)) { |
|---|
| 61 | print $err->errstr(); |
|---|
| 62 | } |
|---|
| 63 | } elseif (!$cancel && is_array($d)) { |
|---|
| 64 | include("head.php"); |
|---|
| 65 | ?> |
|---|
| 66 | </head> |
|---|
| 67 | <body> |
|---|
| 68 | <h3><?php printf(_("Deleting files and/or directories")); ?> : </h3> |
|---|
| 69 | <form action="bro_main.php" method="post"> |
|---|
| 70 | <input type="hidden" name="formu" value="2" /> |
|---|
| 71 | <input type="hidden" name="actdel" value="1" /> |
|---|
| 72 | <input type="hidden" name="R" value="<?php echo $R?>" /> |
|---|
| 73 | <p class="error"><?php __("WARNING: Confirm the deletion of this files"); ?></p> |
|---|
| 74 | <?php foreach($d as $file){ ?> |
|---|
| 75 | <p><?php echo stripslashes($file); ?></p> |
|---|
| 76 | <input type="hidden" name="d[]" value="<?php echo htmlentities(stripslashes($file)); ?>" /> |
|---|
| 77 | <?php } ?> |
|---|
| 78 | <blockquote> |
|---|
| 79 | <input type="submit" class="inb" name="del_confirm" value="<?php __("Yes"); ?>" /> |
|---|
| 80 | <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> |
|---|
| 81 | </blockquote> |
|---|
| 82 | </form> |
|---|
| 83 | </body> |
|---|
| 84 | </html> |
|---|
| 85 | <?php |
|---|
| 86 | exit(); |
|---|
| 87 | } |
|---|
| 88 | } |
|---|
| 89 | if ($actcopy) { |
|---|
| 90 | if (!$bro->CopyFile($d,$R,$actmoveto)) { |
|---|
| 91 | print $err->errstr(); |
|---|
| 92 | } |
|---|
| 93 | } |
|---|
| 94 | if ($actmove) { |
|---|
| 95 | if (!$bro->MoveFile($d,$R,$actmoveto)) { |
|---|
| 96 | print $err->errstr(); |
|---|
| 97 | } |
|---|
| 98 | } |
|---|
| 99 | break; |
|---|
| 100 | case 4: // Renommage Effectif... |
|---|
| 101 | if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names |
|---|
| 102 | print $err->errstr(); |
|---|
| 103 | } |
|---|
| 104 | break; |
|---|
| 105 | case 3: // Upload de fichier... |
|---|
| 106 | if (!$bro->UploadFile($R)) { |
|---|
| 107 | print $err->errstr(); |
|---|
| 108 | } |
|---|
| 109 | break; |
|---|
| 110 | } |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | if ($actextract) { |
|---|
| 114 | print _("extracting..."); |
|---|
| 115 | if ($bro->ExtractFile($file, $R)) { |
|---|
| 116 | print $err->errstr(); |
|---|
| 117 | print _("failed"); |
|---|
| 118 | } else { |
|---|
| 119 | print _("done"); |
|---|
| 120 | } |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | /* Creation de la liste des fichiers courants */ |
|---|
| 124 | $c=$bro->filelist($R); |
|---|
| 125 | if ($c===false) $error=$err->errstr(); |
|---|
| 126 | |
|---|
| 127 | include("head.php"); |
|---|
| 128 | ?> |
|---|
| 129 | </head> |
|---|
| 130 | <body> |
|---|
| 131 | |
|---|
| 132 | <table border="0" width="100%" cellspacing="0"> |
|---|
| 133 | <tr><td> |
|---|
| 134 | |
|---|
| 135 | <hr /> |
|---|
| 136 | <table width="100%"><tr><td valign="top"> |
|---|
| 137 | <a href="bro_main.php?R=/"><?php echo $mem->user["login"]; ?></a> / <?php echo $bro->PathList($R,"bro_main.php") ?><br /> |
|---|
| 138 | <small> |
|---|
| 139 | <?php if ($error) echo "<font color=\"red\">$error</font>"; ?> |
|---|
| 140 | </td><td valign="top" align="right"> |
|---|
| 141 | <h3><?php __("File browser"); ?></h3> |
|---|
| 142 | |
|---|
| 143 | <form action="bro_main.php" method="post" name="nn" id="nn"> |
|---|
| 144 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 145 | <table><tr> |
|---|
| 146 | <td><input type="text" class="int" name="nomfich" size="22" maxlength="255" /></td> |
|---|
| 147 | <td><input type="submit" class="inb" value="<?php __("Create"); ?>" /></td> |
|---|
| 148 | </tr><tr><td> |
|---|
| 149 | <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> |
|---|
| 150 | <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> |
|---|
| 151 | </td><td></td></tr></table> |
|---|
| 152 | </form> |
|---|
| 153 | </td></tr> |
|---|
| 154 | </table> |
|---|
| 155 | |
|---|
| 156 | </td></tr> |
|---|
| 157 | <tr><td valign="top"> |
|---|
| 158 | |
|---|
| 159 | <?php |
|---|
| 160 | /* Renommer / Copier / Déplacer les fichiers : */ |
|---|
| 161 | if ($formu==2 && $actrename && count($d)) { |
|---|
| 162 | echo "<form action=\"bro_main.php\" method=\"post\">\n"; |
|---|
| 163 | echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n"; |
|---|
| 164 | echo "<input type=\"hidden\" name=\"formu\" value=\"4\" />\n"; |
|---|
| 165 | echo "<p>"._("Rename")."</p>"; |
|---|
| 166 | for ($i=0;$i<count($d);$i++) { |
|---|
| 167 | $d[$i]=ssla($d[$i]); |
|---|
| 168 | echo "<table>"; |
|---|
| 169 | echo "<tr><td>"._("Old Name:")."</td><td><input type=\"hidden\" name=\"o[$i]\" value=\"".$d[$i]."\" />".$d[$i]."</td></tr>"; |
|---|
| 170 | echo "<tr><td>"._("New Name:")."</td><td><input type=\"text\" class=\"int\" style=\"width: 350px\" name=\"d[$i]\" value=\"".$d[$i]."\" /></td></tr>"; |
|---|
| 171 | echo "</table>"; |
|---|
| 172 | } |
|---|
| 173 | echo "<p><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Rename")."\" /></p>"; |
|---|
| 174 | echo "</form>\n"; |
|---|
| 175 | echo "<hr />\n"; |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | /* We draw the file list and button bar only if there is files here ! */ |
|---|
| 179 | if (count($c)) { |
|---|
| 180 | |
|---|
| 181 | ?> |
|---|
| 182 | <form action="bro_main.php" method="post" name="main" id="main"> |
|---|
| 183 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 184 | <input type="hidden" name="formu" value="2" /> |
|---|
| 185 | <hr /> |
|---|
| 186 | <script type="text/javascript"> |
|---|
| 187 | <!-- |
|---|
| 188 | document.write("<input type=\"button\" value=\"<?php __("all/none"); ?>\" class=\"inb\" onclick=\"CheckAll();\" />"); |
|---|
| 189 | // --> |
|---|
| 190 | </script> |
|---|
| 191 | <input type="submit" class="inb" name="actdel" value="<?php __("Delete"); ?>" /> |
|---|
| 192 | |
|---|
| 193 | <input type="submit" class="inb" name="actrename" value="<?php __("Rename"); ?>" /> |
|---|
| 194 | |
|---|
| 195 | <input type="submit" class="inb" name="actcopy" value="<?php __("Copy to"); ?>" /> |
|---|
| 196 | |
|---|
| 197 | <input type="submit" class="inb" name="actmove" value="<?php __("Move to"); ?>" /> : <input type="text" class="int" name="actmoveto" value="" /> |
|---|
| 198 | <script type="text/javascript"> |
|---|
| 199 | <!-- |
|---|
| 200 | document.write("<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.actmoveto');\" value=\" ... \" class=\"inb\" />"); |
|---|
| 201 | // --> |
|---|
| 202 | </script> |
|---|
| 203 | <hr /> |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | |
|---|
| 207 | <?php |
|---|
| 208 | switch ($p["listmode"]) { |
|---|
| 209 | case 0: |
|---|
| 210 | /* AFFICHE 1 COLONNE DETAILLEE */ |
|---|
| 211 | reset($c); |
|---|
| 212 | echo "<table width=\"100%\" style=\"border: 0px\" cellpadding=\"0\" cellspacing=\"0\">"; |
|---|
| 213 | $col=1; |
|---|
| 214 | for($i=0;$i<count($c);$i++) { |
|---|
| 215 | $col=3-$col; |
|---|
| 216 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 217 | if ($c[$i]["type"]) { |
|---|
| 218 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>"; |
|---|
| 219 | if ($p["showicons"]) { |
|---|
| 220 | echo "<td width=\"28\"><img src=\"icon/".$bro->icon($c[$i]["name"])."\" width=\"16\" height=\"16\" alt=\"\" /></td>"; |
|---|
| 221 | } |
|---|
| 222 | echo "<td><a href=\""; |
|---|
| 223 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 224 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 225 | echo " <td>".format_size($c[$i]["size"])."</td>"; |
|---|
| 226 | 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>"; |
|---|
| 227 | if ($p["showtype"]) { |
|---|
| 228 | echo "<td>"._($bro->mime($c[$i]["name"]))."</td>"; |
|---|
| 229 | } |
|---|
| 230 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 231 | if ($vu) { |
|---|
| 232 | echo "<td><a href=\"$vu\">"._("View")."</a>"; |
|---|
| 233 | } else { |
|---|
| 234 | echo "<td> "; |
|---|
| 235 | } |
|---|
| 236 | $e = $bro->is_extractable($R,$c[$i]["name"]); |
|---|
| 237 | if ($e) { |
|---|
| 238 | echo "<a href=\"bro_main.php?actextract=1&file=".urlencode($c[$i]["name"])."&R=".urlencode($R)."\">"; |
|---|
| 239 | echo _("Extract"); |
|---|
| 240 | echo "</a>"; |
|---|
| 241 | } else { |
|---|
| 242 | echo "not extracable"; |
|---|
| 243 | } |
|---|
| 244 | |
|---|
| 245 | echo "</td>\n"; |
|---|
| 246 | } else { // DOSSIER : |
|---|
| 247 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>"; |
|---|
| 248 | if ($p["showicons"]) { |
|---|
| 249 | echo "<td width=\"28\"><img src=\"icon/folder.png\" width=\"16\" height=\"16\" alt=\"\" /></td>"; |
|---|
| 250 | } |
|---|
| 251 | echo "<td><b><a href=\""; |
|---|
| 252 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 253 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 254 | echo " <td>".format_size($c[$i]["size"])."</td>"; |
|---|
| 255 | 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>"; |
|---|
| 256 | if ($p["showtype"]) { |
|---|
| 257 | echo "<td>Dossier</td>"; |
|---|
| 258 | } |
|---|
| 259 | echo "<td> "; |
|---|
| 260 | echo "</td>\n"; |
|---|
| 261 | } |
|---|
| 262 | |
|---|
| 263 | echo "</tr>\n"; |
|---|
| 264 | } |
|---|
| 265 | echo "</table>"; |
|---|
| 266 | break; |
|---|
| 267 | case 1: |
|---|
| 268 | /* AFFICHE 2 COLONNES COURTES */ |
|---|
| 269 | reset($c); |
|---|
| 270 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 271 | echo "<tr><td valign=\"top\" width=\"50%\">"; |
|---|
| 272 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 273 | $col=1; |
|---|
| 274 | for($i=0;$i<round(count($c)/2);$i++) { |
|---|
| 275 | $col=3-$col; |
|---|
| 276 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 277 | if ($c[$i]["type"]) { |
|---|
| 278 | echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\" /></td><td><a href=\""; |
|---|
| 279 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 280 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 281 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 282 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 283 | if ($vu) { |
|---|
| 284 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 285 | } else { |
|---|
| 286 | echo "<td> "; |
|---|
| 287 | } |
|---|
| 288 | echo "</td>\n"; |
|---|
| 289 | } else { |
|---|
| 290 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 291 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 292 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 293 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 294 | echo " "; |
|---|
| 295 | echo "</td>\n"; |
|---|
| 296 | } |
|---|
| 297 | |
|---|
| 298 | echo "</tr>\n"; |
|---|
| 299 | } |
|---|
| 300 | echo "</table>"; |
|---|
| 301 | echo "</td><td valign=\"top\" width=\"50%\">"; |
|---|
| 302 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 303 | $col=1; |
|---|
| 304 | for($i=round(count($c)/2);$i<count($c);$i++) { |
|---|
| 305 | $col=3-$col; |
|---|
| 306 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 307 | if ($c[$i]["type"]) { |
|---|
| 308 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 309 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 310 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 311 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 312 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 313 | if ($vu) { |
|---|
| 314 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 315 | } else { |
|---|
| 316 | echo "<td> "; |
|---|
| 317 | } |
|---|
| 318 | echo "</td>\n"; |
|---|
| 319 | } else { |
|---|
| 320 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 321 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 322 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 323 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 324 | echo " "; |
|---|
| 325 | echo "</td>\n"; |
|---|
| 326 | } |
|---|
| 327 | |
|---|
| 328 | echo "</tr>\n"; |
|---|
| 329 | } |
|---|
| 330 | echo "</table>"; |
|---|
| 331 | echo "</td></tr>"; |
|---|
| 332 | echo "</table>"; |
|---|
| 333 | break; |
|---|
| 334 | case 2: |
|---|
| 335 | /* AFFICHE 3 COLONNES COURTES */ |
|---|
| 336 | reset($c); |
|---|
| 337 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 338 | echo "<tr><td valign=\"top\" width=\"33%\">"; |
|---|
| 339 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 340 | $col=1; |
|---|
| 341 | for($i=0;$i<round(count($c)/3);$i++) { |
|---|
| 342 | $col=3-$col; |
|---|
| 343 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 344 | if ($c[$i]["type"]) { |
|---|
| 345 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 346 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 347 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 348 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 349 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 350 | if ($vu) { |
|---|
| 351 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 352 | } else { |
|---|
| 353 | echo "<td> "; |
|---|
| 354 | } |
|---|
| 355 | echo "</td>\n"; |
|---|
| 356 | } else { |
|---|
| 357 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 358 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 359 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 360 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 361 | echo " "; |
|---|
| 362 | echo "</td>\n"; |
|---|
| 363 | } |
|---|
| 364 | |
|---|
| 365 | echo "</tr>\n"; |
|---|
| 366 | } |
|---|
| 367 | echo "</table>"; |
|---|
| 368 | echo "</td><td valign=\"top\" width=\"33%\">"; |
|---|
| 369 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 370 | $col=1; |
|---|
| 371 | for($i=round(count($c)/3);$i<round(2*count($c)/3);$i++) { |
|---|
| 372 | $col=3-$col; |
|---|
| 373 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 374 | if ($c[$i]["type"]) { |
|---|
| 375 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 376 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 377 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 378 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 379 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 380 | if ($vu) { |
|---|
| 381 | echo "<td><a href=\"$vu\">"._("V")."</a>"; |
|---|
| 382 | } else { |
|---|
| 383 | echo "<td> "; |
|---|
| 384 | } |
|---|
| 385 | |
|---|
| 386 | echo "</td>\n"; |
|---|
| 387 | } else { |
|---|
| 388 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 389 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 390 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 391 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 392 | echo " "; |
|---|
| 393 | echo "</td>\n"; |
|---|
| 394 | } |
|---|
| 395 | |
|---|
| 396 | echo "</tr>\n"; |
|---|
| 397 | } |
|---|
| 398 | echo "</table>"; |
|---|
| 399 | echo "</td><td valign=\"top\" width=\"33%\">"; |
|---|
| 400 | echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>"; |
|---|
| 401 | $col=1; |
|---|
| 402 | for($i=round(2*count($c)/3);$i<count($c);$i++) { |
|---|
| 403 | $col=3-$col; |
|---|
| 404 | echo "<tr class=\"lst$col\">\n"; |
|---|
| 405 | if ($c[$i]["type"]) { |
|---|
| 406 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\""; |
|---|
| 407 | echo "bro_editor.php?file=".urlencode($c[$i]["name"])."&R=".urlencode($R); |
|---|
| 408 | echo "\">".htmlentities($c[$i]["name"])."</a></td>\n"; |
|---|
| 409 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 410 | $vu=$bro->viewurl($R,$c[$i]["name"]); |
|---|
| 411 | if ($vu) { |
|---|
| 412 | echo "<td><a href=\"$vu\">"._("View")."</a>"; |
|---|
| 413 | } else { |
|---|
| 414 | echo "<td> "; |
|---|
| 415 | } |
|---|
| 416 | echo "</td>\n"; |
|---|
| 417 | } else { |
|---|
| 418 | echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\""; |
|---|
| 419 | echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]); |
|---|
| 420 | echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n"; |
|---|
| 421 | echo " <td>".format_size($c[$i]["size"])."</td><td>"; |
|---|
| 422 | echo " "; |
|---|
| 423 | echo "</td>\n"; |
|---|
| 424 | } |
|---|
| 425 | |
|---|
| 426 | echo "</tr>\n"; |
|---|
| 427 | } |
|---|
| 428 | echo "</table>"; |
|---|
| 429 | echo "</td></tr>"; |
|---|
| 430 | echo "</table>"; |
|---|
| 431 | break; |
|---|
| 432 | } |
|---|
| 433 | ?> |
|---|
| 434 | </form> |
|---|
| 435 | <?php |
|---|
| 436 | } // is there any files here ? |
|---|
| 437 | else { |
|---|
| 438 | echo "<p class=\"error\">"._("No files in this folder")."</p>"; |
|---|
| 439 | } |
|---|
| 440 | ?> |
|---|
| 441 | |
|---|
| 442 | </td></tr> |
|---|
| 443 | <tr><td colspan="2"> |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | <form action="bro_main.php" enctype="multipart/form-data" method="post"> |
|---|
| 447 | <input type="hidden" name="R" value="<?php echo $R; ?>" /> |
|---|
| 448 | <input type="hidden" name="formu" value="3" /> |
|---|
| 449 | <hr /> |
|---|
| 450 | <?php __("Import this file"); ?> <input class="int" name="userfile" type="file" /> |
|---|
| 451 | <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> |
|---|
| 452 | <input type="submit" class="inb" name="upload" value="<?php __("Send"); ?>" /> |
|---|
| 453 | <input type="submit" class="inb" name="extract" value="<?php __("Send & Extract"); ?>" /> |
|---|
| 454 | <hr /> |
|---|
| 455 | </form> |
|---|
| 456 | <p> </p> |
|---|
| 457 | |
|---|
| 458 | <?php |
|---|
| 459 | |
|---|
| 460 | |
|---|
| 461 | if ($id=$ftp->is_ftp($R)) { |
|---|
| 462 | echo _("There is an ftp account in this folder")." <a href=\"ftp_edit?id=".urlencode($id)."\">"._("Click here to edit this ftp account.")."</a><br />"; |
|---|
| 463 | } |
|---|
| 464 | else { |
|---|
| 465 | echo "<a href=\"ftp_add.php?dir=".urlencode($R)."\">"._("Click here to create an ftp account in this folder.")."</a><br />"; |
|---|
| 466 | } |
|---|
| 467 | |
|---|
| 468 | if ($hta->is_protected($R)) { |
|---|
| 469 | echo "<a href=\"hta_edit.php?dir=$R\">"._("This folder has restricted access")."</a><br />"; |
|---|
| 470 | } |
|---|
| 471 | else { |
|---|
| 472 | echo "<a href=\"hta_add.php?value=$R\">"._("Click here to protect this folder with login/password")."</a><br />"; |
|---|
| 473 | } |
|---|
| 474 | ?> |
|---|
| 475 | <br /> |
|---|
| 476 | <a href="bro_tgzdown.php?dir=<?php echo $R; ?>"><?php __("Download"); ?></a> <?php __("this folder and its subfolders as a compressed file"); ?> (<?php echo $bro->l_tgz[$p["downfmt"]]; ?>)<br /> |
|---|
| 477 | <a href="bro_pref.php"><?php __("Configure the file browser"); ?></a><br /> |
|---|
| 478 | |
|---|
| 479 | </td></tr></table> |
|---|
| 480 | |
|---|
| 481 | </body> |
|---|
| 482 | </html> |
|---|