diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-18 07:56:42 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-18 07:56:42 +0100 |
commit | 228a75e2ec467770dcfea92e02cd29a63b4dbdd6 (patch) | |
tree | 610508e454d1fc23c1b3df7c36cc9fc191f44092 /lib | |
parent | d77019f566725a3f5e6e696c1e23797596e32090 (diff) | |
parent | 2a280e2fad5b69dd0e828ca168f0dcfcd0a1ae5d (diff) | |
download | nextcloud-server-228a75e2ec467770dcfea92e02cd29a63b4dbdd6.tar.gz nextcloud-server-228a75e2ec467770dcfea92e02cd29a63b4dbdd6.zip |
Merge pull request #21248 from owncloud/deprecated_oc_helper_linkToRoute
Replace deprecated OC_Helper::linkToRoute calls
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/app.php | 8 | ||||
-rw-r--r-- | lib/private/helper.php | 17 | ||||
-rw-r--r-- | lib/private/templatelayout.php | 4 | ||||
-rw-r--r-- | lib/public/util.php | 2 |
4 files changed, 9 insertions, 22 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index abf12264c58..e8cc9219224 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -380,7 +380,7 @@ class OC_App { array( "id" => "help", "order" => 1000, - "href" => OC_Helper::linkToRoute("settings_help"), + "href" => \OC::$server->getURLGenerator()->linkToRoute('settings_help'), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath("settings", "help.svg") ) @@ -393,7 +393,7 @@ class OC_App { $settings[] = array( "id" => "personal", "order" => 1, - "href" => OC_Helper::linkToRoute("settings_personal"), + "href" => \OC::$server->getURLGenerator()->linkToRoute('settings_personal'), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath("settings", "personal.svg") ); @@ -409,7 +409,7 @@ class OC_App { $settings[] = array( "id" => "core_users", "order" => 2, - "href" => OC_Helper::linkToRoute("settings_users"), + "href" => \OC::$server->getURLGenerator()->linkToRoute('settings_users'), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath("settings", "users.svg") ); @@ -421,7 +421,7 @@ class OC_App { $settings[] = array( "id" => "admin", "order" => 1000, - "href" => OC_Helper::linkToRoute("settings_admin"), + "href" => \OC::$server->getURLGenerator()->linkToRoute('settings_admin'), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath("settings", "admin.svg") ); diff --git a/lib/private/helper.php b/lib/private/helper.php index 779a67a2340..1c3b1064ffa 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -54,19 +54,6 @@ class OC_Helper { private static $templateManager; /** - * Creates an url using a defined route - * @param string $route - * @param array $parameters with param=>value, will be appended to the returned url - * @return string the url - * @deprecated Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters) - * - * Returns a url to the given app and file. - */ - public static function linkToRoute($route, $parameters = array()) { - return OC::$server->getURLGenerator()->linkToRoute($route, $parameters); - } - - /** * Creates an absolute url * @param string $app app * @param string $file file @@ -170,11 +157,11 @@ class OC_Helper { * Returns the path to the preview of the file. */ public static function previewIcon($path) { - return self::linkToRoute( 'core_ajax_preview', array('x' => 32, 'y' => 32, 'file' => $path )); + return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_preview', ['x' => 32, 'y' => 32, 'file' => $path]); } public static function publicPreviewIcon( $path, $token ) { - return self::linkToRoute( 'core_ajax_public_preview', array('x' => 32, 'y' => 32, 'file' => $path, 't' => $token)); + return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_public_preview', ['x' => 32, 'y' => 32, 'file' => $path, 't' => $token]); } /** diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index fce018115ac..95688268c47 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -165,14 +165,14 @@ class OC_TemplateLayout extends OC_Template { $useAssetPipeline = self::isAssetPipelineEnabled(); if ($useAssetPipeline) { - $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash))); + $this->append( 'jsfiles', \OC::$server->getURLGenerator()->linkToRoute('js_config', ['v' => self::$versionHash])); $this->generateAssets(); } else { // Add the js files $jsFiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array()); if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') { - $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config', array('v' => self::$versionHash))); + $this->append( 'jsfiles', \OC::$server->getURLGenerator()->linkToRoute('js_config', ['v' => self::$versionHash])); } foreach($jsFiles as $info) { $web = $info[1]; diff --git a/lib/public/util.php b/lib/public/util.php index e0c875438f2..da4aa6e9deb 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -302,7 +302,7 @@ class Util { * @since 5.0.0 */ public static function linkToRoute( $route, $parameters = array() ) { - return \OC_Helper::linkToRoute($route, $parameters); + return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters); } /** |