Changeset 2490 for trunk/filemanager
- Timestamp:
- 04/12/10 15:07:32 (14 years ago)
- Location:
- trunk/filemanager
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/filemanager/inc/class.uifilemanager.inc.php
r2483 r2490 591 591 $this->t->set_block('filemanager_list_t','filemanager_footer','filemanager_footer'); 592 592 593 $this->t->set_var( 'url', $GLOBALS[ 'phpgw' ] -> link( '/filemanager' ) ); 594 593 595 if($this->numoffiles || $this->cwd) 594 596 { 595 $vars[ path]='<input type="hidden" id="currentPath" value="'.$this->path.'">';596 $vars[ css]='<link rel="stylesheet" type="text/css" href="filemanager/templates/default/main.css">';597 $vars[ css].='<link rel="stylesheet" type="text/css" href="phpgwapi/js/dftree/dftree.css">';597 $vars['path']='<input type="hidden" id="currentPath" value="'.$this->path.'">'; 598 $vars['css']='<link rel="stylesheet" type="text/css" href="' . $GLOBALS[ 'phpgw' ] -> link( '/filemanager/templates/default/main.css' ) . '">'; 599 $vars['css'].='<link rel="stylesheet" type="text/css" href="' . $GLOBALS[ 'phpgw' ] -> link( '/phpgwapi/js/dftree/dftree.css' ) . '">'; 598 600 $vars[preferences]='<input type="hidden" id="userPreferences" value=\''.serialize($_SESSION['phpgw_info']['user']['preferences']['filemanager']).'\'>'; 599 601 // Used for important operations that needs security 600 602 for ($key = ""; strlen($key) < 150; $key .= chr(rand(48,95))); 601 603 $_SESSION['phpgw_info']['filemanager']['user']['sec_key'] = $key; 602 $vars[ sec_key]='<input type="hidden" id="userKey" value=\''.$key.'\'>';603 $vars[ script]='<script>initDrawApi();</script>';604 $vars['sec_key']='<input type="hidden" id="userKey" value=\''.$key.'\'>'; 605 $vars['script']='<script>initDrawApi();</script>'; 604 606 605 $vars[ new_button]=$this->toolButton('new','createfile',lang('New...'));606 $vars[ new_button].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />';607 $vars['new_button']=$this->toolButton('new','createfile',lang('New...')); 608 $vars['new_button'].='<input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" />'; 607 609 608 610 // reload button with this url 609 $vars[ refresh_button]=$this->toolButton('reload','reload',lang('reload'));611 $vars['refresh_button']=$this->toolButton('reload','reload',lang('reload')); 610 612 611 613 // go up icon when we're not at the top, dont allow to go outside /home = fakebase 612 614 if($this->path != '/' && $this->path != $this->bo->fakebase) 613 615 { 614 $vars[ tools_button] = $this->toolButton('tools','tools',lang('tools'));616 $vars['tools_button'] = $this->toolButton('tools','tools',lang('tools')); 615 617 } 616 618 else 617 $vars[ tools_button] = "";618 619 $vars[ toolbar1]=$toolbar;619 $vars['tools_button'] = ""; 620 621 $vars['toolbar1']=$toolbar; 620 622 621 623 if(count($this->messages)>0) … … 628 630 $this->messages = NULL; 629 631 630 $vars[ messages]=$messages;632 $vars['messages']=$messages; 631 633 632 634 $this->t->set_var($vars); -
trunk/filemanager/js/draw_api.js
r2019 r2490 12 12 13 13 function loadHistory(filename){ 14 cExecute_( './index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);14 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window); 15 15 } 16 16 … … 163 163 window.onresize = resizeDiv; 164 164 document.body.style.overflow = "hidden"; 165 cExecute_( './index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);165 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list); 166 166 } 167 167 … … 216 216 newpage += '<td></td><td></td>'; 217 217 newpage += fl.td+'<img src="'+files[i].icon+'">'; 218 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> </td>';218 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> </td>'; 219 219 newpage += fl.td+files[i].directory+'</td>'; 220 220 if (preferences.mime_type =='1') newpage += fl.td+files[i].mime_type+'</td>'; … … 246 246 { 247 247 case 'text/html': 248 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>';248 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>'; 249 249 break; 250 250 case 'application/zip': … … 259 259 else 260 260 var mousefunc = 'hide_card()'; 261 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>';261 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>'; 262 262 if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>'; 263 263 if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>'; … … 319 319 var contentQuota = document.getElementById('content_quota'); 320 320 if (contentQuota != null) 321 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>';321 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>'; 322 322 } 323 323 } … … 335 335 { 336 336 newicon = '<div class="icon">'; 337 newicon += '<a href=" ./index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(currentPath)+'" target="_blank">';337 newicon += '<a href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(currentPath)+'" target="_blank">'; 338 338 newicon += '<div style="width:64; height:64; background-image:url('+files[i].icon+'); background-repeat: no-repeat;"></div>'; 339 339 newicon += '<span class="iconCaption">'+files[i].name+'</span>'; … … 483 483 inputName.value = filename; 484 484 inputName.onclick = function () { oldValue = inputName.value; } 485 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) };485 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) }; 486 486 inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); }; 487 487 nameLink.parentNode.appendChild(inputName); … … 502 502 address = document.location.toString(); 503 503 address = address.split("&"); 504 document.location = address[0]+"&"+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath);504 document.location = URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.index&'+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath); 505 505 } 506 506 else … … 512 512 case 'delete': 513 513 var filesUrl = this.getCheckedFiles(); 514 cExecute_( './index.php?menuaction=filemanager.vfs_functions.delete&path='+514 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.delete&path='+ 515 515 base64_encode(currentPath)+filesUrl,handler.del); 516 516 break; … … 530 530 } 531 531 var pswd = crypt.encode(password); 532 cExecute_( './index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);532 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 533 533 break; 534 534 case 'move_to': … … 549 549 last_folder = last_folder ? last_folder : currentPath; 550 550 current_folder = current_folder ? current_folder : currentPath; 551 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);551 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); 552 552 return; 553 553 case 'tools': 554 554 elements = new Array(); 555 555 elements[0] = { 'text' : get_lang('Preferences'), 556 'url' : 'preferences/preferences.php?appname=filemanager',556 'url' : URL_SERVER + '/preferences/preferences.php?appname=filemanager', 557 557 'img' : templatePath+'images/preferences.png'}; 558 558 elements[1] = { 'text' : get_lang('Search'), … … 564 564 'img' : templatePath+'images/button_createdir.png'}; 565 565 elements[3] = { 'text' : get_lang('Share Folders'), 566 'url' : "./index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager",566 'url' : URL_SERVER + "/index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager", 567 567 'img' : templatePath+'images/mime16_directory.png'}; 568 568 elements[4] = { 'text' : get_lang('View'), … … 584 584 if (password == null) 585 585 return; 586 cExecute_( './index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive);586 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 587 587 } 588 588 function move_to(to,filesUrl){ 589 cExecute_( './index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);589 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto); 590 590 } 591 591 function copy_to(to,filesUrl){ 592 cExecute_( './index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);592 cExecute_(URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto); 593 593 } 594 594 … … 597 597 switch(type){ 598 598 case 'preview': 599 var url = './index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath);599 var url = URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath); 600 600 var htmlData = '<img src=\"'+url+'\">'; 601 601 menuTimeout = setTimeout("draw_window_card(\'"+htmlData+"\')",500); 602 602 break; 603 603 case 'user': 604 var url = './index.php?menuaction=filemanager.user.card&lid='+base64_encode(name);604 var url = URL_SERVER + '/index.php?menuaction=filemanager.user.card&lid='+base64_encode(name); 605 605 menuTimeout = setTimeout("cExecute_('"+url+"',draw_window_card)",500); 606 606 break; … … 616 616 { 617 617 var parentDir = document.getElementById('folders_box').value; 618 cExecute_( './index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);618 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir); 619 619 currentPath = parentDir+'/'+name; 620 620 close_window(); … … 626 626 if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), '')) 627 627 { 628 cExecute_( './index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir);628 cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir); 629 629 var lastIndex = Dfolder.lastIndexOf('/'); 630 630 currentPath = Dfolder.substr(0,lastIndex); -
trunk/filemanager/js/global.js
r2007 r2490 9 9 var oldValue; 10 10 11 var templatePath = './filemanager/templates/default/';11 var templatePath = URL_SERVER + '/filemanager/templates/default/'; 12 12 13 13 var menuTimeout; -
trunk/filemanager/templates/default/main.tpl
r2000 r2490 12 12 <div id="search_div" align="left" style="white-space:nowrap"> 13 13 <input type="text" id="em_message_search" size="16" maxlength="22" /> 14 <img style="vertical-align: bottom;" onclick="searchFile();" src=" ./filemanager/templates/default/images/search.gif">14 <img style="vertical-align: bottom;" onclick="searchFile();" src="{url}/templates/default/images/search.gif"> 15 15 </div> 16 16 <table border="0" cellspacing="0" cellpadding="0" border="0" style="width:100%">
Note: See TracChangeset
for help on using the changeset viewer.