*
* Returns a url to the given app and file.
*/
- public static function linkTo($app, $file, $args = array()) {
- if ($app != '') {
+ public static function linkTo( $app, $file, $args = array() ) {
+ if( $app != '' ) {
$app_path = OC_App::getAppPath($app);
// Check if the app is in the app folder
- if( $app_path && file_exists( $app_path.'/'.$file )) {
- if(substr($file, -3) == 'php' || substr($file, -3) == 'css') {
- $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app;
- $urlLinkTo .= ($file!='index.php') ? '/' . $file : '';
- }else{
- $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file;
+ if ($app_path && file_exists($app_path . '/' . $file)) {
+ if (substr($file, -3) == 'php' || substr($file, -3) == 'css') {
+ $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app;
+ $urlLinkTo .= ($file != 'index.php') ? '/' . $file : '';
+ } else {
+ $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file;
}
+ } else {
+ $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file;
}
- else{
- $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file;
- }
- }
- else{
- if( file_exists( OC::$SERVERROOT . '/core/'. $file )) {
- $urlLinkTo = OC::$WEBROOT . '/core/'.$file;
- }
- else{
- $urlLinkTo = OC::$WEBROOT . '/'.$file;
+ } else {
+ if (file_exists(OC::$SERVERROOT . '/core/' . $file)) {
+ $urlLinkTo = OC::$WEBROOT . '/core/' . $file;
+ } else {
+ $urlLinkTo = OC::$WEBROOT . '/' . $file;
}
}
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
}
- if($freeSpace !== \OC\Files\SPACE_UNKNOWN){
- if ($freeSpace !== \OC\Files\FREE_SPACE_UNKNOWN) {
++ if ($freeSpace !== \OC\Files\SPACE_UNKNOWN) {
$freeSpace = max($freeSpace, 0);
return min($maxUploadFilesize, $freeSpace);