Forráskód Böngészése

Init upload

Init upload
yeungalan 6 éve
szülő
commit
39151a6741

BIN
7-Zip File Manager/7za


+ 112 - 0
7-Zip File Manager/AddUI.php

@@ -0,0 +1,112 @@
+<!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>
+	<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>Archive: %path%</label>
+						<input type="text">
+					</div>
+				</div>
+			</div>
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Archive format:</label>
+						  <select name="format">
+							<option value="7z">7z</option>
+							<option value="tar">tar</option>
+							<option value="zip">zip</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Update mode:</label>
+						  <select name="mode">
+							<option value="">Add and replace files</option>
+							<option value="">Update and add files</option>
+							<option value="">Freshen existing files</option>
+							<option value="">Synchronize files</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Compression level:</label>
+						  <select name="level">
+							<option value="">Store</option>
+							<option value="">Fastest</option>
+							<option value="">Fast</option>
+							<option value="">Normal</option>
+							<option value="">Maximum</option>
+							<option value="">Ultra</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Path mode:</label>
+						  <select name="pathmode">
+							<option value="">Relative pathnames</option>
+							<option value="">Full pathnames</option>
+							<option value="">Absolute pathnames</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Compression method:</label>
+						  <select name="method">
+							<option value="">LZMA2</option>
+							<option value="">LZMA</option>
+							<option value="">PPMd</option>
+							<option value="">BZip2</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			<div class="eight wide column"></div>
+
+			<div class="eight wide column"></div>
+			<div class="eight wide column">
+				<button class="ts basic button" style="width:45%">OK</button>
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<button class="ts basic button" style="width:45%">Cancel</button>
+			</div>
+		</div>
+	</div>
+</body>
+</html>

+ 111 - 0
7-Zip File Manager/CopyNMoveUI.php

@@ -0,0 +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>
+</html>

+ 87 - 0
7-Zip File Manager/ExtractUI.php

@@ -0,0 +1,87 @@
+<!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>
+	<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>Extract to:</label>
+						<input type="text">
+					</div>
+				</div>
+			</div>
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Path mode:</label>
+						  <select name="pathmode">
+							<option value="">Relative pathnames</option>
+							<option value="">Full pathnames</option>
+							<option value="">Absolute pathnames</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Password:</label>
+						<input type="password">
+					</div>
+				</div>
+			</div>
+			
+			<div class="sixteen wide column">
+				<div class="ts form">
+					 <div class="ts checkbox">
+						<input id="agree" type="checkbox">
+						<label for="agree">Eliminate duplication of root folder</label>
+					</div>
+				</div>
+			</div>
+
+			
+			<div class="eight wide column">
+				<div class="ts form">
+					<div class="inline field">
+						<label>Overwrite mode:</label>
+						  <select name="mode">
+							<option value="">Overwrite without prompt</option>
+						  </select>
+					</div>
+				</div>
+			</div>
+			<div class="eight wide column"></div>
+
+			<div class="eight wide column"></div>
+			<div class="eight wide column">
+				<button class="ts basic button" style="width:45%">OK</button>
+				&nbsp;&nbsp;&nbsp;&nbsp;
+				<button class="ts basic button" style="width:45%">Cancel</button>
+			</div>
+		</div>
+	</div>
+</body>
+</html>

+ 195 - 0
7-Zip File Manager/MainUI.php

@@ -0,0 +1,195 @@
+<!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>
+</html>

+ 213 - 0
7-Zip File Manager/ProgressUI.php

@@ -0,0 +1,213 @@
+<!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
+	}
+	.ts.form .inline.field label {
+		min-width: 50%;
+	}
+	.ts.basic.dropdown, .ts.form select {
+		max-width: 50%;
+	}
+	</style>
+</head>
+<body>
+<br>
+	<div class="ts container">
+		<div class="ts grid">
+			
+			<div class="eight wide column">
+				<span style="text-align:left">Elasped time:</span>
+				<span style="text-align:right" id="time">00:00:00</span>
+			</div>
+			<div class="eight wide column">
+				<span style="text-align:left">Total size:</span>
+				<span style="text-align:right"><?php echo filesize($_GET["file"]); ?> b</span>
+			</div>
+			
+			<div class="eight wide column">
+				<span style="text-align:left">Remaining time:</span>
+				<span style="text-align:right" id="remaining">00:00:00</span>
+			</div>
+			<div class="eight wide column">
+				<span style="text-align:left">Speed:</span>
+				<span style="text-align:right" id="speed">0 b/s</span>
+			</div>
+			
+			<div class="sixteen wide column">
+				<span style="text-align:left">Loading...</span>
+				<div class="ts progress">
+					<div class="bar" id="bar" style="width: 0%"></div>
+				</div>
+			</div>	
+			
+			<div class="eight wide column"></div>
+			<div class="eight wide column">
+				<button class="ts basic button" style="width:100%" onclick="f_close();f_cancel = true;">Cancel</button>
+			</div>
+		</div>
+	</div>
+	<div class="ts bottom right snackbar">
+		<div class="content"></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_size = "<?php echo filesize($_GET["file"]); ?>";
+var f_destdir = "<?php echo $_GET["destdir"]; ?>";
+var f_time = 1;
+var f_totaltime = 1;
+var f_cancel = false;
+
+var f_load = setInterval(function(){ 
+	$.get( "./tmp/" + f_rand + "messages", function( data ) {
+		var progress = data.match(/ ([0-9]{0,2}%)/gim);
+		console.log(progress[progress.length - 1]);
+		f_totaltime = Math.floor(f_time / (parseInt(progress[progress.length - 1])/100));
+		$("#bar").attr("style","width: " + progress[progress.length - 1]);
+		$("#time").text(f_convert(f_time));
+		$("#remaining").text(f_convert(f_totaltime - f_time));
+		$("#speed").text(Math.floor(f_size / f_totaltime) + " b/s");
+		f_time += 1;
+	});
+}, 1000);
+
+f_load;
+
+$.get("opr.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir , function( raw ) {
+		clearInterval(f_load);
+		if(!f_cancel){
+			if(f_destdir.length >0){
+				$.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);
+			}
+		}
+});
+
+function f_openFile(bool){
+	var Folder = "";
+	// bool = true then it have destdir
+	// bool = false then it dont have destdir
+	if(bool == true){
+		//f_method = e then it is only single file
+		//f_method = x then it is a folder
+		if(f_method == "e"){
+			Folder = f_destdir.substring(3) + f_file.replace(/^.*[\\\/]/, '').replace(/\./,"") + "/" + f_dir.replace(/^.*[\\\/]/, '');
+		}else if(f_method == "x"){
+			Folder = f_destdir.substring(3) + f_file.replace(/^.*[\\\/]/, '').replace(/\./,"");
+		}
+	}else{
+		//f_method = e then it is only single file
+		//f_method = x then it is a folder
+		if(f_method == "e"){
+			Folder = "7-Zip File Manager/tmp/" + f_rand + "/" + f_dir.replace(/^.*[\\\/]/, '');
+		}else if(f_method == "x"){
+			Folder = "7-Zip File Manager/tmp/" + f_rand + "/";
+		}
+	}
+	console.log(f_rand + Folder);
+	if(ao_module_virtualDesktop){
+		if(f_method == "e"){
+			ao_module_openFile(Folder,"7-Zip Preview");
+		}else if(f_method == "x"){
+			ao_module_openPath(Folder);
+		}
+		ao_module_close();
+	}else{
+		if(f_method == "e"){
+			window.open("../" + Folder);
+		}else if(f_method == "x"){
+			window.open("../SystemAOB/functions/file_system/index.php?controlLv=2#../../../" + Folder);
+		}
+		setTimeout(function(){ts('#modal').modal('hide')},1500);
+	}
+}
+
+function f_convert(time){
+	var hours   = Math.floor(time / 3600);
+	var minutes = Math.floor((time - (hours * 3600)) / 60);
+	var seconds = time - (hours * 3600) - (minutes * 60);
+	
+	if(hours < 10){
+		var dhour  = "0" + hours;
+	}else{
+		var dhour  = hours;
+	}
+	
+	if(minutes < 10){
+		var dminutes  = "0" + minutes;
+	}else{
+		var dminutes  = minutes;
+	}
+
+	if(seconds < 10){
+		var dseconds  = "0" + seconds;
+	}else{
+		var dseconds  = seconds;
+	}
+	
+	if(!isNaN(hours) && !isNaN(minutes) && !isNaN(seconds)){
+		var formatted = dhour + ":" + dminutes + ":" + dseconds;
+	}else{
+		var formatted = "00:00:00";
+	}
+	return formatted;
+}
+
+function msgbox(content,bgcolor,fontcolor){
+	$(".snackbar").attr("style",'background-color: ' + bgcolor + ';color:' + fontcolor);
+	ts('.snackbar').snackbar({
+		content: content,
+		onAction: () => {
+			$(".snackbar").removeAttr("style");
+		}
+	});
+}
+
+function f_close(){
+	if(ao_module_virtualDesktop){
+		ao_module_close();
+	}else{
+		setTimeout(function(){ts('#modal').modal('hide')},1500);
+	}
+}
+</script>
+</html>

+ 1 - 0
7-Zip File Manager/README.txt

@@ -0,0 +1 @@
+Extract 7z and others zip

+ 1 - 0
7-Zip File Manager/description.txt

@@ -0,0 +1 @@
+For extarcting 7z files.

+ 3 - 0
7-Zip File Manager/embedded.php

@@ -0,0 +1,3 @@
+<?php
+header('Location: MainUI.php?file='.$_GET["filepath"]);
+?>

BIN
7-Zip File Manager/img/function_icon.png


BIN
7-Zip File Manager/img/small_icon.png


+ 141 - 0
7-Zip File Manager/index.php

@@ -0,0 +1,141 @@
+
+<!--
+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>
+</html>

+ 40 - 0
7-Zip File Manager/infoUI.php

@@ -0,0 +1,40 @@
+<!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
+	}
+	.ts.form .inline.field label {
+		min-width: 50%;
+	}
+	.ts.basic.dropdown, .ts.form select {
+		max-width: 50%;
+	}
+	</style>
+</head>
+<body>
+<br>
+	<div class="ts container">
+		<h3>File information</h3>
+		<br>File name: <?php echo $_GET["file"];?>
+		<br>File size: <?php echo filesize($_GET["file"]);?>b
+		<br><button class="ts basic button" style="width:45%" onclick="f_close()">Cancel</button>
+	</div>
+</body>
+<script>
+function f_close(){
+	if(ao_module_virtualDesktop){
+		ao_module_close();
+	}else{
+		ts('#modal').modal('hide');
+	}		
+}
+</script>
+</html>

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

@@ -0,0 +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($_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"));
+}

+ 73 - 0
7-Zip File Manager/tmp/8213/arch_lect5c_digLogicBoolAgeN (2).pdf

@@ -0,0 +1,73 @@
+CA Lecture 5c: Digital Logic
+
+  Properties of Boolean Algebra
+
+  Read Appendix A of textbook: p450 – p456
+
+  (Not examined, except DeMorgan
+  theorem)
+
+                                                                                                                         1
+Properties of Boolean Algebra
+
+                                                                                                                              2
+Properties of Boolean Algebra
+                Cont.
+
+• The postulates are basic axioms of Boolean
+  algebra and therefore need no proofs.
+
+• The theorems can be proven from the
+  postulates.
+
+• Each relationship has both an AND form and
+  an OR form as a result of the principle of
+  duality.
+
+• The dual form is obtained by replacing AND
+  with OR and OR with AND, 1’s with 0’s, and
+  0’s with 1’s.
+
+                                                                                                                               3
+  Properties of Boolean Algebra
+
+                  Cont.
+
+• The commutative property states that the
+  order that two variables appear in an AND or
+  OR function is not significant.
+
+• The distributive property shows how a
+  variable is distributed over an expression.
+
+• The identity property states that a variable
+  that is ANDed with 1 or is ORed with 0
+  produces the original variable.
+
+• The complement property states that a
+  variable that is ANDed with its complement is
+  logically false, and a variable that is ORed
+  with its complement is logical true.
+
+                                                                                                                              4
+Properties of Boolean Algebra
+
+                Cont.
+
+• The zero and one theorems state that a
+  variable that is ANDed with 0 produces a 0,
+  and a variable that is ORed with 1 produces a
+  1.
+
+• The idempotence theorem states that a
+  variable that is ANDed or ORed with itself
+  produces the original variable.
+
+• The associative theorem states that the order
+  of ANDing or ORing is logically of no
+  consequence.
+
+• The involution theorem states that the
+  complement of a complement leaves the
+  original variable (or expression) unchanged. 5
+

+ 1 - 0
7-Zip File Manager/tmp/nomedia

@@ -0,0 +1 @@
+.nomedia