Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Allow using the logo in png format for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Sep 4, 2020
1 parent 4826aca commit d94b3ac
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Grand.Core/Plugins/PluginExtensions.cs
Expand Up @@ -19,14 +19,18 @@ public static string GetLogoUrl(this PluginDescriptor pluginDescriptor, IWebHelp
}

var pluginDirectory = pluginDescriptor.OriginalAssemblyFile.Directory;
var logoLocalPath = Path.Combine(pluginDirectory.FullName, "logo.jpg");
if (!File.Exists(logoLocalPath))
var logoPluginJpg = Path.Combine(pluginDirectory.FullName, "logo.jpg");
if (File.Exists(logoPluginJpg))
{
return null;
return string.Format("{0}{1}/{2}/logo.jpg", webHelper.GetStoreLocation(), pluginDirectory.Parent.Name, pluginDirectory.Name);
}
var logoPluginPng = Path.Combine(pluginDirectory.FullName, "logo.png");
if (File.Exists(logoPluginPng))
{
return string.Format("{0}{1}/{2}/logo.png", webHelper.GetStoreLocation(), pluginDirectory.Parent.Name, pluginDirectory.Name);
}
return null;

string logoUrl = string.Format("{0}{1}/{2}/logo.jpg", webHelper.GetStoreLocation(), pluginDirectory.Parent.Name, pluginDirectory.Name);
return logoUrl;
}
}
}

0 comments on commit d94b3ac

Please sign in to comment.