if initial load is done via GET request (idots template or share.php), get_rows cant call app.filemanager.set_readonly

setting now value "initial_path_readonly" in content and use that in app.filemanager.et2_ready() to call set_readonly()
This commit is contained in:
Ralf Becker 2014-12-10 10:32:47 +00:00
parent 69400d8d3a
commit 00b22e82bf
2 changed files with 9 additions and 0 deletions

View File

@ -482,6 +482,10 @@ class filemanager_ui
{ {
$tpl->setElementAttribute('nm[buttons][upload]', 'drop_target', 'popupMainDiv'); $tpl->setElementAttribute('nm[buttons][upload]', 'drop_target', 'popupMainDiv');
} }
// if initial load is done via GET request (idots template or share.php)
// get_rows cant call app.filemanager.set_readonly, so we need to do that here
$content['initial_path_readonly'] = !egw_vfs::is_writable($content['nm']['path']);
$tpl->exec('filemanager.filemanager_ui.index',$content,$sel_options,$readonlys,array('nm' => $content['nm'])); $tpl->exec('filemanager.filemanager_ui.index',$content,$sel_options,$readonlys,array('nm' => $content['nm']));
} }

View File

@ -83,6 +83,11 @@ app.classes.filemanager = AppJS.extend(
// get clipboard from browser localstore and update button tooltips // get clipboard from browser localstore and update button tooltips
this.clipboard_tooltips(); this.clipboard_tooltips();
// calling set_readonly for initial path
if (this.et2.getArrayMgr('content').getEntry('initial_path_readonly'))
{
this.readonly = [this.et2.getArrayMgr('content').getEntry('nm[path]'), true];
}
if (typeof this.readonly != 'undefined') if (typeof this.readonly != 'undefined')
{ {
this.set_readonly.apply(this, this.readonly); this.set_readonly.apply(this, this.readonly);