JSON callback to autoload folders of other profiles (not yet working, as getFolderTree returns too much, should only be children (item) of selected node)

This commit is contained in:
Ralf Becker 2013-02-20 12:04:29 +00:00
parent 5c6f6471f3
commit f052fc4fe4
2 changed files with 23 additions and 5 deletions

View File

@ -342,6 +342,24 @@ class mail_ui
common::egw_footer(); common::egw_footer();
} }
/**
* Ajax callback to fetch folders for given profile
*
* We currently load all folders of a given profile, tree can also load parts of a tree.
*
* @param string $_GET[selected] if of node whos children are requested
*/
public function ajax_foldertree()
{
list($profileId) = explode(':', $_GET['selected']);
$data = $this->getFolderTree(false, $profileId);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);
common::egw_exit();
}
/** /**
* getFolderTree, get folders from server and prepare the folder tree * getFolderTree, get folders from server and prepare the folder tree
* @param bool $_fetchCounters, wether to fetch extended information on folders * @param bool $_fetchCounters, wether to fetch extended information on folders

View File

@ -38,7 +38,7 @@
</grid> </grid>
</template> </template>
<template id="mail.index" template="" lang="" group="0" version="1.9.001"> <template id="mail.index" template="" lang="" group="0" version="1.9.001">
<tree id="nm[foldertree]" onclick="mail_changeFolder(widget.event_args[0],widget);" parent_node="tree_target"/> <tree id="nm[foldertree]" onclick="mail_changeFolder(widget.event_args[0],widget);" parent_node="tree_target" autoloading="mail.mail_ui.ajax_foldertree"/>
<html id="msg"/> <html id="msg"/>
<nextmatch id="nm" options="mail.index.rows"/> <nextmatch id="nm" options="mail.index.rows"/>
</template> </template>