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:
parent
d8ccdecff5
commit
d32d452efe
2 changed files with 12 additions and 10 deletions
|
|
@ -55,6 +55,7 @@ sub process {
|
||||||
$asset->addRevision;
|
$asset->addRevision;
|
||||||
return {
|
return {
|
||||||
message => sprintf($i18n->get('locked asset'), $asset->getTitle),
|
message => sprintf($i18n->get('locked asset'), $asset->getTitle),
|
||||||
|
reload => 1,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -745,33 +745,34 @@ WebGUI.Admin.prototype.requestHelper
|
||||||
*/
|
*/
|
||||||
WebGUI.Admin.prototype.processPlugin
|
WebGUI.Admin.prototype.processPlugin
|
||||||
= function ( resp ) {
|
= 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 ) {
|
if ( resp.openTab ) {
|
||||||
this.openTab( resp.openTab );
|
this.openTab( resp.openTab );
|
||||||
}
|
}
|
||||||
else if ( resp.openDialog ) {
|
if ( resp.openDialog ) {
|
||||||
this.openModalDialog( resp.openDialog, resp.width, resp.height );
|
this.openModalDialog( resp.openDialog, resp.width, resp.height );
|
||||||
}
|
}
|
||||||
else if ( resp.scriptFile ) {
|
if ( resp.scriptFile ) {
|
||||||
this.loadAndRun( resp.scriptFile, resp.scriptFunc, resp.scriptArgs );
|
this.loadAndRun( resp.scriptFile, resp.scriptFunc, resp.scriptArgs );
|
||||||
}
|
}
|
||||||
else if ( resp.message ) {
|
if ( resp.message ) {
|
||||||
this.showInfoMessage( resp.message );
|
this.showInfoMessage( resp.message );
|
||||||
}
|
}
|
||||||
else if ( resp.error ) {
|
if ( resp.error ) {
|
||||||
this.showInfoMessage( resp.error );
|
this.showInfoMessage( resp.error );
|
||||||
}
|
}
|
||||||
else if ( resp.forkId ) {
|
if ( resp.forkId ) {
|
||||||
this.openForkDialog( resp.forkId );
|
this.openForkDialog( resp.forkId );
|
||||||
}
|
}
|
||||||
else if ( resp.redirect ) {
|
if ( resp.redirect ) {
|
||||||
this.gotoAsset( resp.redirect );
|
this.gotoAsset( resp.redirect );
|
||||||
}
|
}
|
||||||
else if ( resp.reload ) {
|
if ( resp.reload ) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
alert( "Unknown plugin response: " + YAHOO.lang.JSON.stringify(resp) );
|
|
||||||
}
|
|
||||||
this.requestUpdateClipboard(); // always do this
|
this.requestUpdateClipboard(); // always do this
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue