File: /var/www/ilya/data/www/irk2.ru/templates/skin/new/actions/ActionQuestion/add.tpl
{include file='header.tpl' menu='topic_action' showWhiteBack=true}
{literal}
<script>
document.addEvent('domready', function() {
new Autocompleter.Request.HTML($('topic_tags'), DIR_WEB_ROOT+'/include/ajax/tagAutocompleter.php', {
'indicatorClass': 'autocompleter-loading', // class added to the input during request
'minLength': 2, // We need at least 1 character
'selectMode': 'pick', // Instant completion
'multiple': true // Tag support, by default comma separated
});
});
</script>
{/literal}
<div class="topic" style="display: none;">
<div class="content" id="text_preview"></div>
</div>
<div class="profile-user">
{if $sEvent=='add'}
<h1>Создание топика-опроса</h1>
{else}
<h1>Редактирование топика-опроса</h1>
{/if}
<form action="" method="POST" enctype="multipart/form-data">
<p><label for="blog_id">{$aLang.topic_create_blog}</label>
<select name="blog_id" id="blog_id" onChange="ajaxBlogInfo(this.value);">
<option value="0">{$aLang.topic_create_blog_personal}</option>
{foreach from=$aBlogsOwner item=oBlog}
<option value="{$oBlog->getId()}" {if $_aRequest.blog_id==$oBlog->getId()}selected{/if}>{$oBlog->getTitle()}</option>
{/foreach}
{foreach from=$aBlogsUser item=oBlogUser}
<option value="{$oBlogUser->getBlogId()}" {if $_aRequest.blog_id==$oBlogUser->getBlogId()}selected{/if}>{$oBlogUser->getBlogTitle()}</option>
{/foreach}
</select></p>
<script>
ajaxBlogInfo(document.getElementById('blog_id').value);
</script>
<p><label for="topic_title">{$aLang.topic_question_create_title}:</label><br />
<input type="text" id="topic_title" name="topic_title" value="{$_aRequest.topic_title}" class="w100p" {if $bEditDisabled}disabled{/if} /><br />
<span class="form_note">{$aLang.topic_question_create_title_notice}</span></p>
<p>
Варианты ответов:
<table>
{if count($_aRequest.answer)>=2}
{foreach from=$_aRequest.answer item=sAnswer}
<tr valign="top">
<td>
<nobr> <input type="radio" disabled /></nobr>
</td>
<td width="100%">
<input type="text" value="{$sAnswer}" name="answer[]" class="input-text" {if $bEditDisabled}disabled{/if}>
</td>
<td nowrap align="center">
<input type="button" name="drop_answer" value=" - " onClick="dropField(this);" {if $bEditDisabled}disabled{/if}>
<input type="button" value=" + " onClick="addField(this);" {if $bEditDisabled}disabled{/if}>
</td>
</tr>
{/foreach}
{else}
<tr valign="top">
<td>
<nobr> <input type="radio" disabled /></nobr>
</td>
<td width="100%">
<input type="text" value="" name="answer[]" class="input-text" >
</td>
<td nowrap align="center">
<input type="button" name="drop_answer" value=" - " onClick="dropField(this);">
<input type="button" value=" + " onClick="addField(this);">
</td>
</tr>
<tr valign="top">
<td>
<nobr> <input type="radio" disabled /></nobr>
</td>
<td width="100%">
<input type="text" value="" name="answer[]" class="input-text" >
</td>
<td nowrap align="center">
<input type="button" name="drop_answer" value=" - " onClick="dropField(this);">
<input type="button" value=" + " onClick="addField(this);">
</td>
</tr>
{/if}
</table>
{if !$bEditDisabled}
{literal}<script>checkFieldForLast();</script>{/literal}
{/if}
</p><br />
<p><label for="topic_text">{$aLang.topic_question_create_text}:</label><br />
<textarea name="topic_text" id="topic_text" rows="20">{$_aRequest.topic_text}</textarea></p>
<p><label for="topic_tags">{$aLang.topic_create_tags}:</label><br />
<input type="text" id="topic_tags" name="topic_tags" value="{$_aRequest.topic_tags}" class="w100p" /><br />
<span class="form_note">{$aLang.topic_create_tags_notice}</span></p>
<p><label for=""><input type="checkbox" id="topic_forbid_comment" name="topic_forbid_comment" class="checkbox" value="1" {if $_aRequest.topic_forbid_comment==1}checked{/if}/>
— {$aLang.topic_create_forbid_comment}</label><br />
<span class="form_note">{$aLang.topic_create_forbid_comment_notice}</span></p>
{if $oUserCurrent->isAdministrator()}
<p><label for=""><input type="checkbox" id="topic_publish_index" name="topic_publish_index" class="checkbox" value="1" {if $_aRequest.topic_publish_index==1}checked{/if}/>
— {$aLang.topic_create_publish_index}</label><br />
<span class="form_note">{$aLang.topic_create_publish_index_notice}</span></p>
{/if}
<p class="buttons">
<input type="submit" name="submit_topic_publish" value="{$aLang.topic_create_submit_publish}" class="right" />
<input type="submit" name="submit_preview" value="{$aLang.topic_create_submit_preview}" onclick="$('text_preview').getParent('div').setStyle('display','block'); ajaxTextPreview('topic_text',false); return false;" />
<input type="submit" name="submit_topic_save" value="{$aLang.topic_create_submit_save}" />
</p>
</form>
</div>
{include file='footer.tpl'}