lib/private/URLGenerator.php
/**
	 * Creates an url
	 * @param string $app app
	 * @param string $file file
	 * @param array $args array with param=>value, will be appended to the returned url
	 *    The value of $args will be urlencoded
	 * @return string the url
	 *
	 * Returns a url to the given app and file.
	 */
Creates an url
@param string $app app
@param string $file file
@param array $args array with param=>value, will be appended to the returned url
The value of $args will be urlencoded
@return string the url

Returns a url to the given app and file.
Creates an url @param string $app app @param string $file file @param array $args array with param = > value will be appended to the returned url The value of $args will be urlencoded @return string the url Returns a url to the given app and file .
public function linkTo( $app, $file, $args = array() ) {
		$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
		if( $app != '' ) {
			$app_path = \OC_App::getAppPath($app);
			if ($app_path && file_exists($app_path . '/' . $file)) {
				if (substr($file, -3) == 'php') {
					$urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $app;
					if ($frontControllerActive) {
						$urlLinkTo = \OC::$WEBROOT . '/apps/' . $app;
					}
					$urlLinkTo .= ($file != 'index.php') ? '/' . $file : '';
				} else {
					$urlLinkTo = \OC_App::getAppWebPath($app) . '/' . $file;
				}
			} else {
				$urlLinkTo = \OC::$WEBROOT . '/' . $app . '/' . $file;
			}
		} else {
			if (file_exists(\OC::$SERVERROOT . '/core/' . $file)) {
				$urlLinkTo = \OC::$WEBROOT . '/core/' . $file;
			} else {
				if ($frontControllerActive && $file === 'index.php') {
					$urlLinkTo = \OC::$WEBROOT . '/';
				} else {
					$urlLinkTo = \OC::$WEBROOT . '/' . $file;
				}
			}
		}
		if ($args && $query = http_build_query($args, '', '&')) {
			$urlLinkTo .= '?' . $query;
		}
		return $urlLinkTo;
	}
public function linkTo ( $ app , $ file , $ args = array ( ) ) { $ frontControllerActive = ( $ this -> config -> getSystemValue ( 'htaccess.IgnoreFrontController' , false ) === true || getenv ( 'front_controller_active' ) === 'true' ) ; if ( $ app != '' ) { $ app_path = \ OC_App :: getAppPath ( $ app ) ; if ( $ app_path && file_exists ( $ app_path . '/' . $ file ) ) { if ( substr ( $ file , - 3 ) == 'php' ) { $ urlLinkTo = \ OC :: $ WEBROOT . '/index.php/apps/' . $ app ; if ( $ frontControllerActive ) { $ urlLinkTo = \ OC :: $ WEBROOT . '/apps/' . $ app ; } $ urlLinkTo .= ( $ file != 'index.php' ) ? '/' . $ file : '' ; } else { $ urlLinkTo = \ OC_App :: getAppWebPath ( $ app ) . '/' . $ file ; } } else { $ urlLinkTo = \ OC :: $ WEBROOT . '/' . $ app . '/' . $ file ; } } else { if ( file_exists ( \ OC :: $ SERVERROOT . '/core/' . $ file ) ) { $ urlLinkTo = \ OC :: $ WEBROOT . '/core/' . $ file ; } else { if ( $ frontControllerActive && $ file === 'index.php' ) { $ urlLinkTo = \ OC :: $ WEBROOT . '/' ; } else { $ urlLinkTo = \ OC :: $ WEBROOT . '/' . $ file ; } } } if ( $ args && $ query = http_build_query ( $ args , '' , '&' ) ) { $ urlLinkTo .= '?' . $ query ; } return $ urlLinkTo ; }
Creates an url
 @param string $app app
 @param string $file file
 @param array $args array with param=>value, will be appended to the returned url
    The value of $args will be urlencoded
 @return string the url
Creates an url @param string $app app @param string $file file @param array $args array with param = > value will be appended to the returned url The value of $args will be urlencoded @return string the url
// Check if the app is in the app folder