Fix music file action i.e. click to play, make OC.filePath act like OC_Helper::linkTo() for index.php links

This commit is contained in:
Michael Gapczynski 2012-05-10 23:04:27 -04:00
parent 20d9a8b6a1
commit 59a2616105
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,5 @@
<?php
if(!isset($_)){//allow the template to be loaded standalone
require_once '../../../lib/base.php';
$tmpl = new OCP\Template( 'media', 'player');
$tmpl->printPage();
exit;

View File

@ -54,11 +54,14 @@ OC={
var isCore=OC.coreApps.indexOf(app)!=-1;
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+='/?app=' + app;
if (file != 'index.php') {
link+='&getfile=';
if(type){
link+=encodeURI(type + '/');
}
link+= file;
}
link+= file;
}else if(file.substring(file.length-3) != 'php' && !isCore){
link=OC.appswebroot;
link+='/';