Skip to content
Permalink
Browse files

Restyled file-system browsing and management

  • Loading branch information...
tvannini committed Jul 23, 2019
1 parent 720aab4 commit 5fc6607c27bf51be79afcacb0ee43e7b26581b88
@@ -31,6 +31,7 @@
top: 1px;
right: 1px;
cursor: pointer;
padding: 2px 3px 2px 3px;
background-color: #ffffff;
border: 1px solid #cccccc;
}
@@ -31,6 +31,7 @@
top: 1px;
right: 1px;
cursor: pointer;
padding: 2px 3px 2px 3px;
background-color: #ffffff;
border: 1px solid #BDB5AE;
}
BIN -422 Bytes (49%) htdocs/img/ctrl_delete.png
Binary file not shown.
Binary file not shown.
BIN +6.11 KB (1200%) htdocs/img/fs/file_add_btn.png
Binary file not shown.
BIN +26 Bytes (110%) htdocs/img/fs/folder.png
Binary file not shown.
BIN +7.29 KB (1300%) htdocs/img/fs/folder_add_btn.png
Binary file not shown.
Binary file not shown.
BIN -61 Bytes (88%) htdocs/img/fs/folder_open.png
Binary file not shown.
BIN +5.23 KB (1100%) htdocs/img/fs/folder_up_btn.png
Binary file not shown.
Binary file not shown.
BIN +843 Bytes (270%) htdocs/img/fs/folder_up_dis.png
Binary file not shown.
BIN +1.14 KB (360%) htdocs/img/fs/unknown.png
Binary file not shown.
BIN +151 Bytes (110%) htdocs/img/fs/xfolder.png
Binary file not shown.
@@ -44,7 +44,7 @@
*
* @global string $jxbuilt
*/
$jxbuilt = "20190715";
$jxbuilt = "20190722";
/**
* Start execution time
@@ -6964,6 +6964,9 @@ function o2file_ico($file_path, $large = false, $internal_use = false) {
case "txt":
case "ini":
case "conf":
case "log":
case "js":
case "css":
$ico_file = "text.png";
break;
case "exe":
@@ -7008,6 +7011,7 @@ function o2file_ico($file_path, $large = false, $internal_use = false) {
case "jpg":
case "tif":
case "ico":
case "bmp":
$ico_file = "img.png";
break;
case "pdf":
@@ -40,6 +40,7 @@ o2def::model("o2sys_logact", "A", "U1[Inserted|Deleted|Updated|Changed]", "");
o2def::model("o2sys_login_type", "A", "U5[|LDAP]", "");
o2def::model("o2sys_loglevel", "A", "U1[Record|Insert|Delete|Change|Existence (I+D)|Modify (C+D)]", "");
o2def::model("o2sys_long_date", "D", "-dmyz", "");
o2def::model("o2sys_long_time", "O", ":hmsz", "");
o2def::model("o2sys_long_str", "A", "C240", "");
o2def::model("o2sys_menu_open_on", "A", "U1[Click|Over]", "");
o2def::model("o2sys_negative", "N", "5N", "");
@@ -49,6 +50,6 @@ o2def::model("o2sys_right_role", "A", "U5[Right|Role]", "");
o2def::model("o2sys_role", "A", "U50", "");
o2def::model("o2sys_service_status", "A", "U1[Active|Stopped|Requested]", "");
o2def::model("o2sys_short_date", "D", "-dmy2z", "");
o2def::model("o2sys_short_time", "O", ":hmsz", "");
o2def::model("o2sys_short_time", "O", ":hmz", "");
o2def::model("o2sys_timestamp", "A", "N16", "");
?>
@@ -123,7 +123,7 @@ $rntimg = o2rnt_alias().'img/';
foreach ($recs as $id => $rec) {
if ($rec['jxlog_act'] != 'P') {
$date = o2format($rec['jxlog_date'], 'o2sys_short_date');
$time = o2format($rec['jxlog_time'], 'o2sys_short_time');
$time = o2format($rec['jxlog_time'], 'o2sys_long_time');
if ($rec['jxlog_act'] == 'A') {
$code.= '<tr title="Current values"><td><img src="'.$rntimg.
'ctrl_select.png"></td><td colspan="3"></td><td class="jxdatalogact">[Current]</td>';
@@ -182,7 +182,7 @@ foreach ($set['fld'] as $id => $rec) {
/* Previous value for [U]pdate events */
if ($rec['act'] != 'P' && ($rec['act'] != 'C' || $rec['value'] !== $last_value)) {
$date = o2format($rec['date'], 'o2sys_short_date');
$time = o2format($rec['time'], 'o2sys_short_time');
$time = o2format($rec['time'], 'o2sys_long_time');
/* Current value row */
if ($rec['act'] == 'A') {
$img = '<img src="'.$rntimg.'ctrl_select.png">';
@@ -289,7 +289,7 @@ if ($trace['cd']) {
$code.= o2format($current[$trace['cd']], 'o2sys_short_date').' &nbsp; ';
}
if ($trace['ct']) {
$code.= o2format($current[$trace['ct']], 'o2sys_short_time').' &nbsp; ';
$code.= o2format($current[$trace['ct']], 'o2sys_long_time').' &nbsp; ';
}
$code.= '</td><td style="text-align:center">';
if ($trace['uu']) {
@@ -299,7 +299,7 @@ if ($trace['ud']) {
$code.= o2format($current[$trace['ud']], 'o2sys_short_date').' &nbsp; ';
}
if ($trace['ut']) {
$code.= o2format($current[$trace['ut']], 'o2sys_short_time').' &nbsp; ';
$code.= o2format($current[$trace['ut']], 'o2sys_long_time').' &nbsp; ';
}
$code .= '</td></tr></table>';
return ($code);
@@ -230,6 +230,11 @@ function o2sys_fs_browser
$o2exe->s(4) && (o2sys_fs_browser_exp_36() || $o2exe->e()) && o2act::exe("load_file_list", True, "") && $o2exe->e();
} //|o2_fine_act|

function o2sys_fs_browser��file_download_act(&$o2exe) {
$o2exe->s(1) && True && o2act::set("prg�_�var", "file_name", o2sys_fs_browser_exp_2()) && $o2exe->e();
$o2exe->s(2) && True && o2act::script(o2sys_fs_browser_exp_66()) && $o2exe->e();
} //|o2_fine_act|

function o2sys_fs_browser��file_get_act(&$o2exe) {
$o2exe->s(1) && True && o2act::set("prg�_�var", "file_name", o2sys_fs_browser_exp_2()) && $o2exe->e();
$o2exe->s(2) && True && o2act::set("prg�_�var", "form_fileget", o2sys_fs_browser_exp_3()) && $o2exe->e();
@@ -329,14 +334,13 @@ function o2sys_fs_browser
function o2sys_fs_browser_exp_1() {
$row_list = o2dir_list(o2val('prg�_�var','folder_path'),
o2val('prg�_�var','files_filter'));
$counter = -1;
$list = array();
$counter = -1;
$list = array();
foreach ($row_list as $s_file) {
$counter++;
$counter++;
$list[$counter] = array('fullname' => $s_file,
'name' => o2file_basename($s_file).
(!o2file_ext($s_file) ?
"" :
(!o2file_ext($s_file) ? "" :
".".o2file_ext($s_file)),
'type' => o2file_type($s_file),
'dim' => o2file_size($s_file),
@@ -419,7 +423,8 @@ elseif (o2app_user() != "root") {
}
else {
$folder = o2app_dir_home();
}
}
$folder = str_replace('\\', '/', $folder);
return ($folder);
} //|o2_fine_exp|

@@ -435,6 +440,7 @@ if (is_array(o2val('prg
$select_btn = '';
$ren_btn = '';
$del_btn = '';
$down_btn = '';
/* ___________________ If interface is for file or folder selection ___ */
if ((o2par(4) && $file['type'] != 'D') || (o2par(5) && $file['type'] == 'D')) {
$select_btn = '<img src="'.$GLOBALS['o2_runtime']->alias.'img/ctrl_select.png"'.
@@ -443,19 +449,39 @@ if (is_array(o2val('prg
'file_select',
$file['fullname']).'">';
}
/* ______________________________________________ If item is a file ___ */
/* ________________________________________ If interface allows get ___ */
if ($file['type'] != "D" && o2par(7)) {
$down_btn = '<img src="'.$GLOBALS['o2_runtime']->alias.
'img/download.png"'.
' title="Download file"'.
' onClick="'.o2_act4js(0,
'file_download',
$file['fullname']).
'return true;">';
}
/* _____________________________________ If interface allows modify ___ */
if (o2par(6)) {
$del_btn = '<img src="'.$GLOBALS['o2_runtime']->alias.
'img/ctrl_delete.png"'.
' title="Delete '.($file['type'] != "D" ?
'file' :
'folder').'"'.
' onClick="'.o2_act4js(0,
($file['type'] != "D" ?
'file_del' :
'folder_del'),
$file['fullname']).'return true;">';
$del_btn = '<img src="'.$GLOBALS['o2_runtime']->alias.
'img/ctrl_delete.png"'.
' title="Delete '.($file['type'] != "D" ?
'file' :
'folder').'"'.
' onClick="'.o2_act4js(0,
($file['type'] != "D" ?
'file_del' :
'folder_del'),
$file['fullname']).
'return true;">';
}
$bytes = $file['dim'];
$factor = floor((strlen($bytes) - 1) / 3);
$sz = '';
if ($factor > 0) {
$sz = ' KMGT';
}
$size = ($bytes ?
o2format($bytes / pow(1024, $factor), 'o2sys_full_number').' '.
@$sz[$factor].'B' : '&nbsp;');
$text.= '<tr style="cursor:pointer;" class="'.
($selection ? 'fsb_sel' : 'fsb_row').
'" title="'.$file['name'].'"'.
@@ -466,15 +492,14 @@ if (is_array(o2val('prg
'><td class="fsb_icon"><img src="'.o2file_ico($file['fullname']).
'"></td><td class="fsb_body">'.
$file['name'].'</td><td class="fsb_body" style="text-align:right;">'.
($file['dim'] ?
o2format($file['dim'], "o2sys_full_number") :
'&nbsp;').'</td><td class="fsb_body" style="text-align:right;">'.
o2format($file['date'], "_o2date").'&nbsp;'.
o2format($file['time'], "_o2time").
$size.'</td><td class="fsb_body" style="text-align:right;">'.
o2format($file['date'], "o2sys_short_date").'&nbsp;'.
o2format($file['time'], "o2sys_short_time").
'</td><td class="fsb_tools">'.
($select_btn.$ren_btn.$del_btn ?
$select_btn.
$ren_btn.
$down_btn.
$ren_btn.
$del_btn :
"&nbsp;").
'</td></tr>';
@@ -491,12 +516,14 @@ return (o2file_dir(o2val('prg

function o2sys_fs_browser_exp_8() {

return ((!o2par(3) ? o2val('prg�_�var','folder_path') : o2par(3)));
return ((!o2par(3) ? o2val('prg�_�var','folder_path') : str_replace('\\', '/', o2par(3))));
} //|o2_fine_exp|

function o2sys_fs_browser_exp_9() {
$str = "> ".
str_replace(o2file_dir(o2val('prg�_�var','folder_limit')), "", o2val('prg�_�var','folder_path')).
$limit = o2val('prg�_�var','folder_limit');
$path = str_replace('/', DIRECTORY_SEPARATOR, o2val('prg�_�var','folder_path'));
$str = "> ".
str_replace(o2file_dir($limit), "", $path).
" &nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp; ".count(o2val('prg�_�var','file_list'))." items listed";
return ($str);
} //|o2_fine_exp|
@@ -697,10 +724,12 @@ return ($sort);
} //|o2_fine_exp|

function o2sys_fs_browser_exp_44() {
$list = o2val('prg�_�var','folder_list');
$root = o2val('prg�_�var','folder_path');
$list = o2val('prg�_�var','folder_list');
$root = o2val('prg�_�var','folder_path');
$limit = str_replace('\\', '/', o2file_dir(o2val('prg�_�var','folder_limit')));
$nroot = rtrim(str_replace($limit, "", $root), '/');
if (isset($list["jxfsroot"])) {
if ($root == $list["jxfsroot"][1]) {
if ($root == $list["jxfsroot"][3]) {
$root_node = "jxfsroot";
}
else {
@@ -710,18 +739,26 @@ if (isset($list["jxfsroot"])) {
else {
$list = array();
$root_node = "jxfsroot";
$list[$root_node] = array(0, $root, o2file_ico($root, false, true));
/* ____________________ Full path to node added as extra data in $list ___ */
$list[$root_node] = array(0,
$nroot,
o2file_ico($root, false, true),
str_replace('\\', '/', $root));
}
$raw_list = o2dir_list($root, o2val('prg�_�var','files_filter'));
foreach ($raw_list as $s_file) {
if (o2file_type($s_file) == "D") {
$f_name = o2file_basename($s_file).(!o2file_ext($s_file) ? "" :
".".o2file_ext($s_file));
$f_name = str_replace('\\', '/', $f_name);
$s_file = str_replace('\\', '/', $s_file);
$list[$s_file] = array($root_node, $f_name, o2file_ico($s_file, false, true));
$s_file = str_replace('\\', '/', $s_file);
/* _________________ Full path to node added as extra data in $list ___ */
$list[$s_file] = array($root_node,
$f_name,
o2file_ico($s_file, false, true),
$s_file);
}
}
}
o2tree_def("jxfsbrowser", $list, 1, "set_folder_by_tree");
return ($list);
} //|o2_fine_exp|
@@ -737,21 +774,19 @@ return (isset($_REQUEST['extp_1']));
} //|o2_fine_exp|

function o2sys_fs_browser_exp_47() {
$dir = o2val('prg�_�var','folder_path');
$dir = str_replace('\\', '/', o2val('prg�_�var','folder_path'));
$list = o2val('prg�_�var','folder_list');
if ($dir == $list["jxfsroot"][1]) {
if ($dir == $list["jxfsroot"][3]) {
$dir = "jxfsroot";
}
o2tree_node_select("jxfsbrowser", $dir);
return (true);
} //|o2_fine_exp|

function o2sys_fs_browser_exp_48() {
$dir = o2tree_get_selection("jxfsbrowser");
$sel = o2tree_get_selection("jxfsbrowser");
$list = o2val('prg�_�var','folder_list');
if ($dir == "jxfsroot") {
$dir = $list["jxfsroot"][1];
}
$dir = $list[$sel][3];
return ($dir);
} //|o2_fine_exp|

@@ -781,11 +816,11 @@ function o2sys_fs_browser_exp_53() {
o2tree_fold("jxfsbrowser", 1);
$list = o2val('prg�_�var','folder_list');
$dir = o2val('prg�_�var','folder_path');
if ($list["jxfsroot"][1] == $dir) {
if ($list["jxfsroot"][3] == $dir) {
o2tree_node_select("jxfsbrowser", "jxfsroot");
}
else {
o2tree_node_select("jxfsbrowser", $dir);
o2tree_node_select("jxfsbrowser", $dir.DIRECTORY_SEPARATOR);
}
return (true);
} //|o2_fine_exp|
@@ -852,6 +887,11 @@ function o2sys_fs_browser_exp_65() {
return (o2val('prg�_�var','folder_start'));
} //|o2_fine_exp|

function o2sys_fs_browser_exp_66() {
o2_send(o2_path(o2val('prg�_�var','file_name'), 1));
return (true);
} //|o2_fine_exp|

function o2sys_fs_browser_exp_69() {

return (!(o2val('prg�_�var','form_fileupload') || o2val('prg�_�var','form_newdir')));
@@ -1,5 +1,5 @@
<?php
//2.4
//2.5
//o2def::module("");
//o2def::folder("");
/*
@@ -15,6 +15,7 @@ o2def::act("close_form_newdir", "");
o2def::act("create_dir", "");
o2def::act("file_add", "");
o2def::act("file_del", "");
o2def::act("file_download", "");
o2def::act("file_get", "");
o2def::act("file_ren", "");
o2def::act("file_select", "");
@@ -34,15 +35,15 @@ o2def::form("browser", "", False, "o2sys_fs_browser_exp_69()", false);
o2def::form("add_folder", "", False, "o2sys_fs_browser_exp_14()", false);
o2def::form("add_file", "", False, "o2sys_fs_browser_exp_23()", false);
o2def::form("visor", "", False, "o2sys_fs_browser_exp_28()", "o2sys_fs_browser_exp_30()");
o2def::par(1, "start_folder_path","o2sys_long_str");
o2def::par(2, "start_filter","o2sys_long_str");
o2def::par(3, "folder_limit","o2sys_long_str");
o2def::par(4, "for_file_selection","_o2logical");
o2def::par(5, "for_folder_selection","_o2logical");
o2def::par(6, "allow_mod","_o2logical");
o2def::par(7, "allow_get","_o2logical");
o2def::par(8, "allow_upload","_o2logical");
o2def::par(9, "window_title","o2sys_long_str");
o2def::par(1, "start_folder_path", "o2sys_long_str");
o2def::par(2, "start_filter", "o2sys_long_str");
o2def::par(3, "folder_limit", "o2sys_long_str");
o2def::par(4, "for_file_selection", "_o2logical");
o2def::par(5, "for_folder_selection", "_o2logical");
o2def::par(6, "allow_mod", "_o2logical");
o2def::par(7, "allow_get", "_o2logical");
o2def::par(8, "allow_upload", "_o2logical");
o2def::par(9, "window_title", "o2sys_long_str");



0 comments on commit 5fc6607

Please sign in to comment.
You can’t perform that action at this time.