allow to call html::tree(null,null) to get just the javascript, eg. to include it in header

This commit is contained in:
Ralf Becker 2010-06-04 20:06:41 +00:00
parent 75651489a7
commit 0d05a9ce40

View File

@ -1292,8 +1292,6 @@ class html
$folderImageDir = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/templates/default/images/';
}
$html = self::div("\n",'id="'.$tree.'"',$_divClass);
static $tree_initialised=false;
if (!$tree_initialised)
{
@ -1301,7 +1299,9 @@ class html
$html .= "<script type='text/javascript' src='{$GLOBALS['egw_info']['server']['webserver_url']}/phpgwapi/js/dhtmlxtree/js/dhtmlXCommon.js'></script>\n";
$html .= "<script type='text/javascript' src='{$GLOBALS['egw_info']['server']['webserver_url']}/phpgwapi/js/dhtmlxtree/js/dhtmlXTree.js'></script>\n";
$tree_initialised = true;
if (!$_folders) return $html;
}
$html = self::div("\n",'id="'.$tree.'"',$_divClass).$html;
$html .= "<script type='text/javascript'>\n";
$html .= "var $tree = new dhtmlXTreeObject('$tree','100%','100%',0);\n";
$html .= "$tree.setImagePath('$folderImageDir/dhtmlxtree/');\n";