Add _is_deleted status message to Controller and prompt for button click after paste delete

This commit is contained in:
parthiv-m 2024-10-13 17:45:05 -04:00
parent d69d29f3a9
commit f2b60d3765
4 changed files with 26 additions and 8 deletions

View file

@ -67,6 +67,14 @@ class Controller
*/
private $_status = '';
/**
* status message
*
* @access private
* @var boolean
*/
private $_is_deleted = false;
/**
* JSON message
*
@ -309,6 +317,7 @@ class Controller
// Paste exists and deletion token is valid: Delete the paste.
$paste->delete();
$this->_status = 'Paste was properly deleted.';
$this->_is_deleted = true;
} else {
$this->_error = 'Wrong deletion token. Paste was not deleted.';
}
@ -412,6 +421,7 @@ class Controller
}
$page->assign('BASEPATH', I18n::_($this->_conf->getKey('basepath')));
$page->assign('STATUS', I18n::_($this->_status));
$page->assign('ISDELETED', I18n::_(json_encode($this->_is_deleted)));
$page->assign('VERSION', self::VERSION);
$page->assign('DISCUSSION', $this->_conf->getKey('discussion'));
$page->assign('OPENDISCUSSION', $this->_conf->getKey('opendiscussion'));