Exemplo n.º 1
0
        protected virtual PluginModel PreparePluginModel(PluginDescriptor pluginDescriptor,
                                                         bool prepareLocales = true, bool prepareStores = true)
        {
            var pluginModel = pluginDescriptor.ToModel();

            pluginModel.LogoUrl = pluginDescriptor.GetLogUrl(_webHelper);
            //logo
            //pluginModel.LogoUrl = pluginDescriptor.GetLogoUrl(_webHelper);

            //if (prepareLocales)
            //{
            //    //locales
            //    AddLocales(_languageService, pluginModel.Locales, (locale, languageId) =>
            //    {
            //        locale.FriendlyName = pluginDescriptor.Instance().GetLocalizedFriendlyName(_localizationService, languageId, false);
            //    });
            //}
            if (pluginDescriptor.Installed)
            {
                var    pluginInstance   = pluginDescriptor.Instance();
                string configurationUrl = null;
                if (pluginInstance is IWidgetPlugin)
                {
                    //Misc plugins
                    configurationUrl = Url.Action("ConfigureWidget", "Widget", new { systemName = pluginDescriptor.SystemName });
                }
                pluginModel.ConfigurationUrl = configurationUrl;
            }
            return(pluginModel);
        }