Пример #1
0
 * @copyright	Copyright (C) 2009 - 2012 corejoomla.com, Inc. All rights reserved.
 * @author		Maverick
 * @link		http://www.corejoomla.com/
 * @license		License GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
$user = JFactory::getUser();
$document = JFactory::getDocument();
$itemid = CJFunctions::get_active_menu_id();
$page_id = $this->params->get('hide_toolbar_responses', 0) == 1 ? -1 : 8;
CJFunctions::load_jquery(array('libs' => array('validate', 'colorbox')));
$wysiwyg = $user->authorise('core.wysiwyg', S_APP_NAME);
$bbcode = $this->params->get('default_editor', 'bbcode') == 'bbcode' ? true : false;
$content = $this->params->get('process_content_plugins', 0) == 1;
require_once JPATH_COMPONENT . '/helpers/formfields.php';
$formfields = new SurveyFormFields($wysiwyg, $bbcode, $content);
?>

<div id="cj-wrapper">
	<div<?php 
echo $this->hide_template == 1 ? ' class="full-screen"' : '';
?>
>
		<?php 
include_once JPATH_COMPONENT . DS . 'helpers' . DS . 'header.php';
?>
		
		<h2 class="page-header"><?php 
echo $this->escape($this->item->title);
?>
</h2>
Пример #2
0
 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;
 }