From ecbd5f89c071e35ced5736466b4d7899a4459a14 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 4 Feb 2010 04:39:58 +0000 Subject: [PATCH] API CHANGE Security::permissionFailure(); will no longer tell the client side JS to show the login box if the user is already logged in ENHANCEMENT added canAddTopLevel permission to SiteConfig to determine which users/groups can add pages to the root of the sitetree. (from r87279) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98159 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CMSMain_left.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/javascript/CMSMain_left.js b/javascript/CMSMain_left.js index 70937bf6..51b8cfb6 100755 --- a/javascript/CMSMain_left.js +++ b/javascript/CMSMain_left.js @@ -128,21 +128,19 @@ addpageclass.prototype = { if( !_NEW_PAGES[parentID] ) _NEW_PAGES[parentID] = 1; - + var suffix = _NEW_PAGES[parentID]++; Ajax.SubmitForm(_HANDLER_FORMS.addpage, "action_addpage", { onSuccess : Ajax.Evaluator, - onFailure : this.showAddPageError, + onFailure : function(response) { if (response.status == 403) { + alert('You cannot add that page at that location.'); + }}, extraData: '&Suffix=' + suffix }); } return false; }, - - showAddPageError: function(response) { - errorMessage(ss.i18n._t('CMSMAIN.ERRORADDINGPAGE'), response); - } }; /**