Index: trunk/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- trunk/filemanager/inc/class.uifilemanager.inc.php	(revision 2483)
+++ trunk/filemanager/inc/class.uifilemanager.inc.php	(revision 2490)
@@ -591,31 +591,33 @@
 			$this->t->set_block('filemanager_list_t','filemanager_footer','filemanager_footer');
 
+			$this->t->set_var( 'url', $GLOBALS[ 'phpgw' ] -> link( '/filemanager' ) );
+
 			if($this->numoffiles || $this->cwd)
 			{
-				$vars[path]='<input type="hidden" id="currentPath" value="'.$this->path.'">';
-				$vars[css]='<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">';
-				$vars[css].='<link rel="stylesheet" type="text/css" href="phpgwapi/js/dftree/dftree.css">';
+				$vars['path']='<input type="hidden" id="currentPath" value="'.$this->path.'">';
+				$vars['css']='<link rel="stylesheet" type="text/css" href="' . $GLOBALS[ 'phpgw' ] -> link( '/filemanager/templates/default/main.css' ) . '">';
+				$vars['css'].='<link rel="stylesheet" type="text/css" href="' . $GLOBALS[ 'phpgw' ] -> link( '/phpgwapi/js/dftree/dftree.css' ) . '">';
 				$vars[preferences]='<input type="hidden" id="userPreferences" value=\''.serialize($_SESSION['phpgw_info']['user']['preferences']['filemanager']).'\'>';
 				// Used for important operations that needs security
 				for ($key = ""; strlen($key) < 150; $key .= chr(rand(48,95)));
 				$_SESSION['phpgw_info']['filemanager']['user']['sec_key'] = $key;
-				$vars[sec_key]='<input type="hidden" id="userKey" value=\''.$key.'\'>';
-				$vars[script]='<script>initDrawApi();</script>';
+				$vars['sec_key']='<input type="hidden" id="userKey" value=\''.$key.'\'>';
+				$vars['script']='<script>initDrawApi();</script>';
 				
-				$vars[new_button]=$this->toolButton('new','createfile',lang('New...'));
-				$vars[new_button].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />';
+				$vars['new_button']=$this->toolButton('new','createfile',lang('New...'));
+				$vars['new_button'].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />';
 				
 				// reload button with this url
-				$vars[refresh_button]=$this->toolButton('reload','reload',lang('reload'));
+				$vars['refresh_button']=$this->toolButton('reload','reload',lang('reload'));
 
 				// go up icon when we're not at the top, dont allow to go outside /home = fakebase
 				if($this->path != '/' && $this->path != $this->bo->fakebase)
 				{
-					$vars[tools_button] = $this->toolButton('tools','tools',lang('tools'));
+					$vars['tools_button'] = $this->toolButton('tools','tools',lang('tools'));
 				}
 				else
-					$vars[tools_button] = "";
-
-				$vars[toolbar1]=$toolbar;
+					$vars['tools_button'] = "";
+
+				$vars['toolbar1']=$toolbar;
 
 				if(count($this->messages)>0) 
@@ -628,5 +630,5 @@
 				$this->messages = NULL;
 				
-				$vars[messages]=$messages;
+				$vars['messages']=$messages;
 
 				$this->t->set_var($vars);
Index: trunk/filemanager/js/draw_api.js
===================================================================
--- trunk/filemanager/js/draw_api.js	(revision 2019)
+++ trunk/filemanager/js/draw_api.js	(revision 2490)
@@ -12,5 +12,5 @@
 
 function loadHistory(filename){
-	cExecute_('./index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);
 }
 
@@ -163,5 +163,5 @@
 	window.onresize = resizeDiv;
 	document.body.style.overflow = "hidden";
-	cExecute_('./index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);
 }
 
@@ -216,5 +216,5 @@
 		newpage += '<td></td><td></td>';
 		newpage += fl.td+'<img src="'+files[i].icon+'">';
-		newpage += '<a id="name_'+files[i].name+'" href="./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(files[i].directory)+'" target="_blank">'+files[i].name+'</a>&nbsp;</td>';
+		newpage += '<a id="name_'+files[i].name+'" href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(files[i].directory)+'" target="_blank">'+files[i].name+'</a>&nbsp;</td>';
 		newpage += fl.td+files[i].directory+'</td>';
 		if (preferences.mime_type =='1') newpage += fl.td+files[i].mime_type+'</td>';
@@ -246,5 +246,5 @@
 		{
 			case 'text/html':
-				retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>';
+				retBuff += '<td><a href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>';
 				break;
 			case 'application/zip':
@@ -259,5 +259,5 @@
 		else
 			var mousefunc = 'hide_card()';
-		retBuff += '<a onmouseover="'+mousefunc+'" id="name_'+file.name+'" href="./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'" target="_blank">'+file.name+'</a></div></td>';
+		retBuff += '<a onmouseover="'+mousefunc+'" id="name_'+file.name+'" href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'" target="_blank">'+file.name+'</a></div></td>';
 		if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>';
 		if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>';
@@ -319,5 +319,5 @@
 		var contentQuota = document.getElementById('content_quota');
 		if (contentQuota != null)
-			contentQuota.innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="../phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>';
+			contentQuota.innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="' + URL_SERVER + '/phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>';
 	}
 }
@@ -335,5 +335,5 @@
 		{
 			newicon = '<div class="icon">';
-			newicon += '<a href="./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(currentPath)+'" target="_blank">';
+			newicon += '<a href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(currentPath)+'" target="_blank">';
 			newicon += '<div style="width:64; height:64; background-image:url('+files[i].icon+'); background-repeat: no-repeat;"></div>';
 			newicon += '<span class="iconCaption">'+files[i].name+'</span>';
@@ -483,5 +483,5 @@
 					inputName.value = filename;
 					inputName.onclick = function () { oldValue = inputName.value; }
-					inputName.onblur = function () { if (inputName.value == oldValue) handler.rename(); else cExecute_('./index.php?menuaction=filemanager.vfs_functions.rename&file='+base64_encode(this.id.substr(6))+'&to='+base64_encode(this.value)+"&path="+base64_encode(currentPath),handler.rename) };
+					inputName.onblur = function () { if (inputName.value == oldValue) handler.rename(); else cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.rename&file='+base64_encode(this.id.substr(6))+'&to='+base64_encode(this.value)+"&path="+base64_encode(currentPath),handler.rename) };
 					inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); };
 					nameLink.parentNode.appendChild(inputName);
@@ -502,5 +502,5 @@
 				address = document.location.toString();
 				address = address.split("&");
-				document.location = address[0]+"&"+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath);
+				document.location = URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.index&'+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath);
 			}
 			else
@@ -512,5 +512,5 @@
 		case 'delete':
 			var filesUrl = this.getCheckedFiles();
-			cExecute_('./index.php?menuaction=filemanager.vfs_functions.delete&path='+
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.delete&path='+
 					base64_encode(currentPath)+filesUrl,handler.del);
 			break;
@@ -530,5 +530,5 @@
 			}
 			var pswd = crypt.encode(password);
-			cExecute_('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);
 			break;
 		case 'move_to':
@@ -549,10 +549,10 @@
 			last_folder = last_folder ? last_folder : currentPath;
 			current_folder = current_folder ? current_folder : currentPath;
-			cExecute_('./index.php?menuaction=filemanager.uifilemanager.dir_ls&path='+base64_encode(currentPath)+'&criteria='+criteria+'&otype='+order_type+'&limit='+preferences.files_per_page+'&offset='+offset,folderList.drawFiles);
+			cExecute_( URL_SERVER  + '/index.php?menuaction=filemanager.uifilemanager.dir_ls&path='+base64_encode(currentPath)+'&criteria='+criteria+'&otype='+order_type+'&limit='+preferences.files_per_page+'&offset='+offset,folderList.drawFiles);
 			return;
 		case 'tools':
 			elements = new Array();
 			elements[0] = { 'text' : get_lang('Preferences'),
-					'url' : 'preferences/preferences.php?appname=filemanager',
+					'url' : URL_SERVER + '/preferences/preferences.php?appname=filemanager',
 					'img' : templatePath+'images/preferences.png'};
 			elements[1] = { 'text' : get_lang('Search'),
@@ -564,5 +564,5 @@
 					'img' : templatePath+'images/button_createdir.png'};
 			elements[3] = { 'text' : get_lang('Share Folders'),
-					'url' : "./index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager",
+					'url' : URL_SERVER + "/index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager",
 					'img' : templatePath+'images/mime16_directory.png'};
 			elements[4] = { 'text' : get_lang('View'),
@@ -584,11 +584,11 @@
 	if (password == null)
 		return;
-	cExecute_('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive);
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive);
 }
 function move_to(to,filesUrl){
-	cExecute_('./index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);
 }
 function copy_to(to,filesUrl){
-	cExecute_('./index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);
+	cExecute_(URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);
 }
 
@@ -597,10 +597,10 @@
 	switch(type){
 		case 'preview':
-			var url = './index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath);
+			var url = URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath);
 			var htmlData = '<img src=\"'+url+'\">';
 			menuTimeout = setTimeout("draw_window_card(\'"+htmlData+"\')",500);
 			break;
 		case 'user':
-			var url = './index.php?menuaction=filemanager.user.card&lid='+base64_encode(name);
+			var url = URL_SERVER + '/index.php?menuaction=filemanager.user.card&lid='+base64_encode(name);
 			menuTimeout = setTimeout("cExecute_('"+url+"',draw_window_card)",500);
 			break;
@@ -616,5 +616,5 @@
 		{
 			var parentDir = document.getElementById('folders_box').value;
-			cExecute_('./index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);
 			currentPath = parentDir+'/'+name;
 			close_window();
@@ -626,5 +626,5 @@
 			if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), ''))
 			{
-				cExecute_('./index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir);
+				cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir);
 				var lastIndex = Dfolder.lastIndexOf('/');
 				currentPath = Dfolder.substr(0,lastIndex);
Index: trunk/filemanager/js/global.js
===================================================================
--- trunk/filemanager/js/global.js	(revision 2007)
+++ trunk/filemanager/js/global.js	(revision 2490)
@@ -9,5 +9,5 @@
 var oldValue;
 
-var templatePath = './filemanager/templates/default/';
+var templatePath = URL_SERVER + '/filemanager/templates/default/';
 
 var menuTimeout;
Index: trunk/filemanager/templates/default/main.tpl
===================================================================
--- trunk/filemanager/templates/default/main.tpl	(revision 2000)
+++ trunk/filemanager/templates/default/main.tpl	(revision 2490)
@@ -12,5 +12,5 @@
 			<div id="search_div" align="left" style="white-space:nowrap">
 			<input type="text" id="em_message_search" size="16" maxlength="22" />
-			<img style="vertical-align: bottom;" onclick="searchFile();" src="./filemanager/templates/default/images/search.gif">
+			<img style="vertical-align: bottom;" onclick="searchFile();" src="{url}/templates/default/images/search.gif">
 			</div>
 			<table border="0" cellspacing="0" cellpadding="0" border="0" style="width:100%">
