Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit config #2225

Open
wants to merge 7 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@
<Project>{6bda8332-939f-45b7-a25e-7a797260ae59}</Project>
<Name>SmartStore.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\SmartStore.Services\SmartStore.Services.csproj">
<Project>{210541AD-F659-47DA-8763-16F36C5CD2F4}</Project>
<Name>SmartStore.Services</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\SmartStore.Data\SmartStore.Data.csproj">
<Project>{ccd7f2c9-6a2c-4cf0-8e89-076b8fc0f144}</Project>
<Name>SmartStore.Data</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\SmartStore.Services\SmartStore.Services.csproj">
<Project>{210541ad-f659-47da-8763-16f36c5cd2f4}</Project>
<Name>SmartStore.Services</Name>
</ProjectReference>
<ProjectReference Include="..\..\Presentation\SmartStore.Web.Framework\SmartStore.Web.Framework.csproj">
<Project>{75fd4163-333c-4dd5-854d-2ef294e45d94}</Project>
<Name>SmartStore.Web.Framework</Name>
Expand Down
21 changes: 21 additions & 0 deletions src/Plugins/SmartStore.StrubeExport/AdminMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using SmartStore.Collections;
using SmartStore.Web.Framework.UI;

namespace SmartStore.StrubeExport
{
//public class AdminMenu : AdminMenuProvider
//{
// protected override void BuildMenuCore(TreeNode<MenuItem> pluginsNode)
// {
// var menuItem = new MenuItem().ToBuilder()
// .Text("Google Merchant Center")
// .Icon("fab fa-google")
// .ResKey("Plugins.FriendlyName.SmartStore.StrubeExport")
// .Action("ConfigurePlugin", "Plugin", new { systemName = Plugin.SystemName, area = "Admin" })
// .ToItem();

// pluginsNode.Prepend(menuItem);
// }

//}
}
2 changes: 2 additions & 0 deletions src/Plugins/SmartStore.StrubeExport/Content/admin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../../../Presentation/SmartStore.Web/Administration/Content/theme.scss" />

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Plugins/SmartStore.StrubeExport/Content/public.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using SmartStore.ComponentModel;
using SmartStore.Services;
using SmartStore.Services.Common;
using SmartStore.Services.DataExchange.Export;
using SmartStore.StrubeExport.Models;
using SmartStore.StrubeExport.Settings;
using SmartStore.Web.Framework.Controllers;
using SmartStore.Web.Framework.Security;
using SmartStore.Web.Framework.Settings;
using System;
using System.Web.Mvc;



namespace SmartStore.Controllers
{
public class StrubeExportController : AdminControllerBase
{
private readonly ICommonServices _services;
private readonly IGenericAttributeService _genericAttributeService;
private readonly Lazy<IExportProfileService> _exportService;

public StrubeExportController(
ICommonServices services,
IGenericAttributeService genericAttributeService,Lazy<IExportProfileService> exportProfileService)
{
_services = services;
_genericAttributeService = genericAttributeService;
_exportService = exportProfileService;
}


[AdminAuthorize]
[ChildActionOnly]
[LoadSetting]
public ActionResult Configure(StrubeExportSettings settings)
{
var model = new ConfigurationModel();
MiniMapper.Map(settings, model);



return View(model);
}


[HttpPost]
[AdminAuthorize]
[ChildActionOnly]
[SaveSetting]
public ActionResult Configure(StrubeExportSettings settings, ConfigurationModel model, FormCollection form)
{
if (!ModelState.IsValid)
{
return Configure(settings);
}


MiniMapper.Map(model, settings);
return RedirectToConfiguration("SmartStore.StrubeExport");
}




}
}
10 changes: 10 additions & 0 deletions src/Plugins/SmartStore.StrubeExport/Description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FriendlyName: StrubeExport
SystemName: SmartStore.StrubeExport
Group: Analytics
Version: 4.1.1
MinAppVersion: 4.1.1
Author: Strube D&S GmbH
DisplayOrder: 1
FileName: SmartStore.StrubeExport.dll
ResourceRootKey: Plugins.SmartStore.StrubeExport
Url:
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Language Name="Deutsch" IsDefault="true" IsRightToLeft="false">
<LocaleResource Name="Plugins.FriendlyName.SmartStore.StrubeExport" AppendRootKey="false">
<Value>StrubeExport</Value>
</LocaleResource>
<LocaleResource Name="Plugins.Description.SmartStore.StrubeExport" AppendRootKey="false">
<Value>Konfigurierbarer Order Export in verschiednene Formaten</Value>
</LocaleResource>

<LocaleResource Name="Plugins.SmartStore.StrubeExport" AppendRootKey="false">
<Children>
<LocaleResource Name="AdminInstruction">
<Value>
<![CDATA[
Geben Sie zur Einrichtung dieses Plugins nachfolgend Ihre Daten an.
]]>
</Value>
</LocaleResource>
<LocaleResource Name="MyFirstSetting">
<Value>Einstellung</Value>
</LocaleResource>
<LocaleResource Name="MyFirstSetting.Hint">
<Value>Hilfstext zur Konfigurationsmöglichkeit.</Value>
</LocaleResource>

<LocaleResource Name="GeneralSettings">
<Value>Allgemeine Einstellungen</Value>
</LocaleResource>

<LocaleResource Name="ExportShipAddress">
<Value>Lieferadresse exportieren</Value>
</LocaleResource>
<LocaleResource Name="SuppressPrice">
<Value>Preise und Summen unterdrücken</Value>
</LocaleResource>
<LocaleResource Name="SuppressBank">
<Value>Bankdaten unterdrücken</Value>
</LocaleResource>





</Children>
</LocaleResource>
</Language>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Language Name="English" IsDefault="false" IsRightToLeft="false">
<LocaleResource Name="Plugins.FriendlyName.SmartStore.StrubeExport" AppendRootKey="false">
<Value>StrubeExport</Value>
</LocaleResource>
<LocaleResource Name="Plugins.Description.SmartStore.StrubeExport" AppendRootKey="false">
<Value>configurable exporte for orders in different formats</Value>
</LocaleResource>

<LocaleResource Name="Plugins.SmartStore.StrubeExport" AppendRootKey="false">
<Children>
<LocaleResource Name="AdminInstruction">
<Value>
<![CDATA[
Enter your data below to configure this plugin.
]]>
</Value>
</LocaleResource>
<LocaleResource Name="MyFirstSetting">
<Value>Setting</Value>
</LocaleResource>
<LocaleResource Name="MyFirstSetting.Hint">
<Value>Help text for the setting</Value>
</LocaleResource>

<LocaleResource Name="GeneralSettings">
<Value>General Settings</Value>
</LocaleResource>

<LocaleResource Name="ExportShipAddress">
<Value>export ship address</Value>
</LocaleResource>
<LocaleResource Name="SuppressPrice">
<Value>suppress price and amount</Value>
</LocaleResource>
<LocaleResource Name="SuppressBank">
<Value>suppress Banking information's</Value>
</LocaleResource>




</Children>
</LocaleResource>
</Language>
23 changes: 23 additions & 0 deletions src/Plugins/SmartStore.StrubeExport/Models/ConfigurationModel.cs
Original file line number Diff line number Diff line change
@@ -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.StrubeExport.Models
{
public class ConfigurationModel : ModelBase
{


[SmartResourceDisplayName("Plugins.SmartStore.StrubeExport.MyFirstSetting")]
[AllowHtml]
public string MyFirstSetting { get; set; }



}


}
32 changes: 32 additions & 0 deletions src/Plugins/SmartStore.StrubeExport/Models/FieldOrderAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SmartStore.StrubeExport.Models
{
/// <summary>
/// Describes in which order marked Fields will be written to a String during CSV serialisation
/// </summary>
[System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
sealed class FieldOrderAttribute : Attribute
{
// See the attribute guidelines at
// http://go.microsoft.com/fwlink/?LinkId=85236
private int index = 0;

// This is a positional argument
public FieldOrderAttribute(int index)
{
this.index = index;
}

// This is a named argument
public int Index
{
get { return index; }
set { this.index = value; }
}

}
}