} else { echo " <li>", form_input_text("poll_questions[{$question_id}][options][0]", null, 45, 255), " ", form_button_html("delete_option[{$question_id}][0]", 'submit', 'button_image delete_option', html_style_image('delete'), sprintf('title="%s"', gettext("Delete option"))), "</li>\n"; if (isset($_POST['add_option'][$question_id])) { echo poll_get_option_html($question_id, 1); } } echo " </ol>\n"; echo " </div>\n"; echo " </div>\n"; echo " ", form_button_html("add_option[{$question_id}]", 'submit', 'button_image add_option', html_style_image('add', gettext("Add new option")) . ' ' . gettext("Add new option")), "\n"; echo " </fieldset>\n"; } echo " </div>\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td>", form_button_html('add_question', 'submit', 'button_image add_question', html_style_image('add', gettext("Add new question")) . ' ' . gettext("Add new question")), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td>\n"; echo " <table border=\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Advanced Options"), "</td>\n"; if (($page_prefs & POLL_ADVANCED_DISPLAY) > 0) { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('hide', 'poll_advanced_toggle', 'hide', null, 'button_image toggle_button'), " </td>\n"; } else { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('show', 'poll_advanced_toggle', 'show', null, 'button_image toggle_button'), " </td>\n";
} else { echo " <li>", form_input_text("poll_questions[{$question_id}][options][0]", '', 45, 255), " ", form_button_html("delete_option[{$question_id}][0]", 'submit', 'button_image delete_option', sprintf("<img src=\"%s\" alt=\"\"/>", html_style_image('delete.png')), sprintf('title="%s"', gettext("Delete option"))), "</li>\n"; if (isset($_POST['add_option'][$question_id])) { echo poll_get_option_html($question_id, 1); } } echo " </ol>\n"; echo " </div>\n"; echo " </div>\n"; echo " ", form_button_html("add_option[{$question_id}]", 'submit', 'button_image add_option', sprintf("<img src=\"%s\" alt=\"\" /> %s", html_style_image('add.png'), gettext("Add new option"))), "\n"; echo " </fieldset>\n"; } echo " </div>\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td>", form_button_html('add_question', 'submit', 'button_image add_question', sprintf("<img src=\"%s\" alt=\"\" /> %s", html_style_image('add.png'), gettext("Add new question"))), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td>\n"; echo " <table border=\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Advanced Options"), "</td>\n"; if (($page_prefs & POLL_ADVANCED_DISPLAY) > 0) { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('hide.png', 'poll_advanced_toggle', 'hide', '', 'button_image toggle_button'), " </td>\n"; } else { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('show.png', 'poll_advanced_toggle', 'show', '', 'button_image toggle_button'), " </td>\n";
function poll_get_option_html($question_number, $option_number) { if (!is_numeric($question_number)) { return false; } if (!is_numeric($option_number)) { return false; } return sprintf("<li>%s %s</li>\n", form_input_text("poll_questions[{$question_number}][options][{$option_number}]", '', 45, 255), form_button_html("delete_option[{$question_number}][{$option_number}]", 'submit', 'button_image delete_option', sprintf("<img src=\"%s\" alt=\"\"/>", html_style_image('delete.png')), sprintf('title="%s"', gettext("Delete option")))); }