예제 #1
0
        public string GetPagePlugin(string page, string user, int userRights, string queryString)
        {
            this.reset();
            var returnString = new StringBuilder();


            returnString.Append("<title>" + _pageNameText + "</title>");
            returnString.Append(_hs.GetPageHeader(_pageName, Utility.PluginName, "", "", false, false));
            //' a message area for error messages from jquery ajax post back (optional, only needed if using AJAX calls to get data)
            returnString.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("pluginpage", ""));
            returnString.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("errormessage", "class='errormessage'"));
            //returnString.Append(ShowMissingCredentialsErrorIfCredentialsMissing());
            returnString.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());

            returnString.Append(BuildContent());

            returnString.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());
            this.AddFooter(_hs.GetPageFooter());
            this.suppressDefaultFooter = true;
            this.AddBody(returnString.ToString());



            return(this.BuildPage());
        }
예제 #2
0
        public string GetPagePlugin(string pageName, string user, int userRights, string queryString)
        {
            var stb          = new StringBuilder();
            var instanceText = "";

            try
            {
                this.reset();

                // handle any queries like mode=something
                NameValueCollection parts = null;
                if (!string.IsNullOrEmpty(queryString))
                {
                    parts = HttpUtility.ParseQueryString(queryString);
                }

                if (!string.IsNullOrEmpty(_plugin.PluginInstance))
                {
                    instanceText = " - " + _plugin.PluginInstance;
                }

                //For some reason, I can't get the sample to add the title. So let's add it here.
                stb.Append("<title>" + Utils.PluginName + " " + pageName.Replace(Utils.PluginName, "") + "</title>");

                //Add menus and headers
                stb.Append(_hs.GetPageHeader(pageName,
                                             Utils.PluginName + " " + pageName.Replace(Utils.PluginName, "") + instanceText, "",
                                             "", false, false));

                //Adds the div for the plugin page
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("pluginpage", ""));

                // a message area for error messages from jquery ajax postback (optional, only needed if using AJAX calls to get data)
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("errormessage", "class='errormessage'"));
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());

                //Configures the timer that all pages apparently has
                this.RefreshIntervalMilliSeconds = 3000;
                stb.Append(this.AddAjaxHandlerPost("id=timer", pageName));                 //This is so we can control it in postback

                // specific page starts here
                stb.Append(BuildContent());

                //Ends the div end tag for the plugin page
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());

                // add the body html to the page
                this.AddBody(stb.ToString());

                //           ' return the full page
                return(this.BuildPage());
            }
            catch (Exception ex)
            {
                //WriteMon("Error", "Building page: " & ex.Message)
                return("ERROR in GetPagePlugin: " + ex.Message);
            }
        }
예제 #3
0
        public string GetPagePlugin(string pageName, string user, int userRights, string queryString)
        {
            var stb          = new StringBuilder();
            var instancetext = "";

            try
            {
                this.reset();
                // handle any queries like mode=something
                NameValueCollection parts = null;
                if (!string.IsNullOrEmpty(queryString))
                {
                    parts = HttpUtility.ParseQueryString(queryString);
                }

                if (!string.IsNullOrEmpty(_plugin.PluginInstance))
                {
                    instancetext = " - " + _plugin.PluginInstance;
                }

                stb.Append(_hs.GetPageHeader(pageName, Utils.PluginName + instancetext, "", "", false, false));
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("pluginpage", ""));
                // a message area for error messages from jquery ajax postback (optional, only needed if using AJAX calls to get data)
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivStart("errormessage", "class='errormessage'"));
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());

                this.RefreshIntervalMilliSeconds = 3000;
                stb.Append(this.AddAjaxHandlerPost("id=timer", pageName));

                // specific page starts here
                stb.Append(BuildContent());
                stb.Append(PageBuilderAndMenu.clsPageBuilder.DivEnd());

                // add the body html to the page
                this.AddBody(stb.ToString());

                // return the full page
                return(this.BuildPage());
            }
            catch (Exception ex)
            {
                //WriteMon("Error", "Building page: " & ex.Message)
                return("error - " + ex.Message);                //Err.Description
            }
        }
예제 #4
0
        public String GetPage(String pPageName, String pParamString)
        {
            reset();
            PageName = pPageName;
            String pPageNameClean = pPageName;

            if (pPageNameClean.Contains("/"))
            {
                pPageNameClean = pPageName.Split('/')[1];
            }

            NameValueCollection parts = HttpUtility.ParseQueryString(pParamString);

            Type       objType = GetType();
            MethodInfo handler = null;

            try
            {
                handler = objType.GetMethod("Page_" + pPageNameClean);
                if (handler == null)
                {
                    return("<h1>Page not found: " + pPageName + "</h1>");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception : " + e.ToString());
            }

            PageReturn page = handler.Invoke(this, new object[] { pPageName, pPageNameClean, parts }) as PageReturn;

            if (page.full_page)
            {
                return(page.content);
            }
            else
            {
                AddHeader(hsHost.GetPageHeader(pPageName, pPageNameClean, "", "", false, true));
                AddBody(page.content);
                this.RefreshIntervalMilliSeconds = 10;
                suppressDefaultFooter            = true;
                AddFooter(hsHost.GetPageFooter());
                return(BuildPage());
            }
        }
예제 #5
0
        public string GetPagePlugin(string page, string user, int userRights, string queryString)
        {
            var returnString = new StringBuilder();

            reset();
            UsesJqAll = true;

            returnString.Append("<title>About RfLinkSeer plugin</title>");
            returnString.Append(_hs.GetPageHeader(_pageName, "RfLinkSeer", "", "", false, false));
            returnString.Append(DivStart("pluginpage", ""));

            //returnString.Append(BuildContent());
            returnString.Append("<br/>");
            //returnString.Append("<br/>Big thank you to the RFLink Stuntteam! <a href=\"http://www.rflink.nl\" target=\"_blank\">www.rflink.nl</a>");
            returnString.Append("<br/>");
            returnString.Append("<br/>Aleks at <a href=\"https://www.hjemmeautomasjon.no\" target=\"_blank\">www.hjemmeautomasjon.no</a>");
            returnString.Append("<br/>Moskus at <a href=\"https://www.hjemmeautomasjon.no\" target=\"_blank\">www.hjemmeautomasjon.no</a>");
            returnString.Append("<br/>");

            returnString.Append("<br/>Testers: ");
            returnString.Append("<br/>fjaeran at <a href=\"https://www.hjemmeautomasjon.no\" target=\"_blank\">www.hjemmeautomasjon.no</a>");
            returnString.Append("<br/>");

            //returnString.Append("<br/>Icons from ");
            //returnString.Append("<br/>Randolph Novino - Noun Project (Barometric pressure icon)");
            //returnString.Append("<br/>amanda - Noun Project (Ruler/distance icon)");
            //returnString.Append("<br/>Arthur Shlain - Noun Project (weather icons)");
            //returnString.Append("<br/>JohnnyZi - Noun Project (Question mark for weather)");
            //returnString.Append("<br/>iconsmind.com - Noun Project (temperature meter)");
            //returnString.Append("<br/>hunotika- Noun Project (wind directions)");
            //returnString.Append("<br/>B.Agustín Amenábar Larraín - Noun Project (wind)");
            //returnString.Append("<br/>David - Noun Project (volt and ampere icon)");
            //returnString.Append("<br/>Romualdas Jurgaitis - Noun Project (note icon)");
            //returnString.Append("<br/>Pham Duy Phuong Hung - Noun Project (meter icon)");
            //returnString.Append("<br/>Demak Daksina S - Noun Project (sound icon)");

            returnString.Append("<br/>");
            returnString.Append($"<br/>Guahtdim 2019 - {Utility.PluginName} version: " + Assembly.GetExecutingAssembly().GetName().Version);

            returnString.Append(DivEnd());
            AddFooter(_hs.GetPageFooter());
            suppressDefaultFooter = true;
            AddBody(returnString.ToString());
            return(BuildPage());
        }
예제 #6
0
        public string GetPagePlugin(string page, string user, int userRights, string queryString)
        {
            var returnString = new StringBuilder();

            reset();
            UsesJqAll = true;

            returnString.Append($"<title>About {Utility.PluginName} plugin</title>");
            returnString.Append(_hs.GetPageHeader(_pageName, Utility.PluginName, "", "", false, false));
            returnString.Append(DivStart("pluginpage", ""));

            returnString.Append("<br/>");
            returnString.Append("<br/>Big thank you to :");
            returnString.Append("<br/>");
            //returnString.Append("<br/>Kenneth at <a href=\"https://www.hjemmeautomasjon.no\" target=\"_blank\">www.hjemmeautomasjon.no</a>");

            returnString.Append("<br/>Moskus at <a href=\"https://www.hjemmeautomasjon.no\" target=\"_blank\">www.hjemmeautomasjon.no</a>");
            returnString.Append("<br/>");


            returnString.Append("<br/>");
            returnString.Append($"<br/>Guahtdim 2019 - {Utility.PluginName} version: " + Assembly.GetExecutingAssembly().GetName().Version);
            returnString.Append("<br/>");
            returnString.Append("<br/>Donations to paypal account [email protected] ");
            returnString.Append("<br/>");
            returnString.Append("<br/>");
            returnString.Append("<br/>");
            var advancedText = new clsJQuery.jqSlidingTab("donations", PageName, false);

            advancedText.initiallyOpen        = false;
            advancedText.tab.name             = "Donations";
            advancedText.tab.tabName.Selected = "Donations";
            advancedText.tab.AddContent(CreateDonationsContent());
            returnString.Append(advancedText.Build());
            returnString.Append("<br/>");
            returnString.Append("<br/>");
            returnString.Append(DivEnd());
            AddFooter(_hs.GetPageFooter());
            suppressDefaultFooter = true;
            AddBody(returnString.ToString());
            return(BuildPage());
        }