Example #1
0
        public ActionResult WidgetCss(string trackingID, string lastUpdate)
        {
            var webStore = _widgetServices.GetWidgetStoreDto(trackingID);

            Response.ContentType = "text/css";
            return(View("~/Areas/Widget/Views/Shared/Styles/WidgetCss.cshtml", webStore));
        }
Example #2
0
        public ActionResult AppSettings(string trackingID)
        {
            var error = "";
            var user  = this.CurrentUser();

            if (user == null)
            {
                Response.Write("User wasn't found, please contact " + Constants.APP_OFFICIAL_NAME + " support team. " + error);
                return(null);
            }

            var webStore = _widgetServices.GetWidgetStoreDto(trackingID);

            var settingToken = trackingID.ToDefaultSettingsToken();

            settingToken.Instance        = null;
            settingToken.UserId          = user.UserId;
            settingToken.UserCoursesList = _authorAdminCourseServices.GetAuthorCoursesList(Constants.DEFAULT_CURRENCY_ID, user.UserId);

            if (!String.IsNullOrEmpty(trackingID)) // for FB app , tracking ID equal to pageId
            {
                //update plugin user
                _widgetEndpointServices.VerifyPluginOwner(trackingID, out error);
            }

            if (webStore == null)
            {
                //settingToken.storeId = -1;
                //create a new web store
                var jsonToken = new FacebookSettingsJsonToken
                {
                    cbIsShowBorder    = false,
                    cbIsShowTitleBar  = true,
                    cbIsTransparent   = false,
                    cpBackgroundColor = "#FFFFFF",
                    cpFontColor       = "#000000",
                    cpTabsFontColor   = "#006699",
                    StoreId           = null,
                    txtStoreName      = "",
                    UniqueId          = "",
                    TrackingId        = trackingID
                };

                _webStoreFacebookServices.UpdateFacebookSettings(ref jsonToken, this.CurrentUser(), out error);
            }
            else
            {
                settingToken.StoreName       = webStore.WebStoreName;
                settingToken.FontColor       = webStore.FontColor;
                settingToken.TabsFontColor   = webStore.TabsFontColor;
                settingToken.BackgroundColor = webStore.BackgroundColor;
                settingToken.IsTransparent   = webStore.IsTransParent;
                settingToken.IsShowBorder    = webStore.IsShowBorder;
                settingToken.IsShowTitleBar  = webStore.IsShowTitleBar;
                settingToken.StoreId         = webStore.WebStoreID;
                settingToken.UniqueId        = webStore.UniqueId;
                // settingToken.StoreCoursesIds = WidgetServices.GetAllStoreCourseIds(webStore.WebStoreID);
            }

            // return View("~/Areas/Widget/Views/facebook/FacebookSettings.cshtml", settingToken);
            return(View("FacebookSettings", settingToken));
        }