<div id="selWidgetGenerate">
<div class="clsCommonTopAnalystRoundedCorner">
  <!--rounded corners-->
  <h2 class="clsInboxReadHeading">{$LANG.page_title}</h2>
   <div class="clsShadedBg">
  <div class="lbtopanalyst">
    <div class="rbtopanalyst">
      <div class="bbtopanalyst">
        <div class="blctopanalyst">
          <div class="brctopanalyst">
            <div class="tbtopanalyst">
              <div class="tlctopanalyst">
                <div class="trctopanalyst">


{include file='../general/information.tpl'}
 <div class="clsInboxReadTbl">
	{if $myobj->isShowPageBlock('form_widget')}
        <div id="selWidget" class="clsCommonWidgetSection">
            <h3>{$LANG.build_widget}</h3>
            <form name="selFormAskQuestion" method="post" id="selFormAskQuestion" action="{$myobj->getCurrentUrl()}" autocomplete="off">
            <table summary="{$LANG.widget_generation}" class="clsWidgetTable">
                    <tr>
                        <td class="{$myobj->getCSSFormLabelCellClass('type')}"><label for="type">{$LANG.question_type}</label></td>
                        <td class="{$myobj->getCSSFormLabelCellClass('type')}">
                        <select name="type" id="type" onchange="this.form.submit()" tabindex="{smartyTabIndex}">
                            {$myobj->generalPopulateArray($myobj->LANG_LIST_ARR.widget_type, $myobj->getFormField('type'))}
                        </select>
                    </td>
                    </tr>
            {if $myobj->getFormField('type') != 'ask_only'}
                    <tr>
                        <td class="{$myobj->getCSSFormLabelCellClass('type')}"><label for="question">{$LANG.show_questions}</label></td>
                        <td class="{$myobj->getCSSFormLabelCellClass('type')}">
                        <select name="question" id="question" onchange="this.form.submit()" tabindex="{smartyTabIndex}">
                            {$myobj->generalPopulateArray($myobj->LANG_LIST_ARR.question_type, $myobj->getFormField('question'))}
                        </select>
                     </td>
                    </tr>
                <tr>
                    <td class="{$myobj->getCSSFormLabelCellClass('category')}"><label for="category">{$LANG.common_category}</label></td>
                    <td class="{$myobj->getCSSFormFieldCellClass('category')}">{$myobj->getFormFieldErrorTip('category')}
                           <select name="category" id="category" tabindex="{smartyTabIndex}" onchange="this.form.submit()">
                           <option value="" selected>
                            {$LANG.common_select_choose}
                            </option>
                            {$myobj->generalPopulateArray($myobj->populateCategories_arr, $myobj->getFormField('category'))}
                            </select>
                    </td>
                </tr>
                <tr>
                       <td class="{$myobj->getCSSFormLabelCellClass('sub_category')}"><label for="sub_category">{$LANG.select_sub_category}</label></td>
                       <td class="{$myobj->getCSSFormFieldCellClass('sub_category')}" id="subCatDiv">{$myobj->getFormFieldErrorTip('sub_category')}
                            <select name="sub_category" id="sub_category" onchange="this.form.submit()" tabindex="{smartyTabIndex}">
                               <option value="">{$LANG.common_select_choose}</option>
                               {if $myobj->getFormField('category')}
	                               {$myobj->generalPopulateArray($myobj->populateSubCategories_arr, $myobj->getFormField('sub_category'))}
                               {/if}
                            </select>
                      </td>
                </tr>
                    <tr>
                             <td class="{$myobj->getCSSFormLabelCellClass('type')}"><label for="question_count">{$LANG.question_count}</label></td>
                         <td class="{$myobj->getCSSFormLabelCellClass('type')}">
                        <select name="question_count" id="question_count" onchange="this.form.submit()" tabindex="{smartyTabIndex}">
                           {$myobj->populateBWNumbers(1, 10, $myobj->getFormField('question_count'))}
                        </select>
                        <input type="hidden" name="submit1" id="submit1" />
                    </td>
                    </tr>
            {/if}
            </table>
            </form>
        </div>

    {/if}

	{if $myobj->isShowPageBlock('form_widget_preview')}
			{if $myobj->isResultsFound()}
                <div class="clsCommonPreviewWidgetSection">
                    <h3><span>{$LANG.preview_widget}</span></h3>
					{$myobj->showQuestionList()}
				</div>
			{else}
                <div id="selMsgAlert">
                    <p>{$LANG.common_no_records_found}</p>
                </div>
			{/if}
	 {/if}

       <div class="clsCommonPreviewWidgetSection">
		<h3>{$LANG.code_widget}</h3>

       {if $myobj->isShowPageBlock('form_widget_code')}
			<div id="selGeneratedCode">
                <table class="clsWidgetGenerateTable">
                    <tr>
                        <td>
                            <p>{$LANG.widget_embed_hint}</p>
                            <input type="text" size="70"  onClick="this.select()"   name ="code" id="code" class="clsGeneratedCode" readonly="readonly"value="<script language='JavaScript' type='text/javascript' src='{$CFG.site.url}{$CFG.admin.index.anova_module}/widgetGenerate.php?embed=1&amp;question_count={$myobj->getFormField('question_count')}&amp;type={$myobj->getFormField('type')}&amp;category={$myobj->getFormField('category')}&amp;sub_category={$myobj->getFormField('sub_category')}&amp;question={$myobj->getFormField('question')}&amp;uid={$myobj->getFormField('uid')}'></script>" />
                        </td>
                    </tr>
                </table>
              </div>
	   {/if}
	</div>
    </div></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  </div>
  <!--end of rounded corners-->
</div>
</div>