Esempio n. 1
0
        public static string RenderUserMenu(IRequest request)
        {
            var html    = new StringBuilder();
            var section = new View("/Views/User/menu.html");

            section["org-id"]   = request.User.OrgId.ToString();
            section["user-id"]  = request.User.UserId.ToString();
            section["username"] = request.User.Name;
            if (request.User.IsAppOwner())
            {
                section.Show("app");
                request.AddScript("/js/views/app/app.js");
                request.AddCSS("/css/views/app/app.css");
            }
            html.Append(section.Render());
            return(html.ToString());
        }
        public string Render(IRequest request)
        {
            var html   = new StringBuilder();
            var access = false;

            if (request.CheckSecurity("import"))
            {
                html.Append(Cache.LoadFile(App.MapPath("/Vendors/ImportExport/import.html")));
                access = true;
            }
            if (request.CheckSecurity("export"))
            {
                html.Append(Cache.LoadFile(App.MapPath("/Vendors/ImportExport/export.html")));
                access = true;
            }
            if (access)
            {
                request.AddScript("/editor/vendors/importexport/importexport.js");
            }
            return(html.ToString());
        }