Преглед на файлове

Updated AO-Codec in dev-en-HK

tobychui преди 5 години
родител
ревизия
2ecd807cc1
променени са 3 файла, в които са добавени 98 реда и са изтрити 0 реда
  1. BIN
      docs/img/devdoc/6/1.png
  2. 1 0
      docs/lang/dev-en-HK/5.md
  3. 97 0
      docs/lang/dev-en-HK/6.md

BIN
docs/img/devdoc/6/1.png


+ 1 - 0
docs/lang/dev-en-HK/5.md

@@ -380,6 +380,7 @@ module_directory,open_mode,icon_tag,window_width,window_height,allow_resize(0/1)
 	- ```default```		Open the file with default application, filename pass by variable "filename"
 	- ```floatwindow```		Open the file with floatWindow if it is under VDI mode. If not, redirect to the application page.
 	- ```embedded```		Open the file with embedded mode if it is under VDI mode.(Make sure you have the embedded.php under the module root folder).
+- ```icon_tag```	Icon tag is based on the ArOZ Online System Default CSS - TocasUI. See more in this [page](https://tocas-ui.com/elements/icon/).
 - ```window_width```	Windows default width in pixel
 - ```window_height``` 	Windows default height in pixel
 - ```allow_resize```	Allow window to be resized. Override in non-VDI mode.

+ 97 - 0
docs/lang/dev-en-HK/6.md

@@ -0,0 +1,97 @@
+["ArOZ-Online Codec"]
+# ArOZ Online Codec
+Inorder to support multiple lanuage from all around the globe, ArOZ Online System implements a new filename encoding method for all the filename and foldername that stores within the ArOZ Online System root as well as external storage directory. 
+
+This method is first used by the Upload Manager Module and it fixed the problem for upload failure of non-supported UTF-8 filename on Window host system. Hence, the filename and foldername are named as "um-file naming method" (or short for umfilename method).
+
+## UM-Filename and HexFoldername Structure
+UMFilename is consists of three parts. In simple words, it is structured as follows:
+```inith{filename_name_after_bin2hex}.{ext}```
+
+where "inith" means initiate with hex.
+
+
+## PHP-based Conversion
+The following section explains the method for converting from and to umfilename to UTF-8 filenames.
+
+### UTF-8 Filename to UM-Filename
+Here are the method to convert a UTF-8 filename / foldername to umfilename / hexfoldername.
+
+```
+//Convert file
+$ext = pathinfo($filename, PATHINFO_EXTENSION);
+$fname = basename($filename, "." .$ext);
+$umfilename = "inith" . bin2hex($fname) . $ext;
+
+//Convert folder
+$hexfoldername = bin2hex(basename($foldername));
+```
+
+### UM-Filename to UTF-8 Filename
+To convert UMfilename back into UTF-8 filename, you will need to use the folowing code segments for this purpose.
+
+```
+//Convert file
+if (substr(basename($filename),0,5) === "inith"){
+	$ext = pathinfo($filename, PATHINFO_EXTENSION);
+	$orgname = str_replace("inith","",basename($filename,"." . $ext));
+	if (ctype_xdigit($orgname) && strlen($orgname) % 2 == 0) {
+		$orgname = hex2bin($orgname);
+	}
+	$decodedName = dirname($filename) . "/" . $orgname . "." . $ext;
+}
+
+//Convert folder
+if (ctype_xdigit($foldername) && strlen($foldername) % 2 == 0) {
+	$decodedName = hex2bin($foldername);
+}
+```
+
+## Javascript Based Conversion
+Since later stage of the Beta phrase, Javascript based umfilename decoding is also supported with the ```ao_module_codec``` class in ao_module wrapper. To use them, simply include the wrapper and call the functions below.
+
+```
+ao_module_codec.decodeUmFilename(umfilename_here);
+
+ao_module_codec.decodeHexFoldername(hexFolderName_here);
+```
+
+*Be noted that ao_module wrapper do not support encoding. You should avoid performing um-file encoding on the client side as well as the original aim for umfilename system is to fix localization issue on server side.*
+
+## UMfilename HexFoldername in File Explorer
+UMFilename and HexFoldername are shown with human-readable format while presented on the File Explorer build into ArOZ Online System.
+
+![](img/devdoc/6/1.png)
+
+For files that is encoded as umfilename or hexfoldername in the background Linux file system (or Windows NTFS if you are hosting the system on Windows), the background color of that particular file will be updated to its respective color. The color coding scheme is as follow.
+
+<table class="ts table">
+<thead>
+<tr>
+<th>File Naming Method</th>
+<th>Encode Method</th>
+<th>Represent Color</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Default (UTF-8)</td>
+<td>None</td>
+<td>White</td>
+</tr>
+<tr>
+<td>UM-Filename</td>
+<td>"inith" + bin2hex({original_filename}) + "." + {original_ext}</td>
+<td>Blue</td>
+</tr>
+<tr>
+<td>HEX-Foldername</td>
+<td>bin2hex({original_foldername})</td>
+<td>Green</td>
+</tr>
+</tbody>
+</table>
+
+## Conversion using fsconv
+Please refer to the File Systen API for how to use the fsconv to convert filenames that is encoded with AO-Codec.
+