diff --git a/code/CMSMain.php b/code/CMSMain.php index f714b7bd..efb8770f 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -30,14 +30,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'addmember', 'addpage', 'buildbrokenlinks', - 'canceldraftchangesdialog', 'compareversions', 'createtranslation', 'delete', 'deletefromlive', 'deleteitems', 'DeleteItemsForm', - 'dialog', 'duplicate', 'duplicatewithchildren', 'getpagecount', @@ -965,43 +963,6 @@ JS; ); } } - - function dialog() { - Requirements::clear(); - - $buttons = new DataObjectSet; - if($_REQUEST['Buttons']) foreach($_REQUEST['Buttons'] as $button) { - list($name, $title) = explode(',',$button,2); - $buttons->push(new ArrayData(array( - "Name" => $name, - "Title" => $title, - ))); - } - - return array( - "Message" => htmlentities($_REQUEST['Message']), - "Buttons" => $buttons, - "Modal" => $_REQUEST['Modal'] ? true : false, - ); - } - - function canceldraftchangesdialog() { - Requirements::clear(); - Requirements::css(CMS_DIR . 'css/dialog.css'); - Requirements::javascript(THIRDPARTY_DIR . '/prototype.js'); - Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js'); - Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js'); - Requirements::javascript(CMS_DIR . '/javascript/dialog.js'); - - $message = _t('CMSMain.COPYPUBTOSTAGE',"Do you really want to copy the published content to the stage site?"); - $buttons = ""; - - return $this->customise( array( - 'Message' => $message, - 'Buttons' => $buttons, - 'DialogType' => 'alert' - ))->renderWith('Dialog'); - } /** * Batch Actions Handler diff --git a/css/dialog.css b/css/dialog.css deleted file mode 100644 index f43b9ee7..00000000 --- a/css/dialog.css +++ /dev/null @@ -1,18 +0,0 @@ -p.message { - /*background: url(../cms/images/dialogs/alert.gif) repeat top left;*/ - padding-left: 60px; -} - -img { - float: left; - margin-left: -60px; -} - -span { - clear: right; -} - -body { - font-family: Arial, sans-serif; - font-size: 1em; -} \ No newline at end of file diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 5a1d2d82..391b5e35 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -661,96 +661,6 @@ ModalForm.prototype = { } } - -function doYouWantToRollback(handlers) { - var url = document.getElementsByTagName('base')[0].href + 'admin/canceldraftchangesdialog'; - OpenModalDialog(url, handlers, 'Are you sure?' ); -} - -function modalDialog(url, handlers) { - var baseURL = document.getElementsByTagName('base')[0].href; - if(window.showModalDialog) { - var result = showModalDialog(baseURL + url + '&Modal=1', null, "status:no;dialogWidth:400px;dialogHeight:150px;edge:sunken"); - if(handlers[result]) - handlers[result](); - - } -} - - -ModalDialog = Class.create(); -ModalDialog.prototype = { - initialize: function(url, handlers) { - this.url = url; - this.handlers = handlers; - this.timer = setInterval(this.interval.bind(this), 50); - this.window = window.open(this.url, 'dialog', "status=no,width=400,height=150,edge=sunken"); - this.window.dialogObject = this; - this.window.linkedObject = this; - setTimeout( (function(){this.window.linkedObject = this;}).bind(this), 500); - }, - force: function (val) { - this.finished = true; - this.clearInterval(this.time); - - if(this.handlers[val]) { - _DO_YOU_WANT_TO_SAVE_IS_OPEN = false; - (this.handlers[val])(); - } else { - throw("Couldn't find a handler called '" + this.result + "'"); - } - }, - interval: function() { - if(this.finished) { - clearInterval(this.timer); - return; - } - if(!this.window || this.window.closed) { - clearInterval(this.timer); - if(this.handlers) { - if(this.handlers[this.result]) { - _DO_YOU_WANT_TO_SAVE_IS_OPEN = false; - (this.handlers[this.result])(); - - } else { - throw("Couldn't find a handler called '" + this.result + "'"); - } - } - } else { - this.window.focus(); - } - } -} - -window.top._OPEN_DIALOG = null; - -OpenModalDialog = function( url, handlers, message ) { - var dialog = new GBModalDialog( url, handlers, message ); -} - -GBModalDialog = Class.create(); -GBModalDialog.prototype = { - - initialize: function( url, handlers, message ) { - this.url = url; - this.handlers = handlers; - this.caption = message; - - window.top._OPEN_DIALOG = this; - - GB_show( this.caption, this.url, 110, 450 ); - }, - - execHandler: function( handler ) { - GB_hide(); - - if( this.handlers[handler] ) - this.handlers[handler](); - else - throw( "Unknown handler '" + handler + "'" ); - } -} - function hideLoading() { if($('Loading')) $('Loading').style.display = 'none'; Element.removeClassName(document.body, 'stillLoading'); diff --git a/javascript/dialog.js b/javascript/dialog.js deleted file mode 100644 index 746def9b..00000000 --- a/javascript/dialog.js +++ /dev/null @@ -1,10 +0,0 @@ -Behaviour.register({ - '.buttons button' : { - onclick: function() { - window.top._OPEN_DIALOG.execHandler( this.name ); - - return false; - } - - } -}); \ No newline at end of file diff --git a/templates/CMSMain_dialog.ss b/templates/CMSMain_dialog.ss deleted file mode 100755 index 606e770e..00000000 --- a/templates/CMSMain_dialog.ss +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -

$Message

- -

-<% control Buttons %> - -<% end_control %> -

- - - \ No newline at end of file diff --git a/templates/Dialog.ss b/templates/Dialog.ss deleted file mode 100644 index f1bf248c..00000000 --- a/templates/Dialog.ss +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -<% base_tag %> -$Title - - -

$Message

-
- $Buttons -
- - \ No newline at end of file