summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-02 22:30:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-02 22:30:24 +0100
commit1291303c5a312fad9f01fbaf22cc21e3b9b3675d (patch)
treec1e46efc7589c3101a8c3806ecc3112c8f3e2849 /settings
parent88c9ae129e7dcc0e10aee682c8d4fa31b93b614c (diff)
downloadnextcloud-server-1291303c5a312fad9f01fbaf22cc21e3b9b3675d.tar.gz
nextcloud-server-1291303c5a312fad9f01fbaf22cc21e3b9b3675d.zip
Replace OC.Router.generate() with OC.generateUrl()
Diffstat (limited to 'settings')
-rw-r--r--settings/js/admin.js2
-rw-r--r--settings/js/personal.js10
-rw-r--r--settings/js/users.js5
-rw-r--r--settings/routes.php2
4 files changed, 11 insertions, 8 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index 5ea6a5af2df..cfb1cb788d0 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -64,7 +64,7 @@ $(document).ready(function(){
$('#mail_settings').change(function(){
OC.msg.startSaving('#mail_settings .msg');
var post = $( "#mail_settings" ).serialize();
- $.post(OC.Router.generate('settings_mail_settings'), post, function(data){
+ $.post(OC.generateUrl('/settings/admin/mailsettings'), post, function(data){
OC.msg.finishedSaving('#mail_settings .msg', data);
});
});
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 98bfe7132d4..7a4257f1c97 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -67,7 +67,7 @@ function showAvatarCropper() {
$cropper.prepend("<img>");
$cropperImage = $('#cropper img');
- $cropperImage.attr('src', OC.Router.generate('core_avatar_get_tmp')+'?requesttoken='+oc_requesttoken+'#'+Math.floor(Math.random()*1000));
+ $cropperImage.attr('src', OC.generateUrl('/avatar/tmp')+'?requesttoken='+oc_requesttoken+'#'+Math.floor(Math.random()*1000));
// Looks weird, but on('load', ...) doesn't work in IE8
$cropperImage.ready(function(){
@@ -95,7 +95,7 @@ function sendCropData() {
w: cropperdata.w,
h: cropperdata.h
};
- $.post(OC.Router.generate('core_avatar_post_cropped'), {crop: data}, avatarResponseHandler);
+ $.post(OC.generateUrl('/avatar/cropped'), {crop: data}, avatarResponseHandler);
}
function saveCoords(c) {
@@ -132,7 +132,7 @@ $(document).ready(function(){
$('#passwordchanged').hide();
$('#passworderror').hide();
// Ajax foo
- $.post(OC.Router.generate('settings_personal_changepassword'), post, function(data){
+ $.post(OC.generateUrl('/settings/personal/changepassword'), post, function(data){
if( data.status === "success" ){
$('#pass1').val('');
$('#pass2').val('');
@@ -243,7 +243,7 @@ $(document).ready(function(){
OC.dialogs.filepicker(
t('settings', "Select a profile picture"),
function(path){
- $.post(OC.Router.generate('core_avatar_post'), {path: path}, avatarResponseHandler);
+ $.post(OC.generateUrl('/avatar/'), {path: path}, avatarResponseHandler);
},
false,
["image/png", "image/jpeg"]
@@ -253,7 +253,7 @@ $(document).ready(function(){
$('#removeavatar').click(function(){
$.ajax({
type: 'DELETE',
- url: OC.Router.generate('core_avatar_delete'),
+ url: OC.generateUrl('/avatar/'),
success: function(msg) {
updateAvatar(true);
}
diff --git a/settings/js/users.js b/settings/js/users.js
index 160d0a8d9d2..6b5447c7674 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -225,7 +225,8 @@ var UserList = {
}
$('table+.loading').css('visibility', 'visible');
UserList.updating = true;
- $.get(OC.Router.generate('settings_ajax_userlist', { offset: UserList.offset, limit: UserList.usersToLoad }), function (result) {
+ var query = $.param({ offset: UserList.offset, limit: UserList.usersToLoad });
+ $.get(OC.generateUrl('/settings/ajax/userlist') + query, function (result) {
var loadedUsers = 0;
var trs = [];
if (result.status === 'success') {
@@ -401,7 +402,7 @@ $(document).ready(function () {
if ($(this).val().length > 0) {
var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val();
$.post(
- OC.Router.generate('settings_users_changepassword'),
+ OC.generateUrl('/settings/users/changepassword'),
{username: uid, password: $(this).val(), recoveryPassword: recoveryPasswordVal},
function (result) {
if (result.status != 'success') {
diff --git a/settings/routes.php b/settings/routes.php
index 64f7122f0cf..7d94f130088 100644
--- a/settings/routes.php
+++ b/settings/routes.php
@@ -6,6 +6,8 @@
* See the COPYING-README file.
*/
+/** @var $this OC_Router */
+
// Settings pages
$this->create('settings_help', '/settings/help')
->actionInclude('settings/help.php');