diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 37 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 4 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 1 | ||||
-rw-r--r-- | core/templates/layout.user.php | 1 |
4 files changed, 32 insertions, 11 deletions
diff --git a/core/js/js.js b/core/js/js.js index 019c40a0e1b..12303d7dd91 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -31,8 +31,9 @@ t.cache={}; OC={ webroot:oc_webroot, + appswebroot:oc_appswebroot, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, - coreApps:['files','admin','log','search','settings','core','3rdparty'], + coreApps:['admin','log','search','settings','core','3rdparty'], /** * get an absolute url to a file in an appen * @param app the id of the app the file belongs to @@ -51,16 +52,34 @@ OC={ */ filePath:function(app,type,file){ var isCore=OC.coreApps.indexOf(app)!=-1; - app+='/'; - var link=OC.webroot+'/'; - if(!isCore){ + var link=OC.webroot; + if((file.substring(file.length-3) == 'php' || file.substring(file.length-3) == 'css') && !isCore){ + link+='/?app=' + app + '&getfile='; + if(type){ + link+=encodeURI(type + '/'); + } + link+= file; + }else if(file.substring(file.length-3) != 'php' && !isCore){ + link=OC.appswebroot; + link+='/'; link+='apps/'; + link+=app+'/'; + if(type){ + link+=type+'/'; + } + link+=file; + }else{ + link+='/'; + app+='/'; + if(!isCore){ + link+='apps/'; + } + link+=app; + if(type){ + link+=type+'/'; + } + link+=file; } - link+=app; - if(type){ - link+=type+'/'; - } - link+=file; return link; }, /** diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index a3aa1e8c149..6a3dac02ea7 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -107,7 +107,7 @@ OCdialogs = { $(c_id + ' #dirtree').focus(function() { var t = $(this); t.data('oldval', t.val())}) .change({dcid: c_id}, OC.dialogs.handleTreeListSelect); $(c_id).ready(function(){ - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)}); }).data('multiselect', multiselect).data('mimetype',mimetype_filter); // build buttons var b = [ @@ -222,7 +222,7 @@ OCdialogs = { $(this).children().each(function(i, element) { if (skip_first) {skip_first = false; return; }path += '/'+$(element).text(); }); $(event.data.dcid).data('path', path); $(event.data.dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); }, // this function is in early development state, please dont use it unlsess you know what you are doing handlePickerClick:function(element, name, dcid) { diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 2bd2e20df70..7ba7abdbf12 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -9,6 +9,7 @@ <?php endforeach; ?> <script type="text/javascript"> var oc_webroot = '<?php echo OC::$WEBROOT; ?>'; + var oc_appswebroot = '<?php echo OC::$APPSWEBROOT; ?>'; </script> <?php foreach($_['jsfiles'] as $jsfile): ?> <script type="text/javascript" src="<?php echo $jsfile; ?>"></script> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 61eb0de9f42..df7897717f6 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -9,6 +9,7 @@ <?php endforeach; ?> <script type="text/javascript"> var oc_webroot = '<?php echo OC::$WEBROOT; ?>'; + var oc_appswebroot = '<?php echo OC::$APPSWEBROOT; ?>'; var oc_current_user = '<?php echo OC_User::getUser() ?>'; </script> <?php foreach($_['jsfiles'] as $jsfile): ?> |