forked from extern/egroupware
For filemanager index, store current view (tile/row) as implicit preference
This commit is contained in:
parent
28410fc81b
commit
0f6eeed9ca
@ -31,7 +31,7 @@ class filemanager_favorite_portlet extends home_favorite_portlet
|
||||
$ui = new filemanager_ui();
|
||||
|
||||
$this->nm_settings += array(
|
||||
'get_rows' => 'filemanager.filemanager_ui.get_rows',
|
||||
'get_rows' => 'filemanager.filemanager_favorite_portlet.get_rows',
|
||||
'csv_export' => true,
|
||||
// Use a different template so it can be accessed from client side
|
||||
'template' => ($this->nm_settings['view'] == 'tile' ? 'filemanager.tile' : 'filemanager.home.rows' ),
|
||||
|
@ -300,6 +300,7 @@ class filemanager_ui
|
||||
$content['nm']['path'] = static::get_home_dir();
|
||||
}
|
||||
$content['nm']['home_dir'] = static::get_home_dir();
|
||||
$content['nm']['view'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['nm_view'];
|
||||
|
||||
if (isset($_GET['msg'])) $msg = $_GET['msg'];
|
||||
|
||||
@ -782,6 +783,13 @@ class filemanager_ui
|
||||
if($query['view'])
|
||||
{
|
||||
$query['template'] = ($query['view'] == 'row' ? 'filemanager.index.rows' : 'filemanager.tile');
|
||||
|
||||
// Store as preference but only for index, not home
|
||||
if($query['get_rows'] == 'filemanager.filemanager_ui.get_rows')
|
||||
{
|
||||
$GLOBALS['egw']->preferences->add('filemanager','nm_view',$query['view']);
|
||||
$GLOBALS['egw']->preferences->save_repository();
|
||||
}
|
||||
}
|
||||
// be tolerant with (in previous versions) not correct urlencoded pathes
|
||||
if (!egw_vfs::stat($query['path'],true) && egw_vfs::stat(urldecode($query['path'])))
|
||||
|
Loading…
Reference in New Issue
Block a user