yeungalan 6 år sedan
förälder
incheckning
910c2d9a21

+ 110 - 110
7-Zip File Manager/CopyNMoveUI.php

@@ -1,111 +1,111 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="UTF-8">
-	<script src="../script/jquery.min.js"></script>
-	<!-- <script src="../script/jquery-ui.min.js"></script> -->
-    <link rel="stylesheet" href="../script/tocas/tocas.css">
-	<script type='text/javascript' src="../script/tocas/tocas.js"></script>
-	<script type='text/javascript' src="../script/ao_module.js"></script>
-	<title>7z File Manager</title>
-	<style>
-	body{
-		background-color:white
-	}
-	.ts.form .inline.field label {
-		min-width: 50%;
-	}
-	.ts.basic.dropdown, .ts.form select {
-		max-width: 50%;
-	}
-	</style>
-</head>
-<body>
-	<div class="ts container">
-		<div class="ts grid">
-			<div class="sixteen wide column">
-			<br>
-				<div class="ts form">
-
-					<div class="field">
-						<label>Copy to:</label>
-						<div class="ts labeled input" style="width:100%">
-							<div class="ts label">
-								/AOR/
-							</div>
-							<input type="text" id="path" placeholder="Path here">
-						</div>
-					</div>
-				</div>
-			</div>
-			
-			<div class="sixteen wide column">
-				<p id="filesshow">
-				Extract to: 
-				</p>
-			</div>
-
-			<div class="eight wide column"></div>
-			<div class="eight wide column">
-				<button class="ts basic button" style="width:45%" onclick="f_ok()">OK</button>
-				&nbsp;&nbsp;&nbsp;&nbsp;
-				<button class="ts basic button" style="width:45%" onclick="f_close()">Cancel</button>
-			</div>
-		</div>
-	</div>
-</body>
-<script>
-var f_method = "<?php echo $_GET["method"] ?>";
-var f_rand = "<?php echo $_GET["rand"] ?>";
-var f_file = "<?php echo $_GET["file"] ?>";
-var f_dir = "<?php echo $_GET["dir"] ?>";
-var f_extractTo = "";
-
-function f_close(){
-	if(ao_module_virtualDesktop){
-		ao_module_close();
-	}else{
-		ts('#modal').modal('hide');
-	}		
-}
-
-function f_ok(){
-	var href = "ProgressUI.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir + "&destdir=" + f_extractTo;
-
-	if(ao_module_virtualDesktop){
-		ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI');
-	}else{
-		$.get( href, function( data ) {
-			$( "#modaldata" ).html( data );
-			ts('#modal').modal("show");
-		});
-	}
-}
-
-$( "#path" ).keyup(function() {
-	var path = $("#path").val();
-	var displayPath = "";
-	if(f_dir == ""){
-		displayPath = "*";
-	}else{
-		displayPath = f_dir;
-	}
-	if(path.slice(-1) !== "/"){
-		path = path + "/";
-	}
-	$("#filesshow").text("Extract to: /AOR/" + path + displayPath);
-	f_extractTo = "../" + path;
-});
-
-/* still in implmention
-$( "#path" ).keypress(function() {
-	$.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
-	   $( "#path" ).autocomplete({
-		source: JSON.parse(data)
-		});
-	});
-});
-*/
-
-</script>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+	<script src="../script/jquery.min.js"></script>
+	<!-- <script src="../script/jquery-ui.min.js"></script> -->
+    <link rel="stylesheet" href="../script/tocas/tocas.css">
+	<script type='text/javascript' src="../script/tocas/tocas.js"></script>
+	<script type='text/javascript' src="../script/ao_module.js"></script>
+	<title>7z File Manager</title>
+	<style>
+	body{
+		background-color:white
+	}
+	.ts.form .inline.field label {
+		min-width: 50%;
+	}
+	.ts.basic.dropdown, .ts.form select {
+		max-width: 50%;
+	}
+	</style>
+</head>
+<body>
+	<div class="ts container">
+		<div class="ts grid">
+			<div class="sixteen wide column">
+			<br>
+				<div class="ts form">
+
+					<div class="field">
+						<label>Copy to:</label>
+						<div class="ts labeled input" style="width:100%">
+							<div class="ts label">
+								/AOR/
+							</div>
+							<input type="text" id="path" placeholder="Path here">
+						</div>
+					</div>
+				</div>
+			</div>
+			
+			<div class="sixteen wide column">
+				<p id="filesshow">
+				Extract to: 
+				</p>
+			</div>
+
+			<div class="eight wide column"></div>
+			<div class="eight wide column">
+				<button class="ts basic button" style="width:45%" onclick="f_ok()">OK</button>
+				    
+				<button class="ts basic button" style="width:45%" onclick="f_close()">Cancel</button>
+			</div>
+		</div>
+	</div>
+</body>
+<script>
+var f_method = "<?php echo $_GET["method"] ?>";
+var f_rand = "<?php echo $_GET["rand"] ?>";
+var f_file = "<?php echo $_GET["file"] ?>";
+var f_dir = "<?php echo $_GET["dir"] ?>";
+var f_extractTo = "";
+
+function f_close(){
+	if(ao_module_virtualDesktop){
+		ao_module_close();
+	}else{
+		ts('#modal').modal('hide');
+	}		
+}
+
+function f_ok(){
+	var href = "ProgressUI.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir + "&destdir=" + f_extractTo;
+
+	if(ao_module_virtualDesktop){
+		ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI' + Math.floor(Math.random()*100),720,250);
+	}else{
+		$.get( href, function( data ) {
+			$( "#modaldata" ).html( data );
+			ts('#modal').modal("show");
+		});
+	}
+}
+
+$( "#path" ).keyup(function() {
+	var path = $("#path").val();
+	var displayPath = "";
+	if(f_dir == ""){
+		displayPath = "*";
+	}else{
+		displayPath = f_dir;
+	}
+	if(path.slice(-1) !== "/"){
+		path = path + "/";
+	}
+	$("#filesshow").text("Extract to: /AOR/" + path + displayPath);
+	f_extractTo = "../" + path;
+});
+
+/* still in implmention
+$( "#path" ).keypress(function() {
+	$.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
+	   $( "#path" ).autocomplete({
+		source: JSON.parse(data)
+		});
+	});
+});
+*/
+
+</script>
 </html>

+ 278 - 194
7-Zip File Manager/MainUI.php

@@ -1,195 +1,279 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="UTF-8">
-	<script src="../script/jquery.min.js"></script>
-    <link rel="stylesheet" href="../script/tocas/tocas.css">
-	<script type='text/javascript' src="../script/tocas/tocas.js"></script>
-	<script type='text/javascript' src="../script/ao_module.js"></script>
-	<title>7z File Manager</title>
-	<style>
-	body{
-		background-color:white;
-		-webkit-user-select: none; /* Safari */        
-		-moz-user-select: none; /* Firefox */
-		-ms-user-select: none; /* IE10+/Edge */
-		user-select: none; /* Standard */
-	}
-	tr:hover { 
-		background-color: #fafafa;
-	}
-	@media (max-width: 767px){
-		.ts.bottom.right.snackbar.active{
-			width: 100% !important;
-			bottom: 0px !important;
-			right: 0px !important;
-		}
-		.ts.snackbar:not(.inline) .content {
-		    margin-bottom: 7px;
-		}
-	}
-	</style>
-</head>
-<body>
-<div class="ts labeled icon menu" style="box-shadow: 0px 0px 0px 0 #000000 !important;">
-    <a class="item" onclick="msgbox('Error: Operation is not supported','red','white')">
-        <i class="plus icon"></i> Add
-    </a>
-    <a class="item" onclick="functionbar_extract();">
-        <i class="minus icon"></i> Extract
-    </a>
-    <a class="item" onclick="msgbox('Warning: Not implemented','yellow','Black')">
-        <i class="chevron down icon"></i> Test
-    </a>
-    <a class="item" onclick="functionbar_extract();">
-        <i class="copy icon"></i> Copy
-    </a>
-	<a class="item" onclick="functionbar_extract();">
-        <i class="move icon"></i> Move
-    </a>
-	<a class="item"  onclick="msgbox('Error: Operation is not supported','red','white')">
-        <i class="remove icon"></i> Delete
-    </a>
-	<a class="item" onclick="functionbar_info();">
-        <i class="notice icon"></i> Info
-    </a>
-</div>
-<div class="ts breadcrumb" style="left: 20px;" id="breadcrumb">
-	<button class="ts icon mini basic button" path="" attr="Dir" id="returnBtn" onclick="load(this)">
-		<i class="level up icon"></i>
-	</button>
-		<p href="#!" class="section"><?php echo $_GET["file"] ?></p>
-</div>
-<table class="ts borderless table">
-    <thead>
-        <tr id="thead">
-        </tr>
-    </thead>
-    <tbody id="tbody">
-    </tbody>
-</table>
-
-<!-- use for displaying dialog , for VDI user , use VDI module instead -->
-<div class="ts modals dimmer">
-    <dialog id="modal" class="ts basic modal" style="background-color: white;color: black!important" open>
-        <div class="content" id="modaldata">
-        </div>
-    </dialog>
-</div>
-
-<div class="ts bottom right snackbar">
-    <div class="content"></div>
-</div>
-</body>
-<script>
-//Global variable
-var random = Math.floor((Math.random() * 10000) + 1000);
-var file = "<?php echo $_GET["file"] ?>";
-
-//for load data into table
-load($(returnBtn));
-
-function onsingleclick(htmlelement){
-	$("tr").removeAttr("style");
-	$(htmlelement).attr("style","background-color: #e9e9e9;");
-}
-
-function load(htmlelement){
-	if($(htmlelement).attr("attr") == "Dir"){
-		$("#breadcrumb").html('<button class="ts icon mini basic button" disabled><i class="level up icon"></i></button>&nbsp;<p class="section"><i class="loading circle notched icon"></i>Fetching..</p>');
-		//for load data into table
-		$.get("opr.php?method=l&rand=" + random + "&file=" + file + "&dir=" + $(htmlelement).attr("path"), function( raw ) {
-			//clear table for pepare load data into table
-			$("#thead").html("");
-			$("#tbody").html("");
-			var data = JSON.parse(raw); //parse it
-			var header = data["Header"]; 
-			//create thead
-			$(data["Header"]).each(function( key, value ) {
-			  $("#thead").append("<th>" + value + "</th>");//create header (thead) first
-			});
-			//create tbody
-			$(data["Information"]).each(function( a, value ) {
-				//to check if attr not exists, if not exists, assume it is an file.
-				if(typeof value["Attributes"] === 'undefined'){
-					var attr = "File";
-				}else{
-					if(value["Attributes"].includes("D")){
-						var attr = "Dir";
-					}else{
-						var attr = "File";
-					}
-				}
-				//create HTML structure
-				var tmp = "";
-				tmp = tmp + '<tr path="' + value["Path"] + '" attr="' + attr + '" ondblclick="load(this)" onclick="onsingleclick(this)">'
-				$.each(data["Header"], function( a, key ) {
-					if(typeof value[key] !== 'undefined'){
-						tmp = tmp + "<td>" + value[key].replace(new RegExp($(htmlelement).attr("path") + "/"),"") + "</td>";
-					}else{
-						tmp = tmp + "<td></td>";
-					}
-				});
-				$("#tbody").append(tmp + "</tr>");
-			});
-			
-			//process for Prev button 
-			var path = $(htmlelement).attr("path").split("/");
-			var previousPath = $(htmlelement).attr("path").replace(/([^\/]+)$/, '').slice(0, -1);
-			if(previousPath == $(htmlelement).attr("path")){
-				previousPath = "";
-			}
-			console.log(previousPath);
-			$("#breadcrumb").html('<button class="ts icon mini basic button" currPath="' + $(htmlelement).attr("path") + '" path="' + previousPath + '" attr="Dir" id="returnBtn" onclick="load(this)"><i class="level up icon"></i></button>&nbsp;<p href="#!" class="section">' + file +'</p><div class="divider">/</div>');
-			if($(htmlelement).attr("path").length > 1){
-				$.each(path, function( a, key ) {
-					$("#breadcrumb").append('<p href="#!" class="section"><i class="folder icon"></i>' + key + '</p><div class="divider">/</div>');
-				});
-			}
-		});
-	}else{
-		//if it was file, show it.
-		showDialog("ProgressUI.php?method=e&rand=" + random + "&file=" + file + "&dir=" + $(htmlelement).attr("path"));
-		random = Math.floor((Math.random() * 10000) + 1000);
-	}
-}
-
-function functionbar_extract(){
-	//extract files or dir , if file then pass method=e , if dir then pass method=x
-	if($("[style='background-color: #e9e9e9;']").attr("attr") == "Dir"){
-		showDialog("CopyNMoveUI.php?method=x&rand=" + random + "&file=" + file + "&dir=" + $($("[style='background-color: #e9e9e9;']")).attr("path"));
-	}else if($("[style='background-color: #e9e9e9;']").attr("attr") == "File"){
-		showDialog("CopyNMoveUI.php?method=e&rand=" + random + "&file=" + file + "&dir=" + $("[style='background-color: #e9e9e9;']").attr("path"));
-	}else{
-		showDialog("CopyNMoveUI.php?method=x&rand=" + random + "&file=" + file + "&dir=" + $("#returnBtn").attr("currPath"));
-	}
-	//generate new number for next extraction
-	random = Math.floor((Math.random() * 10000) + 1000);
-}
-
-function functionbar_info(){
-	showDialog("infoUI.php?file=" + file);
-}
-
-function showDialog(href){
-	if(ao_module_virtualDesktop){
-		ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI');
-	}else{
-		$.get( href, function( data ) {
-			$( "#modaldata" ).html( data );
-			ts('#modal').modal("show");
-		});
-	}
-}
-
-function msgbox(content,bgcolor,fontcolor){
-	$(".snackbar").attr("style",'background-color: ' + bgcolor + ';color:' + fontcolor);
-	ts('.snackbar').snackbar({
-		content: content,
-		onAction: () => {
-			$(".snackbar").removeAttr("style");
-		}
-	});
-}
-</script>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+	<script src="../script/jquery.min.js"></script>
+    <link rel="stylesheet" href="../script/tocas/tocas.css">
+	<script type='text/javascript' src="../script/tocas/tocas.js"></script>
+	<script type='text/javascript' src="../script/ao_module.js"></script>
+	<title>7z File Manager</title>
+	<style>
+	body{
+		background-color:white;
+		-webkit-user-select: none; /* Safari */        
+		-moz-user-select: none; /* Firefox */
+		-ms-user-select: none; /* IE10+/Edge */
+		user-select: none; /* Standard */
+	}
+	tr:hover { 
+		background-color: #fafafa;
+	}
+	@media (max-width: 767px){
+		.ts.bottom.right.snackbar.active{
+			width: 100% !important;
+			bottom: 0px !important;
+			right: 0px !important;
+		}
+		.ts.snackbar:not(.inline) .content {
+		    margin-bottom: 7px;
+		}
+	}
+	</style>
+</head>
+<body>
+<div class="ts labeled icon menu" style="box-shadow: 0px 0px 0px 0 #000000 !important;">
+    <a class="item" onclick="msgbox('Error: Operation is not supported','red','white')">
+        <i class="plus icon"></i> Add
+    </a>
+    <a class="item" onclick="functionbar_extract();">
+        <i class="minus icon"></i> Extract
+    </a>
+    <a class="item" onclick="msgbox('Warning: Not implemented','yellow','Black')">
+        <i class="chevron down icon"></i> Test
+    </a>
+    <a class="item" onclick="functionbar_extract();">
+        <i class="copy icon"></i> Copy
+    </a>
+	<a class="item" onclick="functionbar_extract();">
+        <i class="move icon"></i> Move
+    </a>
+	<a class="item"  onclick="msgbox('Error: Operation is not supported','red','white')">
+        <i class="remove icon"></i> Delete
+    </a>
+	<a class="item" onclick="functionbar_info();">
+        <i class="notice icon"></i> Info
+    </a>
+</div>
+<div class="ts breadcrumb" style="left: 20px;" id="breadcrumb">
+	<button class="ts icon mini basic button" path="" attr="Dir" id="returnBtn" onclick="load(this)">
+		<i class="level up icon"></i>
+	</button>
+		<p href="#!" class="section"><?php echo $_GET["file"] ?></p>
+</div>
+<table class="ts borderless table">
+    <thead>
+        <tr id="thead">
+        </tr>
+    </thead>
+    <tbody id="tbody">
+    </tbody>
+</table>
+
+<!-- use for displaying dialog , for VDI user , use VDI module instead -->
+<div class="ts modals dimmer">
+    <dialog id="modal" class="ts basic modal" style="background-color: white;color: black!important" open>
+        <div class="content" id="modaldata">
+        </div>
+    </dialog>
+</div>
+
+<div class="ts bottom right snackbar">
+    <div class="content"></div>
+</div>
+<div class="ts contextmenu">
+    <div class="item" onclick="contextmenu_extract()">
+        Open
+		<span class="description">Enter</span>
+    </div>
+    <div class="item" onclick="functionbar_extract()">
+        Extract
+        <span class="description">F5</span>
+    </div>
+    <div class="item"  onclick="functionbar_info()">
+        Properties
+        <span class="description">Alt-Enter</span>
+    </div>
+</div>
+
+</body>
+<script>
+//Global variable
+var random = Math.floor((Math.random() * 10000) + 1000);
+var file = "<?php echo $_GET["file"] ?>";
+
+ts('*').contextmenu({
+    menu: '.ts.contextmenu'
+});
+
+$('body').on('click', function(e) {
+  if (e.target !== this)
+    return;
+  $("tr").removeAttr("style");
+});
+document.onkeydown = function(e) {
+    if($("[style='background-color: #e9e9e9;']").length > 0){
+        var htmlelement = $("[style='background-color: #e9e9e9;']");
+    }else{
+        var htmlelement = $("#tbody tr:first");
+    }
+    switch (e.keyCode) {
+        case 9:
+            if(htmlelement.prev().length > 0){
+                var next = htmlelement.prev();
+    	    	$("tr").removeAttr("style");
+    		    $(next).attr("style","background-color: #e9e9e9;");
+            }
+        case 13:
+            var htmlelement = $("[style='background-color: #e9e9e9;']");
+            load(htmlelement);
+            break;
+        case 38:
+            if(htmlelement.prev().length > 0){
+                var next = htmlelement.prev();
+    	    	$("tr").removeAttr("style");
+    		    $(next).attr("style","background-color: #e9e9e9;");
+            }else{
+            	$("tr").removeAttr("style");
+                $(htmlelement).attr("style","background-color: #e9e9e9;");
+            }
+            break;
+        case 40:
+            if(htmlelement.next().length > 0){
+    	    	var next = htmlelement.next();
+    	    	$("tr").removeAttr("style");
+    		    $(next).attr("style","background-color: #e9e9e9;");
+            }else{
+            	$("tr").removeAttr("style");
+                $(htmlelement).attr("style","background-color: #e9e9e9;");
+            }
+            break;
+    }
+};
+
+
+//for load data into table
+load($(returnBtn));
+
+function onsingleclick(htmlelement){
+	$("tr").removeAttr("style");
+	$(htmlelement).attr("style","background-color: #e9e9e9;");
+}
+
+function load(htmlelement){
+	if($(htmlelement).attr("attr") == "Dir"){
+		$("#breadcrumb").html('<button class="ts icon mini basic button" disabled><i class="level up icon"></i></button> <p class="section"><i class="loading circle notched icon"></i>Fetching..</p>');
+		//for load data into table
+		$.get("opr.php?method=l&rand=" + random + "&file=" + file + "&dir=" + $(htmlelement).attr("path"), function( raw ) {
+			//clear table for pepare load data into table
+			$("#thead").html("");
+			$("#tbody").html("");
+			var data = JSON.parse(raw); //parse it
+			var header = data["Header"]; 
+			//create thead
+			$(data["Header"]).each(function( key, value ) {
+			  $("#thead").append("<th>" + value + "</th>");//create header (thead) first
+			});
+			//create tbody
+			$(data["Information"]).each(function( a, value ) {
+				//to check if attr not exists. if not exists, assume it is an file.
+				if(typeof value["Attributes"] === 'undefined'){
+					var attr = "File";
+				}else{
+					if(value["Attributes"].includes("D")){
+						var attr = "Dir";
+					}else{
+						var attr = "File";
+					}
+				}
+				//create HTML structure
+				var tmp = "";
+				tmp = tmp + '<tr path="' + value["Path"] + '" attr="' + attr + '" ondblclick="load(this)" onclick="onsingleclick(this)" oncontextmenu="onsingleclick(this)">'
+				$.each(data["Header"], function( a, key ) {
+					if(typeof value[key] !== 'undefined'){
+					    if(key == "Path"){
+					        //create fanastic icon to user
+					        if(attr == "Dir"){
+					            var tdicon = '<i class="folder outline icon"></i>';
+					        }else{
+					            var tdicon = '<i class="file outline icon"></i>';
+					        }
+					        var tdpath = value[key].replace(new RegExp($(htmlelement).attr("path") + "/"),"");
+					        if(tdpath.includes("?")){
+					            var tdicon = '<i class="exclamation triangle icon"></i>';
+					        }
+					        tmp = tmp + "<td>" + tdicon + tdpath + "</td>";
+					    }else{
+					        tmp = tmp + "<td>" + value[key] + "</td>";
+					    }
+					}else{
+						tmp = tmp + "<td></td>";
+					}
+				});
+				$("#tbody").append(tmp + "</tr>");
+			});
+			
+			//process for Prev button 
+			var path = $(htmlelement).attr("path").split("/");
+			var previousPath = $(htmlelement).attr("path").replace(/([^\/]+)$/, '').slice(0, -1);
+			if(previousPath == $(htmlelement).attr("path")){
+				previousPath = "";
+			}
+			console.log(previousPath);
+			$("#breadcrumb").html('<button class="ts icon mini basic button" currPath="' + $(htmlelement).attr("path") + '" path="' + previousPath + '" attr="Dir" id="returnBtn" onclick="load(this)"><i class="level up icon"></i></button> <p href="#!" class="section">' + file +'</p><div class="divider">/</div>');
+			if($(htmlelement).attr("path").length > 1){
+				$.each(path, function( a, key ) {
+					$("#breadcrumb").append('<p href="#!" class="section"><i class="folder icon"></i>' + key + '</p><div class="divider">/</div>');
+				});
+			}
+		});
+	}else{
+		//if it was file, show it.
+		showDialog("ProgressUI.php?method=e&rand=" + random + "&file=" + file + "&dir=" + $(htmlelement).attr("path"),720,250);
+		random = Math.floor((Math.random() * 10000) + 1000);
+	}
+}
+
+function contextmenu_extract(){
+	showDialog("ProgressUI.php?method=e&rand=" + random + "&file=" + file + "&dir=" + $("[style='background-color: #e9e9e9;']").attr("path"),720,250);
+	random = Math.floor((Math.random() * 10000) + 1000);
+}
+
+function functionbar_extract(){
+	//extract files or dir , if file then pass method=e , if dir then pass method=x
+	if($("[style='background-color: #e9e9e9;']").attr("attr") == "Dir"){
+		showDialog("CopyNMoveUI.php?method=x&rand=" + random + "&file=" + file + "&dir=" + $($("[style='background-color: #e9e9e9;']")).attr("path"),720,250);
+	}else if($("[style='background-color: #e9e9e9;']").attr("attr") == "File"){
+		showDialog("CopyNMoveUI.php?method=e&rand=" + random + "&file=" + file + "&dir=" + $("[style='background-color: #e9e9e9;']").attr("path"),720,250);
+	}else{
+		showDialog("CopyNMoveUI.php?method=x&rand=" + random + "&file=" + file + "&dir=" + $("#returnBtn").attr("currPath"),720,250);
+	}
+	//generate new number for next extraction
+	random = Math.floor((Math.random() * 10000) + 1000);
+}
+
+function functionbar_info(){
+	showDialog("infoUI.php?file=" + file,340,200);
+}
+
+function showDialog(href,x,y){
+	if(ao_module_virtualDesktop){
+		ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI' + Math.floor(Math.random()*100),x,y);
+	}else{
+		$.get( href, function( data ) {
+			$( "#modaldata" ).html( data );
+			ts('#modal').modal("show");
+		});
+	}
+}
+
+function msgbox(content,bgcolor,fontcolor){
+	$(".snackbar").attr("style",'background-color: ' + bgcolor + ';color:' + fontcolor);
+	ts('.snackbar').snackbar({
+		content: content,
+		onAction: () => {
+			$(".snackbar").removeAttr("style");
+		}
+	});
+}
+</script>
 </html>

+ 6 - 2
7-Zip File Manager/embedded.php

@@ -1,3 +1,7 @@
-<?php
-header('Location: MainUI.php?file='.$_GET["filepath"]);
+<?php
+if(isset($_GET["filepath"])){
+    header('Location: MainUI.php?file='.$_GET["filepath"]);
+}else{
+    header('Location: index.php');
+}
 ?>

+ 142 - 140
7-Zip File Manager/index.php

@@ -1,141 +1,143 @@
-
-<!--
-2018/1/21 Aroz Mirror Edit Project
-
-
--->
-<html>
-<head>
-<title>ArOZ 7z</title>
-<meta charset="UTF-8">
-<link rel="stylesheet" href="../script/tocas/tocas.css">
-<script src="../script/tocas/tocas.js"></script>
-<script src="../script/jquery.min.js"></script>
-</head>
-<body>
-<br><br><br><br><br>
-<div class="ts text container">
-<div id="maindiv" class="ts segment">
-	<div id="first" class="ts top attached tabbed menu">
-		<a class="active item" data-tab="Premission">Premission</a>
-		<a class="item" data-tab="License">License</a>
-	</div>
-	<div data-tab="Premission" class="ts active bottom attached tab segment">
-		<h4><i class="caution sign icon"></i>ArOZ Module Warning</h4>
-		<h6>Module Directory: 7-Zip File Manager</h6>
-		<p>This function might need Serval permission.
-		<br>If you proceed to the module, it means you have agreed to give the module the following permissions:</p>
-		<div class="ts secondary segment">
-			<p><i class="checkmark icon"></i>Read data into ArOZ Directory</p>
-			<p><i class="checkmark icon"></i>Write data into ArOZ Directory</p>
-			<p><i class="checkmark icon"></i>Create File Assoications</p>
-			<p><i class="checkmark icon"></i>Execute shell script on server</p>
-		</div>
-		<p>ArOZ Online BETA System cannot ensure your data is secured during the connection.
-		<br>Please use this module with your own risk.
-		</p>
-	</div>
-	<div data-tab="License" class="ts bottom attached tab segment">
-		<h4>Module License</h4>
-		<div class="ts horizontal form">
-			<div class="field" style="padding-left: 0 !important">
-				<textarea rows="19">  7-Zip
-  ~~~~~
-  License for use and distribution
-  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-  7-Zip Copyright (C) 1999-2018 Igor Pavlov.
-
-  The licenses for files are:
-
-    1) 7z.dll:
-         - The "GNU LGPL" as main license for most of the code
-         - The "GNU LGPL" with "unRAR license restriction" for some code
-         - The "BSD 3-clause License" for some code
-    2) All other files: the "GNU LGPL".
-
-  Redistributions in binary form must reproduce related license information from this file.
-
-  Note:
-    You can use 7-Zip on any computer, including a computer in a commercial
-    organization. You don't need to register or pay for 7-Zip.
-
-
-  GNU LGPL information
-  --------------------
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You can receive a copy of the GNU Lesser General Public License from
-    http://www.gnu.org/
-
-
-
-
-  BSD 3-clause License
-  --------------------
-
-    The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression.
-    That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
-    that also uses the "BSD 3-clause License":
-
-    ----
-    Copyright (c) 2015-2016, Apple Inc. All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-    1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-    2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
-        in the documentation and/or other materials provided with the distribution.
-
-    3.  Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
-        from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-    ----
-
-
-
-
-  unRAR license restriction
-  -------------------------
-
-    The decompression engine for RAR archives was developed using source
-    code of unRAR program.
-    All copyrights to original unRAR code are owned by Alexander Roshal.
-
-    The license for original unRAR code has the following restriction:
-
-      The unRAR sources cannot be used to re-create the RAR compression algorithm,
-      which is proprietary. Distribution of modified unRAR sources in separate form
-      or as a part of other software is permitted, provided that it is clearly
-      stated in the documentation and source comments that the code may
-      not be used to develop a RAR (WinRAR) compatible archiver.
-
-
-  --
-  Igor Pavlov</textarea>
-			</div>
-		</div>
-	</div>
-</div>
-</div>
-</body>
-<script>
-ts('.tabbed.menu .item').tab();
-</script>
+<!--
+2019 AroZ 7-Zip
+-->
+<?php
+if(isset($_GET["filepath"])){
+    header('Location: MainUI.php?file='.$_GET["filepath"]);
+}
+?>
+<html>
+<head>
+<title>ArOZ 7z</title>
+<meta charset="UTF-8">
+<link rel="stylesheet" href="../script/tocas/tocas.css">
+<script src="../script/tocas/tocas.js"></script>
+<script src="../script/jquery.min.js"></script>
+</head>
+<body>
+<br><br><br><br><br>
+<div class="ts text container">
+<div id="maindiv" class="ts segment">
+	<div id="first" class="ts top attached tabbed menu">
+		<a class="active item" data-tab="Premission">Premission</a>
+		<a class="item" data-tab="License">License</a>
+	</div>
+	<div data-tab="Premission" class="ts active bottom attached tab segment">
+		<h4><i class="caution sign icon"></i>ArOZ Module Warning</h4>
+		<h6>Module Directory: 7-Zip File Manager</h6>
+		<p>This function might need Serval permission.
+		<br>If you proceed to the module, it means you have agreed to give the module the following permissions:</p>
+		<div class="ts secondary segment">
+			<p><i class="checkmark icon"></i>Read data into ArOZ Directory</p>
+			<p><i class="checkmark icon"></i>Write data into ArOZ Directory</p>
+			<p><i class="checkmark icon"></i>Create File Assoications</p>
+			<p><i class="checkmark icon"></i>Execute shell script on server</p>
+		</div>
+		<p>ArOZ Online BETA System cannot ensure your data is secured during the connection.
+		<br>Please use this module with your own risk.
+		</p>
+	</div>
+	<div data-tab="License" class="ts bottom attached tab segment">
+		<h4>Module License</h4>
+		<div class="ts horizontal form">
+			<div class="field" style="padding-left: 0 !important">
+				<textarea rows="19">  7-Zip
+  ~~~~~
+  License for use and distribution
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+  7-Zip Copyright (C) 1999-2018 Igor Pavlov.
+
+  The licenses for files are:
+
+    1) 7z.dll:
+         - The "GNU LGPL" as main license for most of the code
+         - The "GNU LGPL" with "unRAR license restriction" for some code
+         - The "BSD 3-clause License" for some code
+    2) All other files: the "GNU LGPL".
+
+  Redistributions in binary form must reproduce related license information from this file.
+
+  Note:
+    You can use 7-Zip on any computer, including a computer in a commercial
+    organization. You don't need to register or pay for 7-Zip.
+
+
+  GNU LGPL information
+  --------------------
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You can receive a copy of the GNU Lesser General Public License from
+    http://www.gnu.org/
+
+
+
+
+  BSD 3-clause License
+  --------------------
+
+    The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression.
+    That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
+    that also uses the "BSD 3-clause License":
+
+    ----
+    Copyright (c) 2015-2016, Apple Inc. All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    1.  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+    2.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
+        in the documentation and/or other materials provided with the distribution.
+
+    3.  Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
+        from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+    ----
+
+
+
+
+  unRAR license restriction
+  -------------------------
+
+    The decompression engine for RAR archives was developed using source
+    code of unRAR program.
+    All copyrights to original unRAR code are owned by Alexander Roshal.
+
+    The license for original unRAR code has the following restriction:
+
+      The unRAR sources cannot be used to re-create the RAR compression algorithm,
+      which is proprietary. Distribution of modified unRAR sources in separate form
+      or as a part of other software is permitted, provided that it is clearly
+      stated in the documentation and source comments that the code may
+      not be used to develop a RAR (WinRAR) compatible archiver.
+
+
+  --
+  Igor Pavlov</textarea>
+			</div>
+		</div>
+	</div>
+</div>
+</div>
+</body>
+<script>
+ts('.tabbed.menu .item').tab();
+</script>
 </html>

+ 93 - 100
7-Zip File Manager/opr.php

@@ -1,100 +1,93 @@
-<?php
-/*
-|-----------------------------|
-| 77777     ZZZZZ IIIII PPPPP |
-|     7         Z   I   P   P |
-|    7    -    Z    I   PPPP  |
-|   7         Z     I   P     |
-|  7        ZZZZZ IIIII P     |
-|-----------------------------|
-Yes ! This is an 7Zip logo
-*/
-$rand = $_GET["rand"];
-
-if(!isset($_GET["method"])){
-	die('["Method Error"]');
-}
-/*
-if(!isset($_GET["rand"])){
-	die('["Rand Error"]');
-}
-if(!isset($_GET["file"])){
-	die('["File Error"]');
-}
-*/
-
-if(strpos(exec('uname -m'), 'arm') !== false){
-	$executions = "7za";
-}else{
-	$executions = "7za_x64";
-}
-
-if($_GET["method"] == "ListAORDir"){
-	$result = [];
-	$dir = $_GET["dir"] !== "" ?  "../".$_GET["dir"]."/" : "../";
-	$data = scandir($dir,1);
-	array_pop($data); // this two use for remove .. and .
-	array_pop($data);
-	foreach($data as $value){
-		if(is_dir($dir.$value)){
-			array_push($result,$value);
-		}
-	}
-	echo json_encode($result);
-	
-}else if($_GET["method"] == "l"){
-	$filesnumber = -1;
-	$FileInformation = [];
-	$SevenZHeader = [];
-	exec('sudo ./7za l "'.$_GET["file"].'" -ba -slt',$output);
-	if($_GET["dir"] !== ""){
-		$dir = $_GET["dir"];
-	}else{
-		$dir = ".";
-	}
-	
-		//* Special designed handler for ZIP (use for show folder)
-		if(pathinfo($_GET["file"])['extension'] == "zip"){
-			for($i = 0;$i < sizeOf($output);$i++){
-				preg_match_all('/(.*[^=]) = (.*)/', $output[$i], $tmp);
-				if($tmp[1][0] == "Path" && pathinfo($tmp[2][0])["dirname"] !== "."){
-					if(!in_array("Path = ".pathinfo($tmp[2][0])["dirname"],$output)){
-						array_push($output,"Path = ".pathinfo($tmp[2][0])["dirname"]);
-						array_push($output,"Attributes = D");
-						array_push($output,"");
-					}
-				}
-				
-			}
-		}
-
-	//print_r($output);
-	for($i = 0;$i < sizeOf($output);$i++){
-		preg_match_all('/(.*[^=]) = (.*)/', $output[$i], $tmp);
-		if($tmp[1][0] == "Path"){
-			$currDir = pathinfo($tmp[2][0])["dirname"];
-			if($currDir == $dir){
-				$filesnumber += 1;
-			}
-		}
-		if($tmp[1][0] !== NULL && $currDir == $dir){
-			$FileInformation[$filesnumber][$tmp[1][0]] = $tmp[2][0];
-			if(!in_array($tmp[1][0],$SevenZHeader)){
-				array_push($SevenZHeader,$tmp[1][0]);
-			}
-		}
-	}
-	
-	echo json_encode(array("Header" => $SevenZHeader,"Information" => $FileInformation));
-
-}else if($_GET["method"] == "e"){
-	$rand = $_GET["rand"];
-	mkdir('tmp/'.$rand,0777);
-	system('./'.$executions.' e -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
-	echo json_encode(array("Extract finished. e"));
-}else if($_GET["method"] == "x"){
-	$rand = $_GET["rand"];
-	mkdir('tmp/'.$rand,0777);
-	system('./'.$executions.' x -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
-	echo json_encode(array("Extract finished. x"));
-}
+<?php
+/*
+|-----------------------------|
+| 77777     ZZZZZ IIIII PPPPP |
+|     7         Z   I   P   P |
+|    7    -    Z    I   PPPP  |
+|   7         Z     I   P     |
+|  7        ZZZZZ IIIII P     |
+|-----------------------------|
+Yes ! This is an 7Zip logo
+*/
+$rand = $_GET["rand"];
+
+if(!isset($_GET["method"])){
+	die('["Method Error"]');
+}
+/*
+if(!isset($_GET["rand"])){
+	die('["Rand Error"]');
+}
+if(!isset($_GET["file"])){
+	die('["File Error"]');
+}
+*/
+if($_GET["method"] == "ListAORDir"){
+	$result = [];
+	$dir = $_GET["dir"] !== "" ?  "../".$_GET["dir"]."/" : "../";
+	$data = scandir($dir,1);
+	array_pop($data); // this two use for remove .. and .
+	array_pop($data);
+	foreach($data as $value){
+		if(is_dir($dir.$value)){
+			array_push($result,$value);
+		}
+	}
+	echo json_encode($result);
+	
+}else if($_GET["method"] == "l"){
+	$filesnumber = -1;
+	$FileInformation = [];
+	$SevenZHeader = [];
+	exec('sudo ./7za l "'.$_GET["file"].'" -ba -slt',$output);
+	if($_GET["dir"] !== ""){
+		$dir = $_GET["dir"];
+	}else{
+		$dir = ".";
+	}
+	
+		//* Special designed handler for ZIP (use for show folder)
+		if(pathinfo($_GET["file"])['extension'] == "zip"){
+			for($i = 0;$i < sizeOf($output);$i++){
+				preg_match_all('/(.*[^=]) = (.*)/', $output[$i], $tmp);
+				if($tmp[1][0] == "Path" && pathinfo($tmp[2][0])["dirname"] !== "."){
+					if(!in_array("Path = ".pathinfo($tmp[2][0])["dirname"],$output)){
+						array_push($output,"Path = ".pathinfo($tmp[2][0])["dirname"]);
+						array_push($output,"Attributes = D");
+						array_push($output,"");
+					}
+				}
+				
+			}
+		}
+
+	//print_r($output);
+	for($i = 0;$i < sizeOf($output);$i++){
+		preg_match_all('/(.*[^=]) = (.*)/', $output[$i], $tmp);
+		if($tmp[1][0] == "Path"){
+			$currDir = pathinfo($tmp[2][0])["dirname"];
+			if($currDir == $dir){
+				$filesnumber += 1;
+			}
+		}
+		if($tmp[1][0] !== NULL && $currDir == $dir){
+			$FileInformation[$filesnumber][$tmp[1][0]] = $tmp[2][0];
+			if(!in_array($tmp[1][0],$SevenZHeader)){
+				array_push($SevenZHeader,$tmp[1][0]);
+			}
+		}
+	}
+	
+	echo json_encode(array("Header" => $SevenZHeader,"Information" => $FileInformation));
+
+}else if($_GET["method"] == "e"){
+	$rand = $_GET["rand"];
+	mkdir('tmp/'.$rand,0777);
+	system('./7za e -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
+	echo json_encode(array("Extract finished. e"));
+}else if($_GET["method"] == "x"){
+	$rand = $_GET["rand"];
+	mkdir('tmp/'.$rand,0777);
+	system('./7za x -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
+	echo json_encode(array("Extract finished. x"));
+}