<script type="text/javascript"> window.opener.location='xmlfeed.php?editfeed=yes&feed_id=<?php echo $_REQUEST['feed_id']; ?> '; </script> <?php } } ?> <P style="font-weight: bold">You can type in any value, and this value will get exported to the feed as is. You can also type in any of the following tags: </p> <?php JBXM_echo_static_tag_list(); ?> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?> "> <input type="hidden" name="form_id" value="<?php echo jb_escape_html($_REQUEST['form_id']); ?> " > <input type="hidden" name="schema_id" value="<?php echo jb_escape_html($_REQUEST['schema_id']); ?> " > <input type="hidden" name="element_id" value="<?php echo jb_escape_html($_REQUEST['element_id']);
function JBXM_display_xml_schema_config_form() { if ($_REQUEST['element_id'] != '') { $sql = "SELECT * from xml_export_schemas as t1, xml_export_elements as t2 WHERE t1.schema_id=t2.schema_id and t2.schema_id='" . jb_escape_sql($_REQUEST['schema_id']) . "' and t2.element_id='" . jb_escape_sql($_REQUEST['element_id']) . "' "; $result = JB_mysql_query($sql) or die(mysql_error() . $sql); $row = mysql_fetch_array($result, MYSQL_ASSOC); $_REQUEST['element_name'] = $row['element_name']; $_REQUEST['is_cdata'] = $row['is_cdata']; $_REQUEST['parent_element_id'] = $row['parent_element_id']; $_REQUEST['attributes'] = $row['attributes']; $_REQUEST['static_data'] = $row['static_data']; $_REQUEST['is_pivot'] = $row['is_pivot']; $_REQUEST['field_id'] = $row['field_id']; $_REQUEST['form_id'] = $row['form_id']; $_REQUEST['description'] = $row['description']; $_REQUEST['fieldcondition'] = $row['fieldcondition']; $_REQUEST['is_boolean'] = $row['is_boolean']; $_REQUEST['qualify_codes'] = $row['qualify_codes']; $_REQUEST['qualify_cats'] = $row['qualify_cats']; $_REQUEST['strip_tags'] = $row['strip_tags']; $_REQUEST['truncate'] = $row['truncate']; $_REQUEST['comment'] = $row['comment']; $_REQUEST['is_mandatory'] = $row['is_mandatory']; $_REQUEST['static_mod'] = $row['static_mod']; $_REQUEST['multi_fields'] = $row['multi_fields']; } else { echo '<h4>Insert a new Element: </h4>'; } if (JBXM_is_schema_locked($_REQUEST['schema_id'])) { echo "<b><font color='red'>Note: This schema is locked from making changes. You will need to unlock this schema before making changes. Please note that changing the schema will affect all existing feeds which use this schema. </font> Click 'Edit' above, there you can unlock.</b>"; $disabled = " disabled "; } ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <input type="hidden" name="config" value="<?php echo jb_escape_html($_REQUEST['config']); ?> "> <input type="hidden" name="form_id" value="<?php echo jb_escape_html($_REQUEST['form_id']); ?> "> <input type="hidden" name="schema_id" value="<?php echo jb_escape_html($_REQUEST['schema_id']); ?> "> <input type="hidden" name="element_id" value="<?php echo jb_escape_html($_REQUEST['element_id']); ?> "> <input type="hidden" name="fieldcondition" value="<?php echo jb_escape_html($_REQUEST['fieldcondition']); ?> "> <table border="0" cellSpacing="1" cellPadding="3" bgColor="#d9d9d9" id="table1"> <tr> <td bgColor="#eaeaea"><b>Element Name</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="text" name="element_name" size="40" value="<?php echo JB_escape_html($_REQUEST['element_name']); ?> "><br> <font size="1">eg, if you want to export as <salary>$2000</salary> then the element name is: salary</font></td> </tr> <tr> <td bgColor="#eaeaea"><b>Parent Element</b></td> <td bgcolor="#ffffff"><select <?php echo $disabled; ?> <?php echo $disabled; ?> size="1" name="parent_element_id"> <?php if ($_REQUEST['parent_element_id'] === '0') { $checked = ' selected '; } ?> <option <?php echo $checked; ?> value='0'>Document Root</option> <?php $sql = "SELECT * from xml_export_elements where schema_id='" . jb_escape_sql($_REQUEST['schema_id']) . "' "; $result = JB_mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if ($_REQUEST['parent_element_id'] == $row['element_id']) { $checked = ' selected '; } else { $checked = ''; } echo '<option ' . $checked . ' value="' . $row['element_id'] . '">' . JB_escape_html($row['element_name']) . '</option>'; } ?> </select><br> <font size="1">(Use this to build the xml file document tree displayed on the right.)</font></td> </tr> <tr> <td bgColor="#eaeaea"><b>Attributes</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="text" name="attributes" size="40" value="<?php echo JB_escape_html($_REQUEST['attributes']); ?> "><br> <font size="1">Optional. eg, if you want to export as <<b>rss version="2.0"</b> ></rss> then the attribute is: rss version="2.0"<br> Tip: You can use any of the variables that are listed under the 'Static Data' section of this form. eg. %POST_ID%</font></td> </tr> <tr> <td bgColor="#eaeaea"><b>Is pivot?</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['is_pivot'] == 'Y') { echo ' checked '; } ?> name="is_pivot">Yes, make this entity the pivot entity which will be iterated during the xml feed generation. Each feed can only contain 1 pivot entity. <br> <input type="radio" <?php echo $disabled; ?> value="N" <?php if ($_REQUEST['is_pivot'] != 'Y') { echo ' checked '; } ?> name="is_pivot">No, not pivot (default)</td> </tr> <tr> <td bgColor="#eaeaea"><b>Is CDATA?</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['is_cdata'] == 'Y') { echo ' checked '; } ?> name="is_cdata">Yes, export the data using CDATA notation, <font size="1">eg. <salary><![CDATA[$2000]]></salary></font><br> <input <?php echo $disabled; ?> type="radio" value="N" <?php if ($_REQUEST['is_cdata'] != 'Y') { echo ' checked '; } ?> name="is_cdata">No, export as XML entities</td> </tr> <tr> <td bgColor="#eaeaea"><b>Is Mandatory?</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['is_mandatory'] == 'Y') { echo ' checked '; } ?> name="is_mandatory">Yes, this element must be always present in the feed. Indicated by a <font color="red" size="4">*</font><br> <input <?php echo $disabled; ?> type="radio" value="N" <?php if ($_REQUEST['is_mandatory'] != 'Y') { echo ' checked '; } ?> name="is_mandatory">No</td> </tr> <tr> <td bgColor="#eaeaea"><b>Multi-fields</b></td> <td bgcolor="#ffffff"> <select name='multi_fields'> <option <?php if ($_REQUEST['multi_fields'] == 1) { echo ' selected '; } ?> value='1'>1 field (default)</option> <option <?php if ($_REQUEST['multi_fields'] == 2) { echo ' selected '; } ?> value='2'>2 fields</option> <option <?php if ($_REQUEST['multi_fields'] == 3) { echo ' selected '; } ?> value='3'>3 fields</option> <option <?php if ($_REQUEST['multi_fields'] == 4) { echo ' selected '; } ?> value='4'>4 fields</option> </select> <font size="1">Selecting multi-fields will allow you to merge several fields in to 1 exported attribute. Eg. If you have the location details stored in 3 different fields, you can select '3 fields' to have it exported in one 'location' attribute. (This is the case for Google Base)</font> </td> </tr> <tr> <td bgColor="#eaeaea"><b>Static Data</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="text" name="static_data" size="40" value="<?php echo JB_escape_html($_REQUEST['static_data']); ?> "><br> Optional. Instead of specifying a data field to bind, you may have this element contain static hard-coded data, or special variables. Here are the variables for use:<br> <?php JBXM_echo_static_tag_list(); ?> </td> </tr> <tr> <?php if ($_REQUEST['static_mod'] == false) { $_REQUEST['static_mod'] = 'F'; } ?> <td bgColor="#eaeaea"><b>Static Data Options</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="A" <?php if ($_REQUEST['static_mod'] == 'A') { echo ' checked '; } ?> name="static_mod">Append to the end<br> <input <?php echo $disabled; ?> type="radio" value="P" <?php if ($_REQUEST['static_mod'] == 'P') { echo ' checked '; } ?> name="static_mod">Prepend to the start<br> <input type="radio" <?php echo $disabled; ?> value="F" <?php if ($_REQUEST['static_mod'] == 'F') { echo ' checked '; } ?> name="static_mod">Fill (default)<br> <font size="1">These options are useful if you want to have the Static Data appended/prepended to the exported attributes.</font></td> </tr> <tr> <td bgColor="#eaeaea"><b>Comment</b></td> <td bgcolor="#ffffff"><input type="text" size="40" name="comment" value="<?php echo jb_escape_html($_REQUEST['comment']); ?> "></td> </tr> <tr> <td bgColor="#eaeaea" colspan="2"><b>Data Filtering Options</b></td> </tr> <tr> <?php if ($_REQUEST['is_boolean'] != 'Y') { $_REQUEST['is_boolean'] = 'N'; } ?> <td bgColor="#eaeaea"><b>Is Boolean?</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['is_boolean'] == 'Y') { echo ' checked '; } ?> name="is_boolean">Yes. Will be exported as 'true' or 'false' depending on if a value was matched<br> <input type="radio" <?php echo $disabled; ?> value="N" <?php if ($_REQUEST['is_boolean'] != 'Y') { echo ' checked '; } ?> name="is_boolean">No (default)</td> </tr> <tr><?php if ($_REQUEST['qualify_codes'] == '') { $_REQUEST['qualify_codes'] = 'Y'; } ?> <td bgColor="#eaeaea"><b>Radio-buttons, Checkboxes, Selects</b></td> <td bgcolor="#ffffff"> <input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['qualify_codes'] == 'Y') { echo ' checked '; } ?> name="qualify_codes">Convert codes to their full name, eg US becomes U.S.A.<br> <input <?php echo $disabled; ?> type="radio" value="N" <?php if ($_REQUEST['qualify_codes'] != 'Y') { echo ' checked '; } ?> name="qualify_codes">Export coded fields as their code. (default)<br> </td> </tr> <tr> <?php if ($_REQUEST['qualify_cats'] == '') { $_REQUEST['qualify_cats'] = 'Y'; } ?> <td bgColor="#eaeaea"><b>Category Fields</b></td> <td bgcolor="#ffffff"> <input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['qualify_cats'] == 'Y') { echo ' checked '; } ?> name="qualify_cats">Convert category numbers to their full name.<br> <input <?php echo $disabled; ?> type="radio" value="N" <?php if ($_REQUEST['qualify_cats'] != 'Y') { echo ' checked '; } ?> name="qualify_cats">Export as category IDs. (default)</td> </tr> <tr> <td bgColor="#eaeaea"><b>Truncate</b></td> <td bgcolor="#ffffff"> Truncate to <input <?php echo $disabled; ?> type="text" value="<?php echo jb_escape_html($_REQUEST['truncate']); ?> " size="3" name="truncate"> characters. (Enter a number. 0 = do not truncate)</td> </tr> <tr> <td bgColor="#eaeaea"><b>Strip HTML Tags</b></td> <td bgcolor="#ffffff"><input <?php echo $disabled; ?> type="radio" value="Y" <?php if ($_REQUEST['strip_tags'] == 'Y') { echo ' checked '; } ?> name="strip_tags">Yes<br> <input <?php echo $disabled; ?> type="radio" value="N" <?php if ($_REQUEST['strip_tags'] != 'Y') { echo ' checked '; } ?> name="strip_tags">No (default)</td> </tr> </table> <p><input <?php echo $disabled; ?> type="submit" value="Save" name="save_element"></p> </form> <?php }