2012-11-20 Sergio Martin <sergio.martin@artica.es>
* pandora_windows_service.cc: Added support for custom fields git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7166 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f21456c9a2
commit
2debc7c2fc
|
@ -1,3 +1,8 @@
|
|||
2012-11-20 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* pandora_windows_service.cc: Added support for
|
||||
custom fields
|
||||
|
||||
2012-11-20 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* modules/pandora_module_factory.cc: Fix a few
|
||||
|
|
|
@ -1334,6 +1334,29 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
|||
|
||||
data_xml = getXmlHeader ();
|
||||
|
||||
/* Write custom fields */
|
||||
int c = 1;
|
||||
char numstr[21]; // enough to hold all numbers up to 64-bits
|
||||
sprintf(numstr, "%d", c);
|
||||
string token_name = conf->getValue ("custom_field"+numstr+"_name");
|
||||
string token_value = conf->getValue ("custom_field"+numstr+"_value");
|
||||
|
||||
if(token_name != "" && token_value != "") {
|
||||
data_xml += "<custom_fields>\n";
|
||||
while(token_name != "" && token_value != "") {
|
||||
data_xml += " <field>\n";
|
||||
data_xml += " <name><![CDATA["+ token_name +"]]></name>\n";
|
||||
data_xml += " <value><![CDATA["+ token_value +"]]></value>\n";
|
||||
data_xml += " </field>\n";
|
||||
|
||||
c++;
|
||||
sprintf(numstr, "%d", c);
|
||||
token_name = conf->getValue ("custom_field"+numstr+"_name");
|
||||
token_value = conf->getValue ("custom_field"+numstr+"_value");
|
||||
}
|
||||
data_xml += "</custom_fields>\n";
|
||||
}
|
||||
|
||||
/* Write module data */
|
||||
if (modules != NULL) {
|
||||
modules->goFirst ();
|
||||
|
|
Loading…
Reference in New Issue