Beispiel #1
0
        private void WriteResponseExceptionTemplated()
        {
            TplContent tpl = new TplContent(Resources.TplError);
            tpl.Assign("EXCEPTION", e.ToString());
            tpl.Assign("PROGRAM_VERSION", Program.getVersion());

            this.WriteResponseHeader();
            this.WriteTemplateHeader("fmb Error", false);
            this.WriteTemplate(tpl);
            this.WriteTemplateFooter();
        }
        internal override void WriteResponse(HttpRequest req)
        {
            this.contentType = "text/html";
            this.WriteResponseHeader();

            this.WriteTemplateHeader("Startup");

            TplContent tpl = new TplContent(Resources.TplStartup);
            tpl.Assign("DATADIR", Application.CommonAppDataPath.Replace("\\", "/"));
            tpl.Assign("PORT", HttpServer.port);

            this.WriteTemplate(tpl);

            this.WriteTemplateFooter();
        }
        internal override void WriteResponse(HttpRequest req)
        {
            this.contentType = "text/html";
            this.WriteResponseHeader();
            this.WriteTemplateHeader("Library", true);

            TplContent tpl = new TplContent(Resources.TplLibrary);
            tpl.Assign("LIBSIZE", this.connectionHandler.server.library.Size());
            this.WriteTemplate(tpl);

            // template doesnt support loops, yet.
            output.WriteLine("<ul>");
            foreach (FileInfo fi in connectionHandler.server.library.All()) {
                output.WriteLine("<li>" + fi.FullName + "</li>");
            }
            output.WriteLine("<ul>");

            this.WriteTemplateFooter();
        }
        public HtmlFormShowPresentation()
        {
            this.Title = "Setup presentation";

            presentationStorage.EnsureExists();
            presentationStorage.Read();

            ElementTextarea elMessage = new ElementTextarea("presentation", "Presentation markup", presentationStorage.Get(), true);
            this.AddElement(elMessage).hasLabel = false;

            this.AddElement(new ElementHtml("dynamicSlideArea")).SetValue("<div id = \"dynamicSlideArea\" /><script type = \"text/javascript\" src = \"?servlet=ServletResource&amp;filename=presentationSlideEditor\"></script><script type = \"text/javascript\">loadInitialPresentation();</script>");
            this.AddElement(new ElementHtml("footerControls")).SetValue("<span class = \"fakeLink\" onclick = \"javascript:newSlide('')\">New Slide</span> <span class = \"fakeLink\" onclick = \"javascript:$('#presentation').toggle()\">Toggle advanced editor</span>");

            ElementNumber elDelay = new ElementNumber("defaultDelay", "Default slide delay (seconds)", 30);
            this.AddElement(elDelay);

            this.AddElementSubmit().SetCaption("Save presentation");

            ElementHtml elHtml = new ElementHtml("description");
            TplContent tplElHelp = new TplContent(Resources.TplPresentationHelp);
            tplElHelp.Assign("SLIDESEP", MessageRendererPresentation.SLIDE_SEPARATOR);
            elHtml.SetValue(tplElHelp.Content);
            this.AddElement(elHtml);
        }
Beispiel #5
0
        internal void WriteTemplateHeader(string pageTitle, bool includeNavigation)
        {
            TplContent header = new TplContent(Resources.TplHeader);

            if (includeNavigation)
            {
                header.Assign("QUICK_NAV", new TplContent(Resources.TplNavigation).Content);
            }
            else
            {
                header.Assign("QUICK_NAV", string.Empty);
            }

            header.Assign("PAGE_TITLE", pageTitle);

            WriteTemplate(header);
        }
Beispiel #6
0
        internal void WriteTemplateFooter()
        {
            TplContent tplContent = new TplContent(Resources.TplFooter);

            if (this.connectionHandler != null)
            {
                tplContent.Assign("ACCESS_LEVEL_REQUIRED", (int)this.GetAccessLevel());
                tplContent.Assign("ACCESS_LEVEL_OBTAINED", (int)this.connectionHandler.GetAuthenticatedAccessLevel());
            }
            else
            {
                tplContent.Assign("ACCESS_LEVEL_REQUIRED", "?");
                tplContent.Assign("ACCESS_LEVEL_OBTAINED", "?");
            }

            tplContent.Assign("PROGRAM_VERSION", Program.getVersion());
            WriteTemplate(tplContent);
        }