Просмотр исходного кода

Revert "Revert "Add files via upload""

This reverts commit bdbfd16def915a92429cf6658b980f5f391bd94a.
SuperUser 6 лет назад
Родитель
Сommit
dcce03ccc8

+ 11 - 2
7-Zip File Manager/CopyNMoveUI.php

@@ -32,7 +32,7 @@ include '../auth.php';
 
 					<div class="field">
 						<label>Extract to:</label>
-						<div class="ts labeled action input" style="width:100%">
+						<div class="ts labeled input" style="width:100%">
 							<div class="ts label">
 								/AOR/
 							</div>
@@ -106,7 +106,7 @@ function updatePath(){
 	if(path.slice(-1) !== "/"){
 		path = path + "/";
 	}
-	$("#filesshow").text("Target: /AOR/" + path + ao_module_codec.decodeUmFilename(f_file.replace(/^.*[\\\/]/, '')).replace(/\.[^.]*$/,'') + "/" + displayPath);
+	$("#filesshow").text("Target: /AOR/" + path + f_file.replace(/^.*[\\\/]/, '').replace(".","") + "/" + displayPath);
 	f_extractTo = "../" + path;
 }
 
@@ -129,6 +129,15 @@ function getUUID(){
 	return new Date().getTime();
 }
 
+/* still in implmention
+$( "#path" ).keypress(function() {
+	$.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
+	   $( "#path" ).autocomplete({
+		source: JSON.parse(data)
+		});
+	});
+});
+*/
 
 </script>
 </html>

+ 10 - 6
7-Zip File Manager/MainUI.php

@@ -233,12 +233,7 @@ function load(htmlelement){
 							if(tdpath.includes("?")){
 					            var tdicon = '<i class="exclamation triangle icon"></i>';
 					        }
-							if(tdpath.includes(".")){
-								tmp = tmp + "<td>" + tdicon + ao_module_codec.decodeUmFilename(tdpath) + "</td>";							
-							}else{
-								tmp = tmp + "<td>" + tdicon + ao_module_codec.decodeHexFoldername(tdpath) + "</td>";
-							}
-											        
+							tmp = tmp + "<td>" + tdicon + tdpath + "</td>";					        
 					    }else{
 					        tmp = tmp + "<td>" + value[key] + "</td>";
 					    }
@@ -249,6 +244,15 @@ function load(htmlelement){
 				$("#tbody").append(tmp + "</tr>");
 			});
 			
+			//Little patch for HEX file name (PATCH)
+			$( "tr td:first-child" ).each( function( index, element ){
+				var tpath = $(this);
+				if(/^inith[0-9a-fA-F]*\..*$|^[0-9a-fA-F]*$/.test($(tpath).text())){
+					$.get( '../SystemAOB/functions/file_system/um_filename_decoder.php?filename=' + $(tpath).text(), function( decodedfilename ) {
+						$(tpath).text(decodedfilename);
+					});
+				}
+			});
 			
 			//process for Prev button 
 			var path = $(htmlelement).attr("path").split("/");

+ 35 - 2
7-Zip File Manager/ProgressUI.php

@@ -80,8 +80,7 @@ ao_module_setWindowIcon("loading spinner");
 var f_load = setInterval(function(){ 
 
 	$.ajax({
-		//url: "getMessage.php?id=" + f_rand + "messages",
-		url: "./tmp/" + f_rand + "messages",
+		url: "getMessage.php?id=" + f_rand + "messages",
 		contentType: "text/plain"
 	}).done(function(data) { 
 		var progress = data.match(/ ([0-9]{0,2}%)/gim);
@@ -131,6 +130,40 @@ $.get("opr.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&d
 						f_openFile(true);
 					}
 				});
+				/*
+				console.log('../SystemAOB/functions/file_system/copy_folder.php?from=../../../7-Zip%20File%20Manager/tmp/' + f_rand +'/&target=../../' + f_destdir + f_rand + "/");
+				
+				console.log('../SystemAOB/functions/file_system/rename.php?file=../../' + f_destdir + f_rand + '&newFileName=../../' + f_destdir + f_file.replace(/^.*[\\\/]/, '').replace(/\./,"") + '/&hex=false');
+				
+				$.get( '../SystemAOB/functions/file_system/copy_folder.php?from=../../../7-Zip%20File%20Manager/tmp/' + f_rand +'/&target=../../' + f_destdir + f_rand + "/", function(data) {
+					if(data !== "DONE"){
+						msgbox(data,"","");
+						if(ao_module_virtualDesktop){
+							parent.msgbox(data,"","");
+							ao_module_close();
+						}else{
+							msgbox(data,"","");
+							setTimeout(function(){ts('#modal').modal('hide')},1500);
+						}
+					}
+					
+					$.get( '../SystemAOB/functions/file_system/rename.php?file=../../' + f_destdir + f_rand + '&newFileName=../../' + f_destdir + f_file.replace(/^.*[\\\/]/, '').replace(/\./,"") + '/&hex=false', function(data) {
+						if(data !== "DONE"){
+							$.get( '../SystemAOB/functions/file_system/delete.php?filename=../../' + f_destdir + f_rand, function(data) {
+							});
+							if(ao_module_virtualDesktop){
+								parent.msgbox(data,"","");
+								ao_module_close();
+							}else{
+								msgbox(data,"","");
+								setTimeout(function(){ts('#modal').modal('hide')},1500);
+							}
+						}else{
+							f_openFile(true);
+						}
+					});
+				});
+				*/
 			}else{
 				f_openFile(false);
 			}

+ 10 - 10
7-Zip File Manager/getMessage.php

@@ -1,11 +1,11 @@
-<?php
-include_once("../auth.php");
-if (isset($_GET['id'])){
-	if (file_exists("tmp/" . $_GET['id'])){
-		echo file_get_contents("tmp/" . $_GET['id']);
-		exit(0);
-	}
-}else{
-	die("ERROR. unset id value for lookup.");
-}
+<?php
+include_once("../auth.php");
+if (isset($_GET['id'])){
+	if (file_exists("tmp/" . $_GET['id'])){
+		echo file_get_contents("tmp/" . $_GET['id']);
+		exit(0);
+	}
+}else{
+	die("ERROR. unset id value for lookup.");
+}
 ?>

BIN
7-Zip File Manager/install/template/background.png


+ 63 - 0
7-Zip File Manager/install/template/template.php

@@ -0,0 +1,63 @@
+<html>
+<head>
+	<link rel="stylesheet" href="../../../script/tocas/tocas.css">
+	<script src="../../../script/tocas/tocas.js"></script>
+	<script src="../../../script/jquery.min.js"></script>
+	<script src="../../../script/ao_module.js"></script>
+	<style>
+	body {
+		overflow-y:hidden;
+	}
+	.header{
+		position: absolute;
+		font-size: 20px;
+		top: 30%;
+		left: 5%;
+	}
+	.subheader{
+		position: absolute;
+		top: 50%;
+		left: 5%;
+	}
+	</style>
+</head>
+<body>
+	<div class="ts grid">
+		<div class="sixteen wide column" style="height:16%;overflow:hidden">
+			<img src="background.png" style="height:auto;width:100%">
+			<div class="header">7-Zip File Manager</div>
+			<div class="subheader">Powered by ArOZ</div>
+		</div>
+		<div class="sixteen wide column" style="height:60%;overflow:hidden">
+			<div style="width:90%;left:5%">
+				<table class="ts sortable large table">
+					<thead>
+						<tr>
+							<th>Item</th>
+							<th>Value</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr>
+							<td>Package name</td>
+							<td>7-Zip File Manager</td>
+						</tr>
+					</tbody>
+				</table>
+			</div>
+		</div>
+		</div>
+		<div id="menubar" style="overflow:hidden;position: absolute;bottom: 3%;width:100%">
+			<div class="ts section divider"></div>
+			<div class="ts separated buttons" style="float: right;right:5%">
+				<button class="ts positive basic button">Next</button>
+				<button class="ts negative basic button">Cancel</button>
+			</div>
+		</div>
+</body>
+<script>
+if(ao_module_virtualDesktop){
+	$("#menubar").css("bottom","8%");
+}
+</script>
+</html>

+ 0 - 1
7-Zip File Manager/opr.php

@@ -12,7 +12,6 @@ include '../auth.php';
 |-----------------------------|
 Yes ! This is an 7Zip logo
 */
-
 $rand = $_GET["rand"];
 
 if(!isset($_GET["method"])){