mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- yWeb: port "Tuxbox.DisplayLogos" from martii
This commit is contained in:
@@ -112,6 +112,7 @@ const CNeutrinoYParser::TyFuncCall CNeutrinoYParser::yFuncCallList[]=
|
||||
{"get_channels_as_dropdown", &CNeutrinoYParser::func_get_channels_as_dropdown},
|
||||
{"get_bouquets_with_epg", &CNeutrinoYParser::func_get_bouquets_with_epg},
|
||||
{"get_actual_channel_id", &CNeutrinoYParser::func_get_actual_channel_id},
|
||||
{"get_logo_name", &CNeutrinoYParser::func_get_logo_name},
|
||||
{"get_mode", &CNeutrinoYParser::func_get_mode},
|
||||
{"get_video_pids", &CNeutrinoYParser::func_get_video_pids},
|
||||
{"get_audio_pid", &CNeutrinoYParser::func_get_radio_pid},
|
||||
@@ -351,7 +352,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std:
|
||||
std::string timestr;
|
||||
bool have_logos = false;
|
||||
|
||||
if(!hh->WebserverConfigList["Tuxbox.LogosURL"].empty())
|
||||
if (!hh->WebserverConfigList["Tuxbox.LogosURL"].empty() && hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" )
|
||||
have_logos = true;
|
||||
|
||||
for(int j = 0; j < (int) channels.size(); j++)
|
||||
@@ -522,6 +523,20 @@ std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler *, std::
|
||||
{
|
||||
return string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, CZapit::getInstance()->GetCurrentChannelID());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// func: Get Logo Name
|
||||
//-------------------------------------------------------------------------
|
||||
std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string channelId)
|
||||
{
|
||||
if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") {
|
||||
t_channel_id cid;
|
||||
if (1 == sscanf(channelId.c_str(), "%llx", &cid))
|
||||
return NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// y-func : get_mode (returns tv|radio|unknown)
|
||||
//-------------------------------------------------------------------------
|
||||
|
@@ -36,6 +36,7 @@ private:
|
||||
std::string func_get_actual_bouquet_number(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_channels_as_dropdown(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_actual_channel_id(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_logo_name(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_bouquets_with_epg(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_mode(CyhookHandler *hh, std::string para);
|
||||
std::string func_get_video_pids(CyhookHandler *hh, std::string para);
|
||||
|
@@ -59,6 +59,7 @@ start-block~nhttpd_save_settings
|
||||
{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=}
|
||||
{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=}
|
||||
{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}~cache=}
|
||||
{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=}
|
||||
{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=}
|
||||
{=func:do_reload_httpd_config=}
|
||||
end-block~nhttpd_save_settings
|
||||
|
@@ -106,7 +106,7 @@ function _show_epg()
|
||||
<table id="epglist" class="y_invisible_table" cellpadding="4" cellspacing="0" width="100%">
|
||||
<thead align="left">
|
||||
<tr>
|
||||
<th colspan="2"><img id="logo" src="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL=}/{=logoid=}.png" style="visibility:hidden; max-width: 50px;"/> </th>
|
||||
<th colspan="2"><img id="logo" src="{=func:get_logo_name {=channel=}=}" style="visibility:hidden; max-width: 50px;"/></th>
|
||||
<th>{=L:date=}</th><th>{=L:from=}</th><th>{=L:to=}</th><th>{=L:program=}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@@ -8,6 +8,7 @@ function form_init()
|
||||
obj_set_radio_value('authenticate', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}");
|
||||
obj_set_radio_value('threading', "{=ini-get:/var/tuxbox/config/nhttpd.conf;webserver.threading;false=}");
|
||||
obj_set_radio_value('mod_sendfile_sendAll', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;false=}");
|
||||
obj_set_radio_value('Tuxbox_DisplayLogos', "{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;true=}"); // MARTII
|
||||
}
|
||||
function do_submit()
|
||||
{
|
||||
@@ -98,6 +99,13 @@ function do_submit()
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="y_form_header">{=L:logos=}</td></tr>
|
||||
<tr>
|
||||
<td>{=L:set.nhttpd.display_logos=}</td>
|
||||
<td>
|
||||
<input type="radio" name="Tuxbox_DisplayLogos" value="false" />{=L:off=}
|
||||
<input type="radio" name="Tuxbox_DisplayLogos" value="true" />{=L:on=}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{=L:set.nhttpd.url_of_logos=}</td>
|
||||
<td><input type="text" name="Tuxbox_LogosURL" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL~cache=}" title="{=L:set.nhttpd.url_of_logos_desc=}"/></td>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
version=2.9.0.16
|
||||
date=31.03.2015
|
||||
version=2.9.0.17
|
||||
date=05.04.2015
|
||||
type=Release
|
||||
info=Port CST
|
||||
|
@@ -312,6 +312,7 @@ set.nhttpd.alternate_web_folder=Alternativer Web-Ordner
|
||||
set.nhttpd.hosted_folder=Eingebundenes Verzeichnis
|
||||
set.nhttpd.allowed_file_extensions=Erlaubte Dateiendungen / MIME
|
||||
set.nhttpd.allow_all_file_extensions=Alle Dateiendungen erlauben
|
||||
set.nhttpd.display_logos=Logos anzeigen
|
||||
set.nhttpd.url_of_logos_desc=URL bzw. Verzeichnis der Logos eingeben
|
||||
set.nhttpd.url_of_logos=URL bzw. Verzeichnis der Logos
|
||||
set.nhttpd.server=Server
|
||||
|
@@ -315,6 +315,7 @@ set.nhttpd.alternate_web_folder=Alternate Web-Folder
|
||||
set.nhttpd.hosted_folder=Mounted directory
|
||||
set.nhttpd.allowed_file_extensions=Allowed File Extensions / MIME
|
||||
set.nhttpd.allow_all_file_extensions=Allow all File Extensions
|
||||
set.nhttpd.display_logos=Display Logos
|
||||
set.nhttpd.url_of_logos_desc=Enter URL or directory of Logos
|
||||
set.nhttpd.url_of_logos=URL or directory of Logos
|
||||
set.nhttpd.server=Server
|
||||
|
@@ -548,6 +548,7 @@ void Cyhttpd::ReadConfig(void) {
|
||||
ConfigList["WebsiteMain.hosted_directory"] = Config->getString(
|
||||
"WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT);
|
||||
|
||||
ConfigList["Tuxbox.DisplayLogos"] = Config->getString("Tuxbox.DisplayLogos", "true");
|
||||
// Check location of logos
|
||||
if (Config->getString("Tuxbox.LogosURL", "").empty()) {
|
||||
if (access(ConfigList["WebsiteMain.override_directory"] + "/logos", R_OK) == 0) {
|
||||
|
Reference in New Issue
Block a user