Ejemplo n.º 1
0
Archivo: App.cs Proyecto: Websilk/Home
        public Inject StaticUrl(string url)
        {
            if (S.isSessionLost()) { return lostInject(); } //check session

            if (!string.IsNullOrEmpty(url))
            {
                var arrUrl = url.Split('\"');
                if (arrUrl[0].IndexOf("+") < 0)
                {
                    //found page with no query in url
                    var page = new Page(S);

                    //parse URL
                    page.Url = page.parseUrl(url.ToLower().Replace(" ", "-"));

                    //get page Info
                    page.getPageInfoFromUrl();

                    //get static page class
                    if(page.pageService != "")
                    {
                        var service = page.getStaticPage(page.pageService);
                        var response = service.LoadSubPage(page.Url.path.Replace(page.pagePathName + "/", ""));
                        S.javascript.Add("static-page", "S.url.push('" + page.pageTitle + "','" + url.Replace(" ", "-") + "');");
                        response.js =
                            S.cssFiles.renderCssFiles(false) + "\n" +
                            S.javascriptFiles.renderJavascriptFiles(false, S.javascript.renderJavascript(false));
                        return response;
                    }
                }
            }
            return new Inject();
        }