Changeset 2490 for trunk/filemanager


Ignore:
Timestamp:
04/12/10 15:07:32 (14 years ago)
Author:
rodsouza
Message:

Ticket #1009 - Correção de problemas no ExpressoDocs? ao exibir algumas imagens.

Location:
trunk/filemanager
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/filemanager/inc/class.uifilemanager.inc.php

    r2483 r2490  
    591591                        $this->t->set_block('filemanager_list_t','filemanager_footer','filemanager_footer'); 
    592592 
     593                        $this->t->set_var( 'url', $GLOBALS[ 'phpgw' ] -> link( '/filemanager' ) ); 
     594 
    593595                        if($this->numoffiles || $this->cwd) 
    594596                        { 
    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' ) . '">'; 
    598600                                $vars[preferences]='<input type="hidden" id="userPreferences" value=\''.serialize($_SESSION['phpgw_info']['user']['preferences']['filemanager']).'\'>'; 
    599601                                // Used for important operations that needs security 
    600602                                for ($key = ""; strlen($key) < 150; $key .= chr(rand(48,95))); 
    601603                                $_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>'; 
    604606                                 
    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="" />'; 
    607609                                 
    608610                                // 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')); 
    610612 
    611613                                // go up icon when we're not at the top, dont allow to go outside /home = fakebase 
    612614                                if($this->path != '/' && $this->path != $this->bo->fakebase) 
    613615                                { 
    614                                         $vars[tools_button] = $this->toolButton('tools','tools',lang('tools')); 
     616                                        $vars['tools_button'] = $this->toolButton('tools','tools',lang('tools')); 
    615617                                } 
    616618                                else 
    617                                         $vars[tools_button] = ""; 
    618  
    619                                 $vars[toolbar1]=$toolbar; 
     619                                        $vars['tools_button'] = ""; 
     620 
     621                                $vars['toolbar1']=$toolbar; 
    620622 
    621623                                if(count($this->messages)>0)  
     
    628630                                $this->messages = NULL; 
    629631                                 
    630                                 $vars[messages]=$messages; 
     632                                $vars['messages']=$messages; 
    631633 
    632634                                $this->t->set_var($vars); 
  • trunk/filemanager/js/draw_api.js

    r2019 r2490  
    1212 
    1313function 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); 
    1515} 
    1616 
     
    163163        window.onresize = resizeDiv; 
    164164        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); 
    166166} 
    167167 
     
    216216                newpage += '<td></td><td></td>'; 
    217217                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>&nbsp;</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>&nbsp;</td>'; 
    219219                newpage += fl.td+files[i].directory+'</td>'; 
    220220                if (preferences.mime_type =='1') newpage += fl.td+files[i].mime_type+'</td>'; 
     
    246246                { 
    247247                        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>'; 
    249249                                break; 
    250250                        case 'application/zip': 
     
    259259                else 
    260260                        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>'; 
    262262                if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>'; 
    263263                if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>'; 
     
    319319                var contentQuota = document.getElementById('content_quota'); 
    320320                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>'; 
    322322        } 
    323323} 
     
    335335                { 
    336336                        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">'; 
    338338                        newicon += '<div style="width:64; height:64; background-image:url('+files[i].icon+'); background-repeat: no-repeat;"></div>'; 
    339339                        newicon += '<span class="iconCaption">'+files[i].name+'</span>'; 
     
    483483                                        inputName.value = filename; 
    484484                                        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) }; 
    486486                                        inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); }; 
    487487                                        nameLink.parentNode.appendChild(inputName); 
     
    502502                                address = document.location.toString(); 
    503503                                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); 
    505505                        } 
    506506                        else 
     
    512512                case 'delete': 
    513513                        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='+ 
    515515                                        base64_encode(currentPath)+filesUrl,handler.del); 
    516516                        break; 
     
    530530                        } 
    531531                        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); 
    533533                        break; 
    534534                case 'move_to': 
     
    549549                        last_folder = last_folder ? last_folder : currentPath; 
    550550                        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); 
    552552                        return; 
    553553                case 'tools': 
    554554                        elements = new Array(); 
    555555                        elements[0] = { 'text' : get_lang('Preferences'), 
    556                                         'url' : 'preferences/preferences.php?appname=filemanager', 
     556                                        'url' : URL_SERVER + '/preferences/preferences.php?appname=filemanager', 
    557557                                        'img' : templatePath+'images/preferences.png'}; 
    558558                        elements[1] = { 'text' : get_lang('Search'), 
     
    564564                                        'img' : templatePath+'images/button_createdir.png'}; 
    565565                        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", 
    567567                                        'img' : templatePath+'images/mime16_directory.png'}; 
    568568                        elements[4] = { 'text' : get_lang('View'), 
     
    584584        if (password == null) 
    585585                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); 
    587587} 
    588588function 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); 
    590590} 
    591591function 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); 
    593593} 
    594594 
     
    597597        switch(type){ 
    598598                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); 
    600600                        var htmlData = '<img src=\"'+url+'\">'; 
    601601                        menuTimeout = setTimeout("draw_window_card(\'"+htmlData+"\')",500); 
    602602                        break; 
    603603                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); 
    605605                        menuTimeout = setTimeout("cExecute_('"+url+"',draw_window_card)",500); 
    606606                        break; 
     
    616616                { 
    617617                        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); 
    619619                        currentPath = parentDir+'/'+name; 
    620620                        close_window(); 
     
    626626                        if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), '')) 
    627627                        { 
    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); 
    629629                                var lastIndex = Dfolder.lastIndexOf('/'); 
    630630                                currentPath = Dfolder.substr(0,lastIndex); 
  • trunk/filemanager/js/global.js

    r2007 r2490  
    99var oldValue; 
    1010 
    11 var templatePath = './filemanager/templates/default/'; 
     11var templatePath = URL_SERVER + '/filemanager/templates/default/'; 
    1212 
    1313var menuTimeout; 
  • trunk/filemanager/templates/default/main.tpl

    r2000 r2490  
    1212                        <div id="search_div" align="left" style="white-space:nowrap"> 
    1313                        <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"> 
    1515                        </div> 
    1616                        <table border="0" cellspacing="0" cellpadding="0" border="0" style="width:100%"> 
Note: See TracChangeset for help on using the changeset viewer.