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 <?php
if(!isset($_)){//allow the template to be loaded standalone if(!isset($_)){//allow the template to be loaded standalone
require_once '../../../lib/base.php';
$tmpl = new OCP\Template( 'media', 'player'); $tmpl = new OCP\Template( 'media', 'player');
$tmpl->printPage(); $tmpl->printPage();
exit; exit;

View File

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