mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-13 17:00:45 +01:00
Et2VfsSelectDialog: Get add directory button responding to current path permissions
This commit is contained in:
parent
e25152fb1e
commit
63083ee811
@ -112,6 +112,7 @@ export class Et2VfsSelectDialog extends Et2InputWidget(LitElement) implements Se
|
|||||||
@state() open : boolean = false;
|
@state() open : boolean = false;
|
||||||
@state() currentFile : Et2VfsSelectRow;
|
@state() currentFile : Et2VfsSelectRow;
|
||||||
@state() selectedFiles : Et2VfsSelectRow[] = [];
|
@state() selectedFiles : Et2VfsSelectRow[] = [];
|
||||||
|
@state() _pathWritable : boolean = false;
|
||||||
|
|
||||||
|
|
||||||
// SearchMixinInterface //
|
// SearchMixinInterface //
|
||||||
@ -364,7 +365,12 @@ export class Et2VfsSelectDialog extends Et2InputWidget(LitElement) implements Se
|
|||||||
if(typeof results.path === "string")
|
if(typeof results.path === "string")
|
||||||
{
|
{
|
||||||
// Something like a redirect or link followed - server is sending us a "corrected" path
|
// Something like a redirect or link followed - server is sending us a "corrected" path
|
||||||
this._pathNode.value = results.path;
|
this.path = results.path;
|
||||||
|
}
|
||||||
|
if(typeof results.writable !== "undefined")
|
||||||
|
{
|
||||||
|
this._pathWritable = results.writable;
|
||||||
|
this.requestUpdate("_pathWritable");
|
||||||
}
|
}
|
||||||
this.helpText = results?.message ?? "";
|
this.helpText = results?.message ?? "";
|
||||||
this._fileList = results?.files ?? [];
|
this._fileList = results?.files ?? [];
|
||||||
@ -725,13 +731,16 @@ export class Et2VfsSelectDialog extends Et2InputWidget(LitElement) implements Se
|
|||||||
</et2-select>
|
</et2-select>
|
||||||
<et2-button statustext="Create directory" id="createdir" class="createDir"
|
<et2-button statustext="Create directory" id="createdir" class="createDir"
|
||||||
arial-label=${this.egw().lang("Create directory")}
|
arial-label=${this.egw().lang("Create directory")}
|
||||||
|
?disabled=${!this._pathWritable}
|
||||||
noSubmit="true"
|
noSubmit="true"
|
||||||
image="filemanager/button_createdir"
|
image="filemanager/button_createdir"
|
||||||
roImage="filemanager/createdir_disabled"
|
roImage="filemanager/createdir_disabled"
|
||||||
@click=${this.handleCreateDirectory}
|
@click=${this.handleCreateDirectory}
|
||||||
></et2-button>
|
></et2-button>
|
||||||
<file id="upload_file" statustext="upload file" progress_dropdownlist="true" multiple="true"
|
<file id="upload_file" statustext="upload file" progress_dropdownlist="true" multiple="true"
|
||||||
onFinish="app.vfsSelectUI.storeFile"></file>
|
?disabled=${!this._pathWritable}
|
||||||
|
onFinish="app.vfsSelectUI.storeFile"
|
||||||
|
></file>
|
||||||
<et2-searchbox id="search"
|
<et2-searchbox id="search"
|
||||||
@keydown=${this.handleSearchKeyDown}
|
@keydown=${this.handleSearchKeyDown}
|
||||||
@sl-clear=${this.startSearch}
|
@sl-clear=${this.startSearch}
|
||||||
|
@ -605,6 +605,8 @@ class Vfs extends File
|
|||||||
/**
|
/**
|
||||||
* Get a list of files that match the given parameters
|
* Get a list of files that match the given parameters
|
||||||
*
|
*
|
||||||
|
* Can also give a new path (like a link, not redirect), and a writable flag
|
||||||
|
*
|
||||||
* @param $search
|
* @param $search
|
||||||
* @param $content
|
* @param $content
|
||||||
* @return void
|
* @return void
|
||||||
@ -618,6 +620,7 @@ class Vfs extends File
|
|||||||
{
|
{
|
||||||
$content['path'] = $response['path'] = Api\Vfs::get_home_dir();
|
$content['path'] = $response['path'] = Api\Vfs::get_home_dir();
|
||||||
}
|
}
|
||||||
|
$response['writable'] = Api\Vfs::is_writable($content['path']);
|
||||||
|
|
||||||
// Filemanager favorites as directories
|
// Filemanager favorites as directories
|
||||||
if(substr($content['path'], 0, strlen('/apps/favorites')) == '/apps/favorites')
|
if(substr($content['path'], 0, strlen('/apps/favorites')) == '/apps/favorites')
|
||||||
|
Loading…
Reference in New Issue
Block a user