You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MODx.msg.confirm (http://rtfm.modx.com/display/revolution20/MODx.msg) only allows for success, failure, and cancel events, but that greatly restricts the type of messaging that is possible using Ext JS MessageBoxes. In particular, it would be helpful to implement some other messaging vectors for plugins that fire on various system events, e.g. OnBeforeDocFormSave could pop up a warning window or an info window, or a confirmation window.
See /manager/assets/modext/core/modx.js around line 520:
showError: function(e) {
if (e === '') {
MODx.msg.hide();
} else {
MODx.msg.alert(_('error'),e,Ext.emptyFn);
}
}
This would require that the values returned from the OnBeforeDocFormSave and similar events be allowed to set a status when they set a message to $modx->event->output(). E.g. maybe add an argument to core/model/modx/modx.class.php:
public function output($output, $status=null) {
$this->_output .= $output;
}
Then this would have to trickle down into fireBeforeSaveEvent() function inside the modprocessor.class.php -- it'd be a lot of work to change this. It looks like in some cases, event output is expected to be an array (e.g. an array of error messages), so it might not be a stretch to make it an array of hashes, where each message could include some meta data about it (primarily what kind of message it is: error, warning, etc).
MODx.msg.confirm (http://rtfm.modx.com/display/revolution20/MODx.msg) only allows for success, failure, and cancel events, but that greatly restricts the type of messaging that is possible using Ext JS MessageBoxes. In particular, it would be helpful to implement some other messaging vectors for plugins that fire on various system events, e.g. OnBeforeDocFormSave could pop up a warning window or an info window, or a confirmation window.
See /manager/assets/modext/core/modx.js around line 520:
This would require that the values returned from the OnBeforeDocFormSave and similar events be allowed to set a status when they set a message to $modx->event->output(). E.g. maybe add an argument to core/model/modx/modx.class.php:
Then this would have to trickle down into fireBeforeSaveEvent() function inside the modprocessor.class.php -- it'd be a lot of work to change this. It looks like in some cases, event output is expected to be an array (e.g. an array of error messages), so it might not be a stretch to make it an array of hashes, where each message could include some meta data about it (primarily what kind of message it is: error, warning, etc).
h2. See Also
Originally by everettg_99 on 2013-06-18T14:50:34Z
Redmine ID: 9982
The text was updated successfully, but these errors were encountered: