Filemanager: Add lock tooltip, unlock icon on action

This commit is contained in:
nathan 2021-10-28 10:27:22 -06:00
parent a794adfcf2
commit 6fa8f1e792
3 changed files with 60 additions and 1 deletions

View File

@ -1046,6 +1046,12 @@ class filemanager_ui
if($lock = Vfs::checkLock($path)) if($lock = Vfs::checkLock($path))
{ {
$row['locked'] = 'lock'; $row['locked'] = 'lock';
$row['locked_status'] = lang(
"LOCK from %1, created %2",
// Not sure why sometimes the lock is owned by a user ID, sometimes mailto:user@email
is_numeric($lock['owner']) ? $GLOBALS['egw']->accounts->username($lock['owner']) : str_replace('mailto:', '', $lock['owner']),
Api\DateTime::to(APi\DateTime::server2user($lock['created']), '')
);
if($GLOBALS['egw_info']['user']['apps']['admin'] || Vfs::$is_admin || Vfs::$is_root || if($GLOBALS['egw_info']['user']['apps']['admin'] || Vfs::$is_admin || Vfs::$is_root ||
$lock['owner'] == $GLOBALS['egw_info']['user']['account_id'] || $lock['owner'] == $GLOBALS['egw_info']['user']['account_id'] ||
$lock['owner'] == 'mailto:' . $GLOBALS['egw_info']['user']['account_email'] $lock['owner'] == 'mailto:' . $GLOBALS['egw_info']['user']['account_email']

View File

@ -33,7 +33,7 @@
</row> </row>
<row class="row $row_cont[class]"> <row class="row $row_cont[class]">
<vfs-mime align="center" id="$row"/> <vfs-mime align="center" id="$row"/>
<image src="${row}[locked]"/> <image src="${row}[locked]" statustext="$row_cont[locked_status]"/>
<vfs id="$row" no_lang="1"/> <vfs id="$row" no_lang="1"/>
<vfs-size align="right" id="${row}[size]"/> <vfs-size align="right" id="${row}[size]"/>
<date-time id="${row}[mtime]" readonly="true"/> <date-time id="${row}[mtime]" readonly="true"/>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<?xml-stylesheet type="text/css" href="../less/svg.css" ?><svg
version="1.1"
id="pixelegg_lock"
x="0px"
y="0px"
width="32px"
height="32px"
viewBox="0 0 32 32"
enable-background="new 0 0 32 32"
xml:space="preserve"
sodipodi:docname="unlock.svg"
inkscape:version="1.1.1 (eb90963e84, 2021-10-02)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs11">
</defs><sodipodi:namedview
id="namedview9"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="22.46875"
inkscape:cx="11.527121"
inkscape:cy="14.50904"
inkscape:window-width="1920"
inkscape:window-height="1043"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="pixelegg_lock" />
<path
id="path3096"
style="fill:#636363;fill-opacity:1;fill-rule:nonzero"
d="m 8.1533873,0.59754662 c -4.246,0 -7.68945304,2.99159378 -7.68945304,6.68359378 V 14.912 l 3.84006004,0 c 0.00369,-0.945313 0.00369,-0.612867 0.00369,-0.945313 V 7.2811404 c 0,-1.583 1.722703,-2.8652344 3.845703,-2.8652344 2.1219997,0 3.8437497,1.2822344 3.8437497,2.8652344 v 6.6855466 c 0,0.332446 -0.09295,0.648089 -0.232422,0.945313 h 4.076172 V 7.2811404 c 0,-3.692 -3.4415,-6.68359377 -7.6874997,-6.68359378 z"
sodipodi:nodetypes="ssccsssssccss" /><path
id="path3098"
style="fill:#636363;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1"
d="m 11.568704,14.902344 v 0.0078 h -0.960937 c -1.5920001,0 -2.8847657,1.283235 -2.8847657,2.865235 V 28.28125 c 0,1.581 1.2937656,2.865234 2.8847657,2.865234 h 17.300781 c 1.591,0 2.882812,-1.284234 2.882812,-2.865234 V 17.775391 c -0.001,-1.582 -1.292812,-2.863282 -2.882812,-2.863282 h -0.962891 v -0.0098 z m 7.6875,2.875 c 2.122,0 3.845703,1.711312 3.845703,3.820312 0,1.41 -0.778828,2.630016 -1.923828,3.291016 v 1.482422 c 0,1.055 -0.859875,1.910156 -1.921875,1.910156 -1.062,0 -1.921875,-0.855156 -1.921875,-1.910156 v -1.484375 c -1.144,-0.661 -1.921875,-1.879063 -1.921875,-3.289063 0,-2.109 1.72075,-3.820312 3.84375,-3.820312 z" /><path
id="path3102"
d="M 20.27049 14.902473 C 20.268999 14.905651 20.267502 14.908827 20.266 14.912 L 13.048 14.912 C 13.046487 14.908827 13.04498 14.905651 13.043479 14.902473 "
style="fill:#000000;fill-rule:evenodd;fill-opacity:0.49119297" />
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB