Пример #1
0
        protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath)
        {
            string customCshtml = "";

            if (controllerContext.RouteData.Values["lang"].ToString().Trim().ToLower() == "ar-sa")
            {
                customCshtml = "-ar-sa.cshtml";
            }
            BaseWebController wb = new BaseWebController();
            int orgId            = wb.GetOrganizationId(controllerContext.HttpContext.Request);

            if (String.IsNullOrEmpty(customCshtml))
            {
                return(base.CreateView(controllerContext, viewPath.Replace("%1", "Theme/" + orgId + "/"), masterPath));
            }
            else
            {
                string path = viewPath.Replace("%1", "Theme/" + orgId + "/");
                if (!path.EndsWith("ar-sa.cshtml"))
                {
                    path = path.Substring(0, path.Length - 7) + customCshtml;
                }
                return(base.CreateView(controllerContext, path, masterPath));
            }
        }
Пример #2
0
        protected override bool FileExists(ControllerContext controllerContext, string virtualPath)
        {
            BaseWebController wb = new BaseWebController();
            int orgId            = wb.GetOrganizationId(controllerContext.HttpContext.Request);

            return(base.FileExists(controllerContext, virtualPath.Replace("%1", "Theme/" + orgId + "/")));
        }