* @copyright Copyright 2009-2011
* @license http://www.gnu.org/licenses/gpl.txt GNU General Public License V2.0
*/
// Inputs for the AJAX script:
// element = element ID of the element where the output will be written
// action = action to perform (generally process the poll results)
// val1/param1 = poll ID
// val2/param2 = poll type
// valx/paramx = for each option one pair. If one option is text input, one less. So we can have 6 options.
?>
';
// Draw the form
// Question
$content .= '
' . $poll['question'] . '
' . "\n";
// Options: type is 0: radiobutton, type=1: checkbox
foreach($poll['options'] as $oid => $option) {
$content .= '';
$content .= '
' . "\n";
$content .= ($poll['type'] == "0" ? zen_draw_radio_field('poll_vote', $oid, false, "class='PollManagerOptionInputField' id='poll_vote" . $oid . "'") : zen_draw_checkbox_field("poll_vote" . $oid, $oid , false, "id='poll_vote" . $oid . "'")) . "\n";
$content .= '
' . $option['text'];
if ($option['inpf'] == 1) $content .= '
' . zen_draw_input_field('vote_text' . $oid, '', "class=\"PollManagerOptionUserInput\" onkeyup=\"document.getElementById('poll_vote".$oid."').checked=1;\"", 'text', false) . '
';
else $content .= '
';
$content .= '' . "\n";
}
// Vote button with call to AJAX
$content .= "