Skip to content

Commit 4a16eac

Browse files
committed
Added new property URL to both PluginDescriptor and ThemeManifest
1 parent 9cfc888 commit 4a16eac

7 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/Libraries/SmartStore.Core/Packaging/PackagingUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal static ExtensionDescriptor ConvertToExtensionDescriptor(this PluginDesc
8181
Version = pluginDescriptor.Version,
8282
Name = pluginDescriptor.FriendlyName,
8383
Description = pluginDescriptor.Description,
84-
WebSite = string.Empty, // TODO: (pkg) Add author url to plugin manifests,
84+
WebSite = pluginDescriptor.Url, // TODO: (pkg) Add author url to plugin manifests,
8585
Tags = string.Empty // TODO: (pkg) Add tags to plugin manifests,
8686
};
8787

@@ -101,7 +101,7 @@ internal static ExtensionDescriptor ConvertToExtensionDescriptor(this ThemeManif
101101
Version = new Version(themeManifest.Version),
102102
Name = themeManifest.ThemeTitle,
103103
Description = string.Empty, // TODO: (pkg) Add description to theme manifests
104-
WebSite = string.Empty, // TODO: (pkg) Add author url to theme manifests,
104+
WebSite = themeManifest.Url,
105105
Tags = string.Empty // TODO: (pkg) Add tags to theme manifests,
106106
};
107107

src/Libraries/SmartStore.Core/Plugins/PluginDescriptor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ public bool IsInKnownGroup
143143
[DataMember]
144144
public string Author { get; set; }
145145

146+
/// <summary>
147+
/// Gets or sets the project/marketplace url
148+
/// </summary>
149+
[DataMember]
150+
public string Url { get; set; }
151+
146152
/// <summary>
147153
/// Gets or sets the display order
148154
/// </summary>

src/Libraries/SmartStore.Core/Plugins/PluginFileParser.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ public static PluginDescriptor ParsePluginDescriptionFile(string filePath)
161161
case "Author":
162162
descriptor.Author = value;
163163
break;
164+
case "Url":
165+
descriptor.Url = value;
166+
break;
164167
case "DisplayOrder":
165168
{
166169
int displayOrder;
@@ -219,6 +222,7 @@ public static void SavePluginDescriptionFile(PluginDescriptor plugin)
219222
keyValues.Add(new KeyValuePair<string, string>("Version", plugin.Version.ToString()));
220223
keyValues.Add(new KeyValuePair<string, string>("MinAppVersion", string.Join(",", plugin.MinAppVersion)));
221224
keyValues.Add(new KeyValuePair<string, string>("Author", plugin.Author));
225+
keyValues.Add(new KeyValuePair<string, string>("Url", plugin.Url));
222226
keyValues.Add(new KeyValuePair<string, string>("DisplayOrder", plugin.DisplayOrder.ToString()));
223227
keyValues.Add(new KeyValuePair<string, string>("FileName", plugin.PluginFileName));
224228
keyValues.Add(new KeyValuePair<string, string>("ResourceRootKey", plugin.ResourceRootKey));

src/Libraries/SmartStore.Core/Themes/ThemeManifest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ public string Author
163163
protected internal set;
164164
}
165165

166+
public string Url
167+
{
168+
get;
169+
protected internal set;
170+
}
171+
166172
public string Version
167173
{
168174
get;

src/Libraries/SmartStore.Core/Themes/ThemeManifestMaterializer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public ThemeManifest Materialize()
3535
_manifest.PreviewImageUrl = root.GetAttribute("previewImageUrl").NullEmpty() ?? "~/Themes/{0}/preview.png".FormatCurrent(_manifest.ThemeName);
3636
_manifest.PreviewText = root.GetAttribute("previewText").ToSafe();
3737
_manifest.Author = root.GetAttribute("author").ToSafe();
38+
_manifest.Url = root.GetAttribute("url").ToSafe();
3839
_manifest.Version = root.GetAttribute("version").ToSafe().HasValue() ? root.GetAttribute("version") : "1.0";
3940

4041
_manifest.Selects = MaterializeSelects();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest man
125125
Title = manifest.ThemeTitle,
126126
Description = manifest.PreviewText,
127127
Author = manifest.Author,
128+
Url = manifest.Url,
128129
Version = manifest.Version,
129130
IsMobileTheme = manifest.MobileTheme,
130131
SupportsRtl = manifest.SupportRtl,

src/Presentation/SmartStore.Web/Administration/Models/Themes/ThemeManifestModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class ThemeManifestModel : ITopologicSortable<string>
2020

2121
public string Author { get; set; }
2222

23+
public string Url { get; set; }
24+
2325
public string Version { get; set; }
2426

2527
public string PreviewImageUrl { get; set; }

0 commit comments

Comments
 (0)