Make favorites available as an individual button in VfsSelect dialog

This commit is contained in:
Hadi Nategh 2017-11-20 17:01:50 +01:00
parent 8e9ba56b46
commit 7e6bcc035f
2 changed files with 3 additions and 2 deletions

View File

@ -518,6 +518,7 @@ class Vfs extends File
'createdir' => !\EGroupware\Api\Vfs::is_writable($content['path']),
'upload_file' => !\EGroupware\Api\Vfs::is_writable($content['path']) ||
!in_array($content['mode'],array('open', 'open-multiple')),
'favorites' => !isset($GLOBALS['egw_info']['apps']['stylite'])
));
$sel_options = array_merge($sel_options, array(
@ -651,8 +652,7 @@ class Vfs extends File
*/
static function get_apps()
{
$apps = array(false); // index starting from 1
if (isset($GLOBALS['egw_info']['apps']['stylite'])) $apps = array('favorites' => lang('Favorites'));
$apps = array();
$apps += \EGroupware\Api\Link::app_list('query');
// they do NOT support adding files to VFS
unset($apps['addressbook-email'], $apps['mydms'], $apps['wiki'],

View File

@ -15,6 +15,7 @@
<box class="et2_toolbar et2_fullWidth">
<buttononly statustext="Go to your home directory" id="home" onclick="app.vfsSelectUI.do_action('home', widget)" image="gohome" background_image="1"/>
<buttononly statustext="Up" id="up" onclick="app.vfsSelectUI.change_dir('..', widget);" image="goup" background_image="1"/>
<buttononly statustext="Favorites" id="favorites" onclick="app.vfsSelectUI.change_dir('/apps/favorites', widget);" image="fav_filter" background_image="1"/>
<select width="175" id="app" empty_label="Applications" no_lang="1" onchange="app.vfsSelectUI.do_action('app', widget)"/>
<buttononly statustext="Create directory" id="createdir" class="createDir" onclick="app.vfsSelectUI.createdir" image="button_createdir" ro_image="createdir_disabled" background_image="1"/>
<file id='upload_file' statustext="upload file" progress_dropdownlist = "true" multiple="true" onFinish="app.vfsSelectUI.storeFile"/>