added {channelname}, {channelid}, {channellogoexists} for all schedules list and current views

This commit is contained in:
louis
2014-11-01 10:23:34 +01:00
parent 3d702a9ad5
commit 13817c785f
9 changed files with 33 additions and 15 deletions

View File

@@ -165,7 +165,10 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) {
SetScraperPoster(event);
}
if (channel) {
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
stringTokens.insert(pair<string,string>("channelname", channel->Name() ? channel->Name() : ""));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
}
vector< map<string,string> > schedulesTokens;

View File

@@ -333,13 +333,16 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
}
if (channel) {
stringTokens.insert(pair<string,string>("channelname", channel->Name() ? channel->Name() : ""));
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
if (!event && !selectable) {
stringTokens.insert(pair<string,string>("title", channel->Name() ? ParseSeparator(channel->Name()) : ""));
}
} else {
stringTokens.insert(pair<string,string>("channelname", ""));
stringTokens.insert(pair<string,string>("channelid", ""));
intTokens.insert(pair<string, int>("channellogoexists", 0));
}
}

View File

@@ -36,6 +36,7 @@ public:
void SetMenu(eMenuCategory menuCat, bool menuInit);
void SetTitle(const char *title);
void SetChannel(const cChannel *channel) { view->SetChannel(channel); };
const cChannel *GetChannel(void) { return view->GetChannel(); };
void SetButtonTexts(const char *Red, const char *Green, const char *Yellow, const char *Blue);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetMessage(eMessageType type, const char *text);

View File

@@ -432,8 +432,9 @@ bool cDisplayMenuSchedulesView::DrawHeader(void) {
if (channel) {
stringTokens.insert(pair<string,string>("channelnumber", *cString::sprintf("%d", channel->Number())));
stringTokens.insert(pair<string,string>("channelname", channel->Name()));
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
}
bool hasIcon = false;
string icon = imgCache->GetIconName(menuTitle, cat);

View File

@@ -17,6 +17,7 @@ public:
void SetMenuCat(eMenuCategory newCat) { cat = newCat; };
void SetTitle(const char *title) {menuTitle = title; };
virtual void SetChannel(const cChannel *channel) {};
virtual const cChannel *GetChannel(void) { return NULL; };
void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; };
bool DrawBackground(void);
virtual bool DrawHeader(void);
@@ -51,6 +52,7 @@ public:
cDisplayMenuSchedulesView(cTemplateView *tmplView, eMenuCategory menuCat, bool menuInit);
virtual ~cDisplayMenuSchedulesView();
void SetChannel(const cChannel *channel) { this->channel = channel; };
const cChannel *GetChannel(void) { return channel; };
bool DrawHeader(void);
};