/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _webHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings() { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), "image/pjpeg", "banner_1", true).Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), "image/pjpeg", "banner_2", true).Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3", true).Id, Text3 = "", Link3 = _webHelper.GetStoreLocation(false), //Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner4.jpg"), "image/pjpeg", "banner_4", true).Id, //Text4 = "", //Link4 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "Picture 1"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "Picture"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "Upload picture."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "Comment"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", "Enter comment for picture. Leave empty if don't want to display any text."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", "Enter URL. Leave empty if don't want this picture to be clickable."); var sliderItems = _sliderItemService.GetMailPageSlides(); if (sliderItems.Count < 4) { for (int i = 1; i <= 4; i++) { var item = sliderItems.Where(x => x.SlideNumber == i).FirstOrDefault(); if (item == null) { var newItem = new SliderItem() { SlideNumber = i }; _sliderItemService.Insert(newItem); } } } base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _fileProvider.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings { Picture1Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(_fileProvider.Combine(sampleImagesPath, "banner1.jpg")), MimeTypes.ImagePJpeg, "banner_1").Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), MobilePic1Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(_fileProvider.Combine(sampleImagesPath, "banner1-mobile.jpg")), MimeTypes.ImagePJpeg, "banner_1").Id, Picture2Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(_fileProvider.Combine(sampleImagesPath, "banner2.jpg")), MimeTypes.ImagePJpeg, "banner_2").Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), MobilePic2Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(_fileProvider.Combine(sampleImagesPath, "banner2-mobile.jpg")), MimeTypes.ImagePJpeg, "banner_2").Id, //Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(_fileProvider.Combine(sampleImagesPath,"banner3.jpg")), MimeTypes.ImagePJpeg, "banner_3").Id, //Text3 = "", //Link3 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); _localizationService.AddPluginLocaleResource(new Dictionary <string, string> { ["Plugins.Widgets.NivoSlider.Picture1"] = "Picture 1", ["Plugins.Widgets.NivoSlider.Picture2"] = "Picture 2", ["Plugins.Widgets.NivoSlider.Picture3"] = "Picture 3", ["Plugins.Widgets.NivoSlider.Picture4"] = "Picture 4", ["Plugins.Widgets.NivoSlider.Picture5"] = "Picture 5", ["Plugins.Widgets.NivoSlider.Picture"] = "Picture", ["Plugins.Widgets.NivoSlider.Picture.Hint"] = "Upload picture.", ["Plugins.Widgets.NivoSlider.Text"] = "Comment", ["Plugins.Widgets.NivoSlider.Text.Hint"] = "Enter comment for picture. Leave empty if you don't want to display any text.", ["Plugins.Widgets.NivoSlider.Link"] = "URL", ["Plugins.Widgets.NivoSlider.Link.Hint"] = "Enter URL. Leave empty if you don't want this picture to be clickable.", ["Plugins.Widgets.NivoSlider.AltText"] = "Image alternate text", ["Plugins.Widgets.NivoSlider.AltText.Hint"] = "Enter alternate text that will be added to image.", ["Plugins.Widgets.NivoSlider.MobilePicture"] = "Mobile Picture", ["Plugins.Widgets.NivoSlider.MobilePicture.Hint"] = "Upload the x*x squared picture for devices < 1000 width." }); base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _fileProvider.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings { Picture1Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(sampleImagesPath + "banner1.jpg"), MimeTypes.ImagePJpeg, "banner_1").Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(_fileProvider.ReadAllBytes(sampleImagesPath + "banner2.jpg"), MimeTypes.ImagePJpeg, "banner_2").Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false) //Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), MimeTypes.ImagePJpeg, "banner_3").Id, //Text3 = "", //Link3 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "Picture 1"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 5"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 6"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 7"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 8"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 9"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 10"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "Picture"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "Upload picture."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "Comment"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", "Enter comment for picture. Leave empty if you don't want to display any text."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", "Enter URL. Leave empty if you don't want this picture to be clickable."); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.AltText", "Image alternate text"); _localizationService.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.AltText.Hint", "Enter alternate text that will be added to image."); base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _webHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings() { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), "image/pjpeg", "banner_1", true).Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), "image/pjpeg", "banner_2", true).Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3", true).Id, Text3 = "", Link3 = _webHelper.GetStoreLocation(false), //Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner4.jpg"), "image/pjpeg", "banner_4", true).Id, //Text4 = "", //Link4 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "Picture 1"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 5"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture6", "Picture 6"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture7", "Picture 7"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture8", "Picture 8"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "Picture"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "Upload picture."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "Comment"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", "Enter comment for picture. Leave empty if you don't want to display any text."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", "Enter URL. Leave empty if you don't want this picture to be clickable."); base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = CommonHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), MimeTypes.ImagePJpeg, "banner_1").Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), MimeTypes.ImagePJpeg, "banner_2").Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), //Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), MimeTypes.ImagePJpeg, "banner_3").Id, //Text3 = "", //Link3 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "Picture 1"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 5"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "Picture"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "Upload picture."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "Comment"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", "Enter comment for picture. Leave empty if you don't want to display any text."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", "Enter URL. Leave empty if you don't want this picture to be clickable."); base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _webHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //settings var settings = new NivoSliderSettings() { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), "image/pjpeg", "banner_1", true).Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), "image/pjpeg", "banner_2", true).Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3", true).Id, Text3 = "", Link3 = _webHelper.GetStoreLocation(false), //Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner4.jpg"), "image/pjpeg", "banner_4", true).Id, //Text4 = "", //Link4 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settings); //NivoIndexRightSettings var settingsIndexRight = new NivoIndexRightSettings() { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), "image/pjpeg", "banner_1", true).Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), "image/pjpeg", "banner_2", true).Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3", true).Id, Text3 = "", Link3 = _webHelper.GetStoreLocation(false), //Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner4.jpg"), "image/pjpeg", "banner_4", true).Id, //Text4 = "", //Link4 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settingsIndexRight); //NivoIndexSliderRootSettings var settingsNivoIndexSliderRoot = new NivoIndexSliderRootSettings() { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner1.jpg"), "image/pjpeg", "banner_1", true).Id, Text1 = "", Link1 = _webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner2.jpg"), "image/pjpeg", "banner_2", true).Id, Text2 = "", Link2 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3", true).Id, Text3 = "", Link3 = _webHelper.GetStoreLocation(false), //Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner4.jpg"), "image/pjpeg", "banner_4", true).Id, //Text4 = "", //Link4 = _webHelper.GetStoreLocation(false), }; _settingService.SaveSetting(settingsNivoIndexSliderRoot); var settingNivoSliderHotSettings = new NivoSliderHotSettings(); _settingService.SaveSetting(settingNivoSliderHotSettings); var settingNivoSliderNewSettings = new NivoSliderNewSettings(); _settingService.SaveSetting(settingNivoSliderNewSettings); var settingNivoSliderStarSettings = new NivoSliderStarSettings(); _settingService.SaveSetting(settingNivoSliderStarSettings); var settingNivoSliderLikeSettings = new NivoSliderLikeSettings(); _settingService.SaveSetting(settingNivoSliderLikeSettings); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "ͼƬ1"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 5"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "ͼƬ"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "ÉÏ´«Í¼Æ¬"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "±êÌâ"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", ""); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", ""); base.Install(); }
/// <summary> /// Install plugin /// </summary> public override void Install() { //pictures var sampleImagesPath = _webHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/nivoslider/sample-images/"); //var sampleImagesPath = _webHelper.MapPath("~/Plugins/Widgets.NivoSlider/Content/images/"); //settings var settings = new NivoSliderSettings { Picture1Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_01.jpg"), "image/pjpeg", "banner_1").Id, Text1 = "", Link1 = "",//_webHelper.GetStoreLocation(false), Picture2Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_02.jpg"), "image/pjpeg", "banner_2").Id, Text2 = "", Link2 = "",//_webHelper.GetStoreLocation(false), //Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner3.jpg"), "image/pjpeg", "banner_3").Id, //Text3 = "", //Link3 = _webHelper.GetStoreLocation(false), Picture3Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_03.jpg"), "image/pjpeg", "banner_3").Id, Text3 = "", Link3 = "", Picture4Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_04.jpg"), "image/pjpeg", "banner_4").Id, Text4 = "", Link4 = "", Picture5Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_05.jpg"), "image/pjpeg", "banner_5").Id, Text5 = "", Link5 = "", Picture6Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_06.jpg"), "image/pjpeg", "banner_6").Id, Text6 = "", Link6 = "", Picture7Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_07.jpg"), "image/pjpeg", "banner_7").Id, Text7 = "", Link7 = "", Picture8Id = _pictureService.InsertPicture(File.ReadAllBytes(sampleImagesPath + "banner_08.jpg"), "image/pjpeg", "banner_8").Id, Text8 = "", Link8 = "" }; _settingService.SaveSetting(settings); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture1", "Picture 1"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture2", "Picture 2"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture3", "Picture 3"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture4", "Picture 4"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture5", "Picture 5"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture6", "Picture 6"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture7", "Picture 7"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture8", "Picture 8"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture", "Picture"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Picture.Hint", "Upload picture."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text", "Comment"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Text.Hint", "Enter comment for picture. Leave empty if you don't want to display any text."); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link", "URL"); this.AddOrUpdatePluginLocaleResource("Plugins.Widgets.NivoSlider.Link.Hint", "Enter URL. Leave empty if you don't want this picture to be clickable."); base.Install(); }