Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated URL functions for OCP\Util #8811

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files/ajax/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

$data = array();
$baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';
$baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php') . '?dir=';

$permissions = $dirInfo->getPermissions();

Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/templates/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<input type="hidden" name="dir" id="dir" value="" />
<div class="hiddenuploadfield">
<input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]"
data-url="<?php p(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
data-url="<?php p(\OC::$server->getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" />
</div>
<?php endif; ?>

Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/lib/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,6 @@ public static function isEmpty($user) {
* @return string
*/
public static function preview_icon($path) {
return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path));
return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path));
}
}
2 changes: 1 addition & 1 deletion core/templates/untrustedDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?php p($l->t('Depending on your configuration, this button could also work to trust the domain:')); ?>
</p>
<p style="text-align:center;">
<a href="<?php print_unescaped(\OC::$server->getURLGenerator()->getAbsoluteURL(\OCP\Util::linkToRoute('settings.AdminSettings.index'))); ?>?trustDomain=<?php p($_['domain']); ?>" class="button">
<a href="<?php print_unescaped(\OC::$server->getURLGenerator()->getAbsoluteURL(\OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index'))); ?>?trustDomain=<?php p($_['domain']); ?>" class="button">
<?php p($l->t('Add "%s" as trusted domain', array($_['domain']))); ?>
</a>
</p>
Expand Down
39 changes: 0 additions & 39 deletions lib/public/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,33 +233,6 @@ public static function linkToPublic($service) {
return \OC_Helper::linkToPublic($service);
}

/**
* Creates an url using a defined route
* @param string $route
* @param array $parameters
* @internal param array $args with param=>value, will be appended to the returned url
* @return string the url
* @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
* @since 5.0.0
*/
public static function linkToRoute( $route, $parameters = array() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by those apps:

bildschirmfoto 2018-03-14 um 09 16 17

return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
}

/**
* Creates an url to the given app and file
* @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
* @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
* @since 4.0.0 - parameter $args was added in 4.5.0
*/
public static function linkTo( $app, $file, $args = array() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used by those apps:

bildschirmfoto 2018-03-14 um 09 16 49

return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
}

/**
* Returns the server host name without an eventual port number
* @return string the server hostname
Expand Down Expand Up @@ -307,18 +280,6 @@ public static function getDefaultEmailAddress($user_part) {
return $user_part.'@localhost.localdomain';
}

/**
* Creates path to an image
* @param string $app app
* @param string $image image name
* @return string the url
* @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image)
* @since 4.0.0
*/
public static function imagePath( $app, $image ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used by those apps:

bildschirmfoto 2018-03-14 um 09 17 14

return \OC::$server->getURLGenerator()->imagePath($app, $image);
}

/**
* Make a human file size (2048 to 2 kB)
* @param int $bytes file size in bytes
Expand Down