echo $formfields->get_grid_checkbox_question($question, $class); break; case 7: echo $formfields->get_single_line_textbox_question($question, $class); break; case 8: echo $formfields->get_multiline_textarea_question($question, $class); break; case 9: echo $formfields->get_password_textbox_question($question, $class); break; case 10: echo $formfields->get_rich_textbox_question($question, $class); break; case 11: echo $formfields->get_image_radio_question($question, $class, S_IMAGES_URI); break; case 12: echo $formfields->get_image_checkbox_question($question, $class, S_IMAGES_URI); break; case 13: echo $formfields->get_user_name_question($question, $class); break; case 14: echo $formfields->get_user_email_question($question, $class); break; case 15: echo $formfields->get_calendar_question($question, $class); break; case 16: echo $formfields->get_address_question($question, $class);
private function get_survey_form($questions) { $user = JFactory::getUser(); $options = JComponentHelper::getParams(S_APP_NAME); $wysiwyg = $user->authorise('core.wysiwyg', S_APP_NAME); $bbcode = $options->get('default_editor', 'bbcode') == 'bbcode' ? true : false; $content = $options->get('process_content_plugins', 0) == 1; require_once JPATH_ROOT . DS . 'components' . DS . S_APP_NAME . DS . 'helpers' . DS . 'formfields.php'; $formfields = new SurveyFormFields($wysiwyg, $bbcode, $content); $class = ''; $content = ''; foreach ($questions as $qid => $question) { switch ($question->question_type) { case 1: $content .= $formfields->get_page_header_question($question, $class); break; case 2: $content .= $formfields->get_radio_question($question, $class); break; case 3: $content .= $formfields->get_checkbox_question($question, $class); break; case 4: $content .= $formfields->get_select_question($question, $class); break; case 5: $content .= $formfields->get_grid_radio_question($question, $class); break; case 6: $content .= $formfields->get_grid_checkbox_question($question, $class); break; case 7: $content .= $formfields->get_single_line_textbox_question($question, $class); break; case 8: $content .= $formfields->get_multiline_textarea_question($question, $class); break; case 9: $content .= $formfields->get_password_textbox_question($question, $class); break; case 10: $content .= $formfields->get_rich_textbox_question($question, $class); break; case 11: $content .= $formfields->get_image_radio_question($question, $class, S_IMAGES_URI); break; case 12: $content .= $formfields->get_image_checkbox_question($question, $class, S_IMAGES_URI); break; default: break; } } return $content; }