], 'fieldConfig' => [ 'template' => "{label}\n<div class=\"col-lg-8\">{input}</div>\n<div class=\"col-lg-2\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-2 control-label'], ], ]); ?> <?= $form->field($model, 'course_id')->textInput() ?> <?= $form->field($model, 'task_type')->dropdownList(Task::typeList(), ['disabled' => 'true']) ?> <?= $form->field($model, 'title')->widget(MarkdownEditor::classname(), ['height' => 260, 'encodeLabels' => true, 'smarty' => true, 'previewAction' => Url::to(['task/preview']),]); ?> <?= $form->field($model, 'image')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'answer_json')->widget(MarkdownEditor::classname(), ['height' => 260, 'encodeLabels' => true, 'smarty' => true, 'previewAction' => Url::to(['task/preview']),]); ?> <?= $form->field($model, 'score')->dropdownList(Task::scoreList()) ?> <?= $form->field($model, 'is_timing')->dropdownList(Task::timingList()) ?> <span id="complete_time"> <?= $form->field($model, 'complete_time')->dropdownList(Task::timeList()) ?> </span> <div class="form-group"> <label class="col-lg-2 control-label"></label> <div class="col-lg-4"> <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> </div> </div>
if ($editor == "ckeditor") { ?> <?php echo $form->field($model, 'fulltext')->widget(CKEditor::className(), ['options' => ['rows' => 6], 'preset' => 'advanced']); ?> <?php } elseif ($editor == "tinymce") { ?> <?php echo $form->field($model, 'fulltext')->widget(TinyMce::className(), ['options' => ['rows' => 12], 'clientOptions' => ['plugins' => ["advlist autolink lists link charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"], 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"]]); ?> <?php } elseif ($editor == "markdown") { ?> <?php echo $form->field($model, 'fulltext')->widget(MarkdownEditor::classname(), ['height' => 150, 'encodeLabels' => true]); ?> <?php } elseif ($editor == "imperavi") { ?> <?php echo $form->field($model, 'fulltext')->widget(yii\imperavi\Widget::className(), ['options' => ['css' => 'wym.css']]); ?> <?php } else { ?> <?php echo $form->field($model, 'fulltext')->textarea(['rows' => 12]); ?> <?php }
if ($editor == "ckeditor") { ?> <?php echo $form->field($model, 'description')->widget(CKEditor::className(), ['options' => ['rows' => 10], 'preset' => 'basic']); ?> <?php } elseif ($editor == "tinymce") { ?> <?php echo $form->field($model, 'description')->widget(TinyMce::className(), ['clientOptions' => ['plugins' => ["advlist autolink lists link charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"], 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"], 'options' => ['rows' => 12]]); ?> <?php } elseif ($editor == "markdown") { ?> <?php echo $form->field($model, 'description')->widget(MarkdownEditor::classname(), ['height' => 300, 'encodeLabels' => true]); ?> <?php } elseif ($editor == "imperavi") { ?> <?php echo $form->field($model, 'description')->widget(yii\imperavi\Widget::className(), ['options' => ['css' => 'wym.css', 'minHeight' => 300], 'plugins' => ['fullscreen', 'clips']]); ?> <?php } else { ?> <?php echo $form->field($model, 'description')->textarea(['rows' => 12]); ?> <?php }
</div> <div class="well danger">您需要登录后才可以回答。<a href="/login">登录</a> | <a href="/signup">立即注册</a></div> </div> <?php } else { ?> <div class="comment-form" id="reply"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'content')->widget(MarkdownEditor::classname(), ['height' => 300, 'encodeLabels' => false]); ?> <div class="hint-block">特别注意:多个标签请用 <font color="red"><strong>半角逗号</strong></font> 分隔。</div> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', '回复') : Yii::t('app', '更新 '), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div> <?php