From b9a26f614d8eee40b6caca4eb008ce14f0a80f24 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Thu, 14 Jun 2007 22:16:52 +0000 Subject: - Added option in live setup to disable infobox at all. Fixes #312 --- pages/pageelems.ecpp | 6 +++--- pages/setup.ecpp | 36 +++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'pages') diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 093255a..26cbf27 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -37,7 +37,7 @@ int update_status(1);
@@ -85,7 +85,7 @@ int update_status(1); <# ---------------------------------------------------------------------- #> <%def infobox_start_update> -<%cpp> { LiveStatusRequest('ibox.xml', 'infobox', <%cpp> if (update_status) { reply.sout() << "true"; } else { reply.sout() << "false"; } )<%cpp> } +<%cpp> if (LiveSetup().GetShowInfoBox()) { LiveStatusRequest('ibox.xml', 'infobox', <%cpp> if (update_status) { reply.sout() << "true"; } else { reply.sout() << "false"; } )<%cpp> } <# ---------------------------------------------------------------------- #> @@ -130,7 +130,7 @@ int update_status(1); <%def ajax_js> - + <%cpp>if (LiveSetup().GetShowInfoBox()) { <%cpp> } <# ---------------------------------------------------------------------- #> diff --git a/pages/setup.ecpp b/pages/setup.ecpp index 4499e98..008bec3 100644 --- a/pages/setup.ecpp +++ b/pages/setup.ecpp @@ -9,24 +9,26 @@ using namespace std; <%args> string lastchannel; - bool useauth = 0; + bool useauth = false; string login; string pass; string times; string startscreen; string theme; string localnetmask; + string showInfoBox; int authchanged = 0; <%session scope="global"> bool logged_in(false); <%include>page_init.eh -<{ +<%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> + <%cpp> #define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); +#define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); std::string message; @@ -47,6 +49,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); LiveSetup().SetTimes(times); LiveSetup().SetStartScreen(startscreen); LiveSetup().SetTheme(theme); + LiveSetup().SetShowInfoBox(!showInfoBox.empty()); LiveSetup().SaveSetup(); message = tr("Setup saved."); } @@ -64,6 +67,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); startscreen = LiveSetup().GetStartScreen(); theme = LiveSetup().GetTheme(); localnetmask = LiveSetup().GetLocalNetMask(); + showInfoBox = LiveSetup().GetShowInfoBox() ? "1" : ""; <& pageelems.doc_type &> @@ -94,9 +98,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& menu active=("setup") &>
- - - + + +
@@ -107,7 +111,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<$ tr("Setup") $>
<$ tr("Use authentication") $>:
- onclick="changeduseauth(this)"/> + CHECKIF(useauth); onclick="changeduseauth(this)"/>