diff options
-rw-r--r-- | i18n.cpp | 22 | ||||
-rw-r--r-- | pages/login.ecpp | 2 | ||||
-rw-r--r-- | pages/setup.ecpp | 17 | ||||
-rw-r--r-- | setup.cpp | 16 | ||||
-rw-r--r-- | setup.h | 4 |
5 files changed, 60 insertions, 1 deletions
@@ -4033,6 +4033,28 @@ const tI18nPhrase Phrases[] = { "", // Dansk "", // Czech }, + { "Start page", // English + "Startseite", // Deutsch + "", // Slovenski + "", // Italiano + "", // Nederlands + "", // Português + "", // Français + "", // Norsk + "", // Finnish + "", // Polski + "", // Español + "", // Greek + "", // Svenska + "", // Românã + "", // Magyar + "", // Català + "", // Russian + "", // Hrvatski + "", // Eesti + "", // Dansk + "", // Czech + }, /* { "", // English "", // Deutsch diff --git a/pages/login.ecpp b/pages/login.ecpp index 7462a59..20624a8 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -28,7 +28,7 @@ if (action == "login") { logged_in = false; } -if (logged_in || !LiveSetup().UseAuth()) return reply.redirect("whats_on.html"); +if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetStartScreenLink()); }> <& pageelems.doc_type &> diff --git a/pages/setup.ecpp b/pages/setup.ecpp index a95f55d..1650211 100644 --- a/pages/setup.ecpp +++ b/pages/setup.ecpp @@ -12,6 +12,7 @@ using namespace std; string login; string pass; string times; + string startscreen; </%args> <%session scope="global"> bool logged_in(false); @@ -21,6 +22,8 @@ bool logged_in(false); if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); }> <%cpp> +#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); + if ( request.getMethod() == "POST") { LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0); LiveSetup().SetUseAuth(useauth); @@ -30,6 +33,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); LiveSetup().SetAdminPassword(pass); } LiveSetup().SetTimes(times); + LiveSetup().SetStartScreen(startscreen); LiveSetup().SaveSetup(); } pageTitle = tr("Setup"); @@ -42,6 +46,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); login = LiveSetup().GetAdminLogin(); useauth = LiveSetup().UseAuth(); times = LiveSetup().GetTimes(); + startscreen = LiveSetup().GetStartScreen(); </%cpp> <& pageelems.doc_type &> @@ -106,6 +111,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); </tr> <tr> <td class="border" style="border-left: 1px solid black"></td> + <td class="label"><$ tr("Start page") $>:</td> + <td><select name="startscreen" size="1" id="startscreen"> + <option value="whatsonnow" <{ SELECTIF(startscreen == "whatsonnow") }>><$ tr("What's on now?") $></option> + <option value="whatsonnext" <{ SELECTIF(startscreen == "whatsonnext") }>><$ tr("What's on next?") $></option> + <option value="schedule" <{ SELECTIF(startscreen == "schedule") }>><$ tr("Schedule") $></option> + <option value="recordings" <{ SELECTIF(startscreen == "recordings") }>><$ tr("Recordings") $></option> + <option value="timers" <{ SELECTIF(startscreen == "timers") }>><$ tr("Timers") $></option> + </select></td> + <td class="border" style="border-right: 1px solid black"></td> + </tr> + <tr> + <td class="border" style="border-left: 1px solid black"></td> <td class="buttonpanel" colspan="2"> <button class="green" type="submit" name="save" onclick="return checksearch();"><$ tr("Save") $></button> </td> @@ -74,6 +74,7 @@ bool Setup::ParseSetupEntry( char const* name, char const* value ) else if ( strcmp( name, "AdminLogin" ) == 0 ) m_adminLogin = value; else if ( strcmp( name, "AdminPasswordMD5" ) == 0 ) m_adminPasswordMD5 = value; else if ( strcmp( name, "UserdefTimes" ) == 0 ) m_times = value; + else if ( strcmp( name, "StartPage" ) == 0 ) m_startscreen = value; else return false; return true; } @@ -132,6 +133,20 @@ std::string Setup::SetAdminPassword(std::string password) return m_adminPasswordMD5; } +std::string Setup::GetStartScreenLink() const +{ + if (m_startscreen == "whatsonnext") + return "whats_on.html?type=next"; + else if (m_startscreen == "schedule") + return "schedule.html"; + else if (m_startscreen == "timers") + return "timers.html"; + else if (m_startscreen == "recordings") + return "recordings.html"; + else + return "whats_on.html?type=now"; +} + bool Setup::SaveSetup() { if (!liveplugin) return false; @@ -143,6 +158,7 @@ bool Setup::SaveSetup() liveplugin->SetupStore("AdminPasswordMD5", m_adminPasswordMD5.c_str()); } liveplugin->SetupStore("UserdefTimes", m_times.c_str()); + liveplugin->SetupStore("StartPage", m_startscreen.c_str()); return true; } @@ -36,6 +36,8 @@ public: int GetAdminPasswordLength() const; bool UseAuth() const { return m_useAuth; } std::string GetTimes() const { return m_times; } + std::string GetStartScreen() const { return m_startscreen; } + std::string GetStartScreenLink() const; void SetLastChannel(int lastChannel) { m_lastChannel = lastChannel; } void SetAdminLogin(std::string login) { m_adminLogin = login; } @@ -43,6 +45,7 @@ public: void SetUseAuth(int auth) { m_useAuth = auth; } void SetScrenshotInterval(int interval) { m_screenshotInterval = interval; } void SetTimes(std::string times) { m_times = times; } + void SetStartScreen(std::string startscreen) { m_startscreen = startscreen; } bool SaveSetup(); @@ -70,6 +73,7 @@ private: std::string m_adminLogin; std::string m_adminPasswordMD5; std::string m_times; + std::string m_startscreen; bool CheckServerPort(); bool CheckServerIps(); |