33using System . Web . Mvc ;
44using SmartStore . Admin . Models . Topics ;
55using SmartStore . Core . Domain . Topics ;
6+ using SmartStore . Core . Events ;
67using SmartStore . Services . Localization ;
78using SmartStore . Services . Security ;
89using SmartStore . Services . Stores ;
910using SmartStore . Services . Topics ;
1011using SmartStore . Web . Framework . Controllers ;
12+ using SmartStore . Web . Framework . Mvc ;
1113using Telerik . Web . Mvc ;
1214
1315namespace SmartStore . Admin . Controllers
@@ -24,6 +26,7 @@ public class TopicController : AdminControllerBase
2426 private readonly IPermissionService _permissionService ;
2527 private readonly IStoreService _storeService ;
2628 private readonly IStoreMappingService _storeMappingService ;
29+ private readonly IEventPublisher _eventPublisher ;
2730
2831 #endregion Fields
2932
@@ -32,7 +35,7 @@ public class TopicController : AdminControllerBase
3235 public TopicController ( ITopicService topicService , ILanguageService languageService ,
3336 ILocalizedEntityService localizedEntityService , ILocalizationService localizationService ,
3437 IPermissionService permissionService , IStoreService storeService ,
35- IStoreMappingService storeMappingService )
38+ IStoreMappingService storeMappingService , IEventPublisher eventPublisher )
3639 {
3740 this . _topicService = topicService ;
3841 this . _languageService = languageService ;
@@ -41,6 +44,7 @@ public TopicController(ITopicService topicService, ILanguageService languageServ
4144 this . _permissionService = permissionService ;
4245 this . _storeService = storeService ;
4346 this . _storeMappingService = storeMappingService ;
47+ this . _eventPublisher = eventPublisher ;
4448 }
4549
4650 #endregion
@@ -221,7 +225,8 @@ public ActionResult Edit(int id)
221225 }
222226
223227 [ HttpPost , ParameterBasedOnFormNameAttribute ( "save-continue" , "continueEditing" ) ]
224- public ActionResult Edit ( TopicModel model , bool continueEditing )
228+ [ ValidateInput ( false ) ]
229+ public ActionResult Edit ( TopicModel model , bool continueEditing , FormCollection form )
225230 {
226231 if ( ! _permissionService . Authorize ( StandardPermissionProvider . ManageTopics ) )
227232 return AccessDeniedView ( ) ;
@@ -247,7 +252,9 @@ public ActionResult Edit(TopicModel model, bool continueEditing)
247252
248253 //locales
249254 UpdateLocales ( topic , model ) ;
250-
255+
256+ _eventPublisher . Publish ( new ModelBoundEvent ( model , topic , form ) ) ;
257+
251258 NotifySuccess ( _localizationService . GetResource ( "Admin.ContentManagement.Topics.Updated" ) ) ;
252259 return continueEditing ? RedirectToAction ( "Edit" , topic . Id ) : RedirectToAction ( "List" ) ;
253260 }
0 commit comments