mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 19:12:57 +00:00
I have added the ability to filter the campaign_list request by language,
...to select info only about campaigns that appear to be translated into that language.
This commit is contained in:
parent
8942179063
commit
bbf7c4d67f
@ -37,6 +37,7 @@ SVN trunk:
|
||||
* Support filtering on campaign_list requests
|
||||
* filter by name
|
||||
* filter by last update time (before or after)
|
||||
* filter by language of translation
|
||||
* campaign_list response now contains the time the request was processed
|
||||
* campaign_list response now contains information about translations
|
||||
* utils: added weblist.pl and webtgz.pl web interface programs
|
||||
|
@ -139,6 +139,18 @@ void campaign_server::run()
|
||||
if((const t_string)(*req)["name"] != "" && (*req)["name"] != (**i)["name"]) continue;
|
||||
if(before_flag && ((const t_string)(**i)["timestamp"] == "" || lexical_cast_default<time_t>((**i)["timestamp"],0) >= before)) continue;
|
||||
if(after_flag && ((const t_string)(**i)["timestamp"] == "" || lexical_cast_default<time_t>((**i)["timestamp"],0) <= after)) continue;
|
||||
int found = 1;
|
||||
if((const t_string)(*req)["language"] != "") {
|
||||
found = 0;
|
||||
config::child_list translation = (**i).get_children("translation");
|
||||
for(config::child_list::iterator j = translation.begin(); j != translation.end(); ++j) {
|
||||
if((*req)["language"] == (**j)["language"]) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(found == 0) continue;
|
||||
campaign_list.add_child("campaign", (**i));
|
||||
}
|
||||
cmps = campaign_list.get_children("campaign");
|
||||
|
Loading…
x
Reference in New Issue
Block a user