Skip to content

Commit f08440d

Browse files
Added event to topic editing
1 parent 2b7b4cf commit f08440d

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/Plugins/SmartStore.GoogleAnalytics/GoogleAnalyticPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace SmartStore.GoogleAnalytics
99
{
1010
/// <summary>
11-
/// Live person provider
11+
/// Google Analytics Plugin
1212
/// </summary>
1313
public class GoogleAnalyticPlugin : BasePlugin, IWidget, IConfigurable
1414
{

src/Presentation/SmartStore.Web/Administration/Controllers/TopicController.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
using System.Web.Mvc;
44
using SmartStore.Admin.Models.Topics;
55
using SmartStore.Core.Domain.Topics;
6+
using SmartStore.Core.Events;
67
using SmartStore.Services.Localization;
78
using SmartStore.Services.Security;
89
using SmartStore.Services.Stores;
910
using SmartStore.Services.Topics;
1011
using SmartStore.Web.Framework.Controllers;
12+
using SmartStore.Web.Framework.Mvc;
1113
using Telerik.Web.Mvc;
1214

1315
namespace 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
}

src/Presentation/SmartStore.Web/Administration/Models/Topics/TopicModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace SmartStore.Admin.Models.Topics
1313
{
1414
[Validator(typeof(TopicValidator))]
15-
public class TopicModel : EntityModelBase, ILocalizedModel<TopicLocalizedModel>
15+
public class TopicModel : TabbableModel, ILocalizedModel<TopicLocalizedModel>
1616
{
1717
#region widget zone names
1818
private readonly static string[] s_widgetZones = new string[] {

src/Presentation/SmartStore.Web/Administration/Views/Shared/EditorTemplates/Picture.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
var random = CommonHelper.GenerateRandomInteger();
99
var clientId = "picture" + random;
1010
var pictureService = EngineContext.Current.Resolve<SmartStore.Services.Media.IPictureService>();
11-
int pictureId = Model.HasValue ? Model.Value : 0; // codehint: sm-add
12-
var picture = pictureService.GetPictureById(pictureId); // codehint: sm-edit
11+
int pictureId = Model.HasValue ? Model.Value : 0;
12+
var picture = pictureService.GetPictureById(pictureId);
1313

14-
Html.AddScriptParts("~/bundles/fileupload");
15-
Html.AddCssFileParts("~/css/fileupload");
14+
Html.AddScriptParts("~/bundles/fileupload");
15+
Html.AddCssFileParts("~/css/fileupload");
1616
}
1717

1818
<div id="@clientId" class="fileupload" style="display: inline-block;">

0 commit comments

Comments
 (0)