Changeset 1475 for ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as
- Timestamp:
- 07/27/11 13:55:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as
r1473 r1475 105 105 // Private components that are in updated require usage check call. If in use, the user can choose whether or not to save the changes . 106 106 if(inUserSpace && uploadAction == UploadService.UPDATE && !item.isProfile){ 107 checkUsage(item );107 checkUsage(item, inUserSpace); 108 108 }else{ 109 109 doUpload(uploadAction,item); … … 117 117 * Calls usage check for the specified component. If in use, asks user whether to proceed; if positive, initiates update. 118 118 */ 119 private function checkUsage(item:ItemDescription, uploadAction:int = UploadService.UPDATE):void{120 var componentUsageService:ComponentUsageService = new ComponentUsageService(item );119 private function checkUsage(item:ItemDescription, inUserSpace:Boolean = true, uploadAction:int = UploadService.UPDATE):void{ 120 var componentUsageService:ComponentUsageService = new ComponentUsageService(item,inUserSpace); 121 121 componentUsageService.addEventListener(ComponentUsageCheckEvent.COMPONENT_IN_USE, 122 122 function (event:ComponentUsageCheckEvent):void{ 123 123 if(event.isComponentInUse){ 124 Alert.show("Component is used by other components and/or profiles. Changes in this component will affect these. Do you want to proceed?","Component is used", Alert.YES|Alert.NO,null, 124 var messageBody:String = "The component you are about to save is used by the following component(s) and/or profile(s):\n\n"; 125 for each(var name:String in event.itemUsingComponent){ 126 messageBody += " - " + name + "\n"; 127 } 128 messageBody += "\nChanges in this component will affect the above. Do you want to proceed?"; 129 Alert.show(messageBody,"Component is used", Alert.YES|Alert.NO,null, 125 130 function (eventObj:CloseEvent):void{ 126 131 if(eventObj.detail == Alert.YES){
Note: See TracChangeset
for help on using the changeset viewer.