change WebGUI.Admin.prototype.processPlugin, which handles messages back from calls to AssetHelper classes, to do any number of little chores according to the message contents rather than just the first one it tests for.

change the Lock AssetHelper to both refresh and display a message indicating that the asset is locked.  the refresh is needed for tree view which displays a little icon.
This commit is contained in:
Scott Walters 2013-09-26 21:23:05 -05:00
parent d8ccdecff5
commit d32d452efe
2 changed files with 12 additions and 10 deletions

View file

@ -55,6 +55,7 @@ sub process {
$asset->addRevision;
return {
message => sprintf($i18n->get('locked asset'), $asset->getTitle),
reload => 1,
};
}

View file

@ -745,33 +745,34 @@ WebGUI.Admin.prototype.requestHelper
*/
WebGUI.Admin.prototype.processPlugin
= function ( resp ) {
if( ! ( resp.openTab || resp.openDialog || resp.scriptFile || resp.message || resp.error || resp.forkId || resp.redirect || resp.reload ) ) {
alert( "Unknown plugin response: " + YAHOO.lang.JSON.stringify(resp) );
return;
}
if ( resp.openTab ) {
this.openTab( resp.openTab );
}
else if ( resp.openDialog ) {
if ( resp.openDialog ) {
this.openModalDialog( resp.openDialog, resp.width, resp.height );
}
else if ( resp.scriptFile ) {
if ( resp.scriptFile ) {
this.loadAndRun( resp.scriptFile, resp.scriptFunc, resp.scriptArgs );
}
else if ( resp.message ) {
if ( resp.message ) {
this.showInfoMessage( resp.message );
}
else if ( resp.error ) {
if ( resp.error ) {
this.showInfoMessage( resp.error );
}
else if ( resp.forkId ) {
if ( resp.forkId ) {
this.openForkDialog( resp.forkId );
}
else if ( resp.redirect ) {
if ( resp.redirect ) {
this.gotoAsset( resp.redirect );
}
else if ( resp.reload ) {
if ( resp.reload ) {
this.reload();
}
else {
alert( "Unknown plugin response: " + YAHOO.lang.JSON.stringify(resp) );
}
this.requestUpdateClipboard(); // always do this
};