<%pre> #include #include #include "setup.h" #include "tools.h" #include "i18n.h" using namespace vdrlive; using namespace std; <%args> string lastchannel; bool useauth = false; string login; string pass; string times; string startscreen; string theme; string localnetmask; string showLogo; string useAjax; string showInfoBox; string useStreamdev; string showIMDb; string showChannelsWithoutEPG; string streamdevport; string streamdevtype; 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"); #define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" ); #define CHECKIF(x) reply.out() << ( (x) ? "checked=\"checked\"" : "" ); std::string message; if ( request.getMethod() == "POST") { if (authchanged && useauth && (login.empty() || pass.empty())) message = tr("Please set login and password!"); else { LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0); LiveSetup().SetUseAuth(useauth); if (useauth) { LiveSetup().SetAdminLogin(login); if (pass != "") LiveSetup().SetAdminPassword(pass); LiveSetup().SetLocalNetMask(localnetmask); LiveSetup().CheckLocalNet(request.getPeerIp()); } LiveSetup().SetTimes(times); LiveSetup().SetStartScreen(startscreen); LiveSetup().SetTheme(theme); LiveSetup().SetShowLogo(!showLogo.empty()); LiveSetup().SetUseAjax(!useAjax.empty()); if (LiveSetup().GetUseAjax()) { LiveSetup().SetShowInfoBox(!showInfoBox.empty()); } LiveSetup().SetUseStreamdev(!useStreamdev.empty()); LiveSetup().SetStreamdevPort(streamdevport.empty() ? 3000 : lexical_cast(streamdevport)); LiveSetup().SetStreamdevType(streamdevtype.empty() ? "PES" : streamdevtype); LiveSetup().SetShowIMDb(!showIMDb.empty()); LiveSetup().SetShowChannelsWithoutEPG(!showChannelsWithoutEPG.empty()); LiveSetup().SaveSetup(); message = tr("Setup saved."); } } pageTitle = tr("Setup"); int ilastchannel = LiveSetup().GetLastChannel(); if (ilastchannel == std::numeric_limits< int >::max()) lastchannel = ""; else lastchannel = lexical_cast(ilastchannel); login = LiveSetup().GetAdminLogin(); useauth = LiveSetup().GetUseAuth(); times = LiveSetup().GetTimes(); startscreen = LiveSetup().GetStartScreen(); theme = LiveSetup().GetTheme(); localnetmask = LiveSetup().GetLocalNetMask(); showLogo = LiveSetup().GetShowLogo() ? "1" : ""; useAjax = LiveSetup().GetUseAjax() ? "1" : ""; showInfoBox = LiveSetup().GetShowInfoBox() ? "1" : ""; useStreamdev = LiveSetup().GetUseStreamdev() ? "1" : ""; streamdevport = lexical_cast(LiveSetup().GetStreamdevPort()); streamdevtype = LiveSetup().GetStreamdevType(); showIMDb = LiveSetup().GetShowIMDb() ? "1" : ""; showChannelsWithoutEPG = LiveSetup().GetShowChannelsWithoutEPG() ? "1" : ""; <& pageelems.doc_type &> VDR-Live - <$ pageTitle $> <& pageelems.stylesheets &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=("setup") &>
<$ tr("Setup") $>
<$ tr("Use authentication") $>:
CHECKIF(useauth); onclick="changeduseauth(this)"/>
<$ tr("Show live logo image") $>:
CHECKIF(!showLogo.empty()); />
<$ tr("Use ajax technology") $>:
CHECKIF(!useAjax.empty()); onclick="changeduseajax(this)"/>
<$ tr("Allow video streaming") $>:
CHECKIF(!useStreamdev.empty()); onclick="changedusestreamdev(this)"/>
<$ tr("Add links to IMDb") $>:
CHECKIF(!showIMDb.empty()); />
<$ tr("Last channel to display") $>:
<$ tr("additional fixed times in 'What's on?'") $>:
<& tooltip.help text=(tr("Format is HH:MM. Separate multiple times with a semicolon")) &>
<$ tr("Show channels without EPG") $>:
CHECKIF(!showChannelsWithoutEPG.empty()); />
<$ tr("Start page") $>:
<$ tr("Theme") $>:
<%include>page_exit.eh