File select dialog

- Fix create folder
- Fix can't change directory by editing path
This commit is contained in:
Nathan Gray 2014-05-26 17:11:22 +00:00
parent 9455efae32
commit fca003d78d
2 changed files with 3 additions and 14 deletions

View File

@ -122,20 +122,9 @@ class filemanager_select
unset($content['button']);
switch($button)
{
case 'up':
if ($content['path'] != '/') $content['path'] = egw_vfs::dirname($content['path']);
break;
case 'home':
$content['path'] = filemanager_ui::get_home_dir();
break;
case 'createdir':
if (!@egw_vfs::mkdir($content['path'],null,STREAM_MKDIR_RECURSIVE))
{
$content['msg'] = !egw_vfs::is_writable(dirname($content['path'])) ?
lang('Permission denied!') : lang('Failed to create directory!');
$content['path'] = $content['old_path'];
}
break;
case 'ok':
$copy_result = null;
if (isset($content['file_upload']['name']) && file_exists($content['file_upload']['tmp_name']))

View File

@ -30,12 +30,12 @@
<row class="dialogHeader">
<hbox>
<html id="js"/>
<button label="Up" id="button[up]" image="goup"/>
<button label="Up" id="button[up]" onclick="app.filemanager.change_dir('..');" image="goup"/>
<button label="Go to your home directory" id="button[home]" image="gohome"/>
<box class="selectPathContainer">
<vfs-name id="path" class="selectPath"/>
<vfs-name id="path" class="selectPath" onchange="1"/>
</box>
<button label="Create directory" id="button[createdir]" onclick="var dir = prompt(egw::lang('New directory')); if (!dir) return false; document.getElementById(form::name('path')).value+='/'+dir;" image="button_createdir" ro_image="createdir_disabled" class="createDir"/>
<button label="Create directory" id="button[createdir]" onclick="app.filemanager.createdir" image="button_createdir" ro_image="createdir_disabled" class="createDir"/>
</hbox>
</row>
<row class="selectFiles">