diff --git a/src/Plugins/SmartStore.AdManager/Content/admin.scss b/src/Plugins/SmartStore.AdManager/Content/admin.scss new file mode 100644 index 0000000000..073eb5e29e --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Content/admin.scss @@ -0,0 +1,2 @@ +/// + diff --git a/src/Plugins/SmartStore.AdManager/Content/icon.png b/src/Plugins/SmartStore.AdManager/Content/icon.png new file mode 100644 index 0000000000..ab6cf90c22 Binary files /dev/null and b/src/Plugins/SmartStore.AdManager/Content/icon.png differ diff --git a/src/Plugins/SmartStore.AdManager/Content/public.scss b/src/Plugins/SmartStore.AdManager/Content/public.scss new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Content/public.scss @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Controllers/AdManagerController.cs b/src/Plugins/SmartStore.AdManager/Controllers/AdManagerController.cs new file mode 100644 index 0000000000..6743f807b2 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Controllers/AdManagerController.cs @@ -0,0 +1,72 @@ +using SmartStore.AdManager.Models; +using SmartStore.AdManager.Settings; +using SmartStore.ComponentModel; +using SmartStore.Services; +using SmartStore.Services.Common; +using SmartStore.Web.Framework.Controllers; +using SmartStore.Web.Framework.Security; +using SmartStore.Web.Framework.Settings; +using System.Web.Mvc; + + + +namespace SmartStore.Controllers +{ + public class AdManagerController : AdminControllerBase + { + private readonly ICommonServices _services; + private readonly IGenericAttributeService _genericAttributeService; + + public AdManagerController( + ICommonServices services, + IGenericAttributeService genericAttributeService) + { + _services = services; + _genericAttributeService = genericAttributeService; + } + + + [AdminAuthorize] + [ChildActionOnly] + [LoadSetting] + public ActionResult Configure(AdManagerSettings settings) + { + var model = new ConfigurationModel(); + MiniMapper.Map(settings, model); + + + + return View(model); + } + + [AdminAuthorize] + [ChildActionOnly] + [LoadSetting] + public ActionResult TestView(int shopID) + { + + return View("TestView"); + } + + + [HttpPost] + [AdminAuthorize] + [ChildActionOnly] + [SaveSetting] + public ActionResult Configure(AdManagerSettings settings, ConfigurationModel model, FormCollection form) + { + if (!ModelState.IsValid) + { + return Configure(settings); + } + + + MiniMapper.Map(model, settings); + return RedirectToConfiguration("SmartStore.AdManager"); + } + + + + + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/DependencyRegistrar.cs b/src/Plugins/SmartStore.AdManager/DependencyRegistrar.cs new file mode 100644 index 0000000000..0f66efb986 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/DependencyRegistrar.cs @@ -0,0 +1,21 @@ +using Autofac; +using SmartStore.Core.Infrastructure; +using SmartStore.Core.Infrastructure.DependencyManagement; + +namespace SmartStore.AdManager +{ + public class DependencyRegistrar : IDependencyRegistrar + { + int IDependencyRegistrar.Order => 1; + + public void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule) + { + + } + + void IDependencyRegistrar.Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule) + { + + } + } +} diff --git a/src/Plugins/SmartStore.AdManager/Description.txt b/src/Plugins/SmartStore.AdManager/Description.txt new file mode 100644 index 0000000000..36086a8d58 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Description.txt @@ -0,0 +1,10 @@ +FriendlyName: AdManager +SystemName: SmartStore.AdManager +Group: Api +Version: 4.2.0 +MinAppVersion: 4.2.0 +Author: bk Group +DisplayOrder: 1 +FileName: SmartStore.AdManager.dll +ResourceRootKey: Plugins.SmartStore.AdManager +Url: \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Localization/resources.de-de.xml b/src/Plugins/SmartStore.AdManager/Localization/resources.de-de.xml new file mode 100644 index 0000000000..936537270e --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Localization/resources.de-de.xml @@ -0,0 +1,31 @@ + + + AdManager + + + Detaillierte Beschreibung zu AdManager + + + + + + + + + + + Einstellung + + + Hilfstext zur Konfigurationsmöglichkeit. + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Localization/resources.en-us.xml b/src/Plugins/SmartStore.AdManager/Localization/resources.en-us.xml new file mode 100644 index 0000000000..7c0f921e2a --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Localization/resources.en-us.xml @@ -0,0 +1,31 @@ + + + AdManager + + + Detailed description for AdManager + + + + + + + + + + + Setting + + + Help text for the setting + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Models/ConfigurationModel.cs b/src/Plugins/SmartStore.AdManager/Models/ConfigurationModel.cs new file mode 100644 index 0000000000..c4ca1532d1 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Models/ConfigurationModel.cs @@ -0,0 +1,23 @@ +using SmartStore.Web.Framework; +using SmartStore.Web.Framework.Modelling; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Web.Mvc; + + +namespace SmartStore.AdManager.Models +{ + public class ConfigurationModel : ModelBase + { + + + [SmartResourceDisplayName("Plugins.SmartStore.AdManager.MyFirstSetting")] + [AllowHtml] + public string MyFirstSetting { get; set; } + + + + } + + +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Plugin.cs b/src/Plugins/SmartStore.AdManager/Plugin.cs new file mode 100644 index 0000000000..6108eb9be3 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Plugin.cs @@ -0,0 +1,61 @@ +using SmartStore.AdManager; +using SmartStore.AdManager.Settings; +using SmartStore.Core.Plugins; +using SmartStore.Services; +using SmartStore.Services.Configuration; +using System; +using System.Collections.Generic; +using System.Web.Routing; + + + + +namespace SmartStore.AdManager +{ + public class Plugin : BasePlugin, IConfigurable + { + private readonly ISettingService _settingService; + private readonly ICommonServices _services; + + + public Plugin(ISettingService settingService, + ICommonServices services) + { + _settingService = settingService; + _services = services; + + } + + public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues) + { + actionName = "Configure"; + controllerName = "AdManager"; + routeValues = new RouteValueDictionary() { { "area", "SmartStore.AdManager" } }; + } + + + + + + public override void Install() + { + // Save settings with default values. + _services.Settings.SaveSetting(new AdManagerSettings()); + + // Import localized plugin resources (you can edit or add these in /Localization/resources.[Culture].xml). + _services.Localization.ImportPluginResourcesFromXml(this.PluginDescriptor); + + + base.Install(); + } + + public override void Uninstall() + { + _services.Settings.DeleteSetting(); + _services.Localization.DeleteLocaleStringResources(this.PluginDescriptor.ResourceRootKey); + + + base.Uninstall(); + } + } +} diff --git a/src/Plugins/SmartStore.AdManager/Properties/AssemblyInfo.cs b/src/Plugins/SmartStore.AdManager/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..6d1bd00bc5 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Reflection; +[assembly: AssemblyTitle("SmartStore.AdManager")] diff --git a/src/Plugins/SmartStore.AdManager/RouteProvider.cs b/src/Plugins/SmartStore.AdManager/RouteProvider.cs new file mode 100644 index 0000000000..548600882e --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/RouteProvider.cs @@ -0,0 +1,27 @@ +using SmartStore.Web.Framework.Routing; +using System.Web.Mvc; +using System.Web.Routing; + +namespace SmartStore.Plugin.AdManager +{ + public partial class RouteProvider : IRouteProvider + { + public void RegisterRoutes(RouteCollection routes) + { + routes.MapRoute("SmartStore.AdManager", + "Plugins/AdManager/{action}", + new { controller = "AdManager", action = "Configure" }, + new[] { "SmartStore.AdManager.Controllers" } + ) + .DataTokens["area"] = "SmartStore.AdManager"; + } + + public int Priority + { + get + { + return 0; + } + } + } +} diff --git a/src/Plugins/SmartStore.AdManager/Settings/AdManagerSettings.cs b/src/Plugins/SmartStore.AdManager/Settings/AdManagerSettings.cs new file mode 100644 index 0000000000..8a70c0a43b --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Settings/AdManagerSettings.cs @@ -0,0 +1,14 @@ +using SmartStore.Core.Configuration; + +namespace SmartStore.AdManager.Settings +{ + public class AdManagerSettings : ISettings + { + public string MyFirstSetting { get; set; } + + + + + + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/SmartStore.AdManager.csproj b/src/Plugins/SmartStore.AdManager/SmartStore.AdManager.csproj new file mode 100644 index 0000000000..d99a4ab135 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/SmartStore.AdManager.csproj @@ -0,0 +1,267 @@ + + + + + + False + + + False + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {E4B50F07-425D-4F83-A27E-A8A5115E98CF} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + SmartStore.AdManager + SmartStore.AdManager + + v4.7.2 + 512 + + ..\..\ + true + + + 4.0 + true + + + + + + False + + False + + + + + + true + full + false + ..\..\Presentation\SmartStore.Web\Plugins\SmartStore.AdManager\ + DEBUG;TRACE + prompt + 4 + false + False + + False + + + + pdbonly + true + ..\..\Presentation\SmartStore.Web\Plugins\SmartStore.AdManager\ + TRACE + prompt + 4 + false + False + + False + + + + true + ..\..\Presentation\SmartStore.Web\bin\ + DEBUG;TRACE + full + AnyCPU + prompt + MinimumRecommendedRules.ruleset + False + + False + + + + true + bin\ + DEBUG;TRACE + full + AnyCPU + prompt + MinimumRecommendedRules.ruleset + False + + False + + + + + False + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll + False + + + ..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll + False + + + ..\..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll + False + + + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll + False + + + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll + False + + + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll + False + + + + + + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll + False + + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll + False + + + + + + {6bda8332-939f-45b7-a25e-7a797260ae59} + SmartStore.Core + False + + + {210541AD-F659-47DA-8763-16F36C5CD2F4} + SmartStore.Services + False + + + {75fd4163-333c-4dd5-854d-2ef294e45d94} + SmartStore.Web.Framework + False + + + + + + + + + + + + + + PreserveNewest + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + web.config + + + web.config + + + web.config + + + web.config + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + Designer + PreserveNewest + + + Designer + PreserveNewest + + + + 10.0 + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + False + True + 64666 + / + http://localhost:53132/ + False + True + https://smartstore.com + False + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Views/AdManager/Configure.cshtml b/src/Plugins/SmartStore.AdManager/Views/AdManager/Configure.cshtml new file mode 100644 index 0000000000..d855212c9c --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Views/AdManager/Configure.cshtml @@ -0,0 +1,39 @@ +@model SmartStore.AdManager.Models.ConfigurationModel +@using SmartStore.Web.Framework; +@{ + Layout = ""; +} + +
+ +
+ +@Html.Action("StoreScopeConfiguration", "Setting", new { area = "Admin" }) + +
+ @Html.Raw(@T("Plugins.SmartStore.AdManager.AdminInstruction")) +
+ +@using (Html.BeginForm()) +{ +
+
+
+ @Html.SmartLabelFor(model => model.MyFirstSetting) +
+
+ @Html.SettingEditorFor(model => model.MyFirstSetting) + @Html.ValidationMessageFor(model => model.MyFirstSetting) +
+
+ + + + + + +
+} \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Views/AdManager/TestView.cshtml b/src/Plugins/SmartStore.AdManager/Views/AdManager/TestView.cshtml new file mode 100644 index 0000000000..80048f499c --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Views/AdManager/TestView.cshtml @@ -0,0 +1,9 @@ + +@using SmartStore.Web.Framework; +@{ + Layout = ""; +} + +
+ Ich bin dein Test!!! +
\ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/Views/Web.config b/src/Plugins/SmartStore.AdManager/Views/Web.config new file mode 100644 index 0000000000..82cfd62c51 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/Views/Web.config @@ -0,0 +1,54 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Plugins/SmartStore.AdManager/packages.config b/src/Plugins/SmartStore.AdManager/packages.config new file mode 100644 index 0000000000..bc5736e664 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/packages.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/web.Debug.config b/src/Plugins/SmartStore.AdManager/web.Debug.config new file mode 100644 index 0000000000..f01fcc5c0f --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/web.EFMigrations.config b/src/Plugins/SmartStore.AdManager/web.EFMigrations.config new file mode 100644 index 0000000000..86c687b229 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/web.EFMigrations.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/web.PluginDev.config b/src/Plugins/SmartStore.AdManager/web.PluginDev.config new file mode 100644 index 0000000000..86c687b229 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/web.PluginDev.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/web.Release.config b/src/Plugins/SmartStore.AdManager/web.Release.config new file mode 100644 index 0000000000..86c687b229 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AdManager/web.config b/src/Plugins/SmartStore.AdManager/web.config new file mode 100644 index 0000000000..9c3ffe6619 --- /dev/null +++ b/src/Plugins/SmartStore.AdManager/web.config @@ -0,0 +1,144 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SmartStoreNET.sln b/src/SmartStoreNET.sln index f632c51ee3..53652681ad 100644 --- a/src/SmartStoreNET.sln +++ b/src/SmartStoreNET.sln @@ -72,6 +72,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartStore.DevTools", "Plug EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartStore.WebApi", "Plugins\SmartStore.WebApi\SmartStore.WebApi.csproj", "{BDA52691-29E8-4195-965F-2AEB95A25F6B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartStore.AdManager", "Plugins\SmartStore.AdManager\SmartStore.AdManager.csproj", "{E4B50F07-425D-4F83-A27E-A8A5115E98CF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -592,6 +594,30 @@ Global {BDA52691-29E8-4195-965F-2AEB95A25F6B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {BDA52691-29E8-4195-965F-2AEB95A25F6B}.Release|x86.ActiveCfg = Release|Any CPU {BDA52691-29E8-4195-965F-2AEB95A25F6B}.Release|x86.Build.0 = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|x86.ActiveCfg = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Debug|x86.Build.0 = Debug|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|Any CPU.ActiveCfg = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|Any CPU.Build.0 = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|Mixed Platforms.ActiveCfg = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|Mixed Platforms.Build.0 = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|x86.ActiveCfg = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.EFMigrations|x86.Build.0 = EFMigrations|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|Any CPU.ActiveCfg = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|Any CPU.Build.0 = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|Mixed Platforms.ActiveCfg = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|Mixed Platforms.Build.0 = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|x86.ActiveCfg = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.PluginDev|x86.Build.0 = PluginDev|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|Any CPU.Build.0 = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|x86.ActiveCfg = Release|Any CPU + {E4B50F07-425D-4F83-A27E-A8A5115E98CF}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -616,6 +642,7 @@ Global {611E4AC2-CA21-5C81-6B4B-3ABA87B91A25} = {7881B112-7843-4542-B1F7-F99553FB9BB7} {542B9C12-E2A1-49BB-9134-0E3484F9D669} = {7881B112-7843-4542-B1F7-F99553FB9BB7} {BDA52691-29E8-4195-965F-2AEB95A25F6B} = {7881B112-7843-4542-B1F7-F99553FB9BB7} + {E4B50F07-425D-4F83-A27E-A8A5115E98CF} = {7881B112-7843-4542-B1F7-F99553FB9BB7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {59B852CE-9608-479C-A92B-7EE2DE161049}