],
	        '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>
Пример #2
0
?>

    <?php 
echo $form->field($model, 'poster')->fileInput();
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'published_at', ['options' => ['class' => 'drp-container form-group']])->widget(DateRangePicker::classname(), ['model' => $model, 'attribute' => 'published_at', 'convertFormat' => true, 'pluginOptions' => ['timePicker' => true, 'timePickerIncrement' => 15, 'locale' => ['format' => 'Y-m-d H:i:s'], 'singleDatePicker' => true, 'showDropdowns' => true]]);
?>

    <?php 
echo $form->field($model, 'body')->widget(MarkdownEditor::className(), []);
?>

    <?php 
echo $form->field($model, 'is_lts')->widget(SwitchBox::className(), ['clientOptions' => ['size' => 'medium', 'onColor' => 'success', 'offColor' => 'danger']]);
?>

    <?php 
echo $form->field($model, 'keyword')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'description')->textInput(['maxlength' => true]);
?>

    <?php 
Пример #3
0
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 
}
Пример #4
0
 public function run()
 {
     echo MarkdownEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'showExport' => $this->showExport, 'toolbar' => [['buttons' => [MarkdownEditor::BTN_BOLD => ['icon' => 'bold', 'title' => 'Полужирный'], MarkdownEditor::BTN_ITALIC => ['icon' => 'italic', 'title' => 'Наклонный'], MarkdownEditor::BTN_PARAGRAPH => ['icon' => 'font', 'title' => 'Параграф'], MarkdownEditor::BTN_NEW_LINE => ['icon' => 'text-height', 'title' => 'Перенос строки'], MarkdownEditor::BTN_HEADING => ['icon' => 'header', 'title' => 'Заголовок', 'items' => [MarkdownEditor::BTN_H1 => ['label' => 'Заголовок 1', 'options' => ['class' => 'kv-heading-1', 'title' => 'Заголовок 1']], MarkdownEditor::BTN_H2 => ['label' => 'Заголовок 2', 'options' => ['class' => 'kv-heading-2', 'title' => 'Заголовок 2']], MarkdownEditor::BTN_H3 => ['label' => 'Заголовок 3', 'options' => ['class' => 'kv-heading-3', 'title' => 'Заголовок 3']], MarkdownEditor::BTN_H4 => ['label' => 'Заголовок 4', 'options' => ['class' => 'kv-heading-4', 'title' => 'Заголовок 4']], MarkdownEditor::BTN_H5 => ['label' => 'Заголовок 5', 'options' => ['class' => 'kv-heading-5', 'title' => 'Заголовок 5']], MarkdownEditor::BTN_H6 => ['label' => 'Заголовок 6', 'options' => ['class' => 'kv-heading-6', 'title' => 'Заголовок 6']]]]]], ['buttons' => [MarkdownEditor::BTN_LINK => ['icon' => 'link', 'title' => 'URL/Ссылка'], MarkdownEditor::BTN_IMAGE => ['icon' => 'picture', 'title' => 'Картинка']]], ['buttons' => [MarkdownEditor::BTN_INDENT_L => ['icon' => 'indent-left', 'title' => 'Увеличить отступ'], MarkdownEditor::BTN_INDENT_R => ['icon' => 'indent-right', 'title' => 'Уменьшить отступ']]], ['buttons' => [MarkdownEditor::BTN_UL => ['icon' => 'list', 'title' => 'Маркированный список'], MarkdownEditor::BTN_OL => ['icon' => 'list-alt', 'title' => 'Нумерованный список'], MarkdownEditor::BTN_DL => ['icon' => 'th-list', 'title' => 'Список определений']]], ['buttons' => [MarkdownEditor::BTN_FOOTNOTE => ['icon' => 'edit', 'title' => 'Сноска'], MarkdownEditor::BTN_QUOTE => ['icon' => 'comment', 'title' => 'Цитата']]], ['buttons' => [MarkdownEditor::BTN_CODE => ['label' => MarkdownEditor::ICON_CODE, 'title' => 'Код в строке', 'encodeLabel' => false], MarkdownEditor::BTN_CODE_BLOCK => ['icon' => 'sound-stereo', 'title' => 'Код']]], ['buttons' => [MarkdownEditor::BTN_HR => ['label' => MarkdownEditor::ICON_HR, 'title' => 'Горизонтальная линия', 'encodeLabel' => false]]], ['buttons' => [MarkdownEditor::BTN_MAXIMIZE => ['icon' => 'fullscreen', 'title' => 'Переключить на полный экран', 'data-enabled' => true]], 'options' => ['class' => 'pull-right']]]]);
 }
Пример #5
0
echo $form->field($comment, 'post_id')->hiddenInput(['value' => $post->id])->label(false);
?>
            <div class="col-md-6">
                <?php 
echo $form->field($comment, 'name', ['inputOptions' => ['placeholder' => 'Name']])->label(false);
?>
            </div>
            <div class="col-md-6">
                <?php 
echo $form->field($comment, 'email', ['inputOptions' => ['placeholder' => 'Email']])->label(false);
?>
            </div>

            <div class="col-md-12">
                <?php 
echo $form->field($comment, 'body', ['inputOptions' => ['placeholder' => 'Comment Body']])->label(false)->widget(MarkdownEditor::className(), []);
?>
                <?php 
echo $form->field($comment, 'captcha')->label(false)->widget('Zelenin\\yii\\widgets\\Recaptcha\\widgets\\Recaptcha', ['clientOptions' => ['data-sitekey' => '6LfU0xMTAAAAAPa-B0U6o-WWwgGhMnyrVr7bPiFm']]);
?>
                <div class="form-group">
                    <?php 
echo Html::submitButton('Submit', ['class' => 'buton b_asset buton-2 buton-mini pull-right', 'name' => 'contact-button']);
?>
                </div>
            </div>
            <?php 
ActiveForm::end();
?>
        </div>
        <div class="clearfix"></div>
Пример #6
0
 public function run()
 {
     echo MarkdownEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'showExport' => $this->showExport, 'toolbar' => ['buttons' => [MarkdownEditor::BTN_BOLD => ['icon' => 'bold', 'title' => 'Полужирный'], MarkdownEditor::BTN_ITALIC => ['icon' => 'italic', 'title' => 'Наклонный'], MarkdownEditor::BTN_PARAGRAPH => ['icon' => 'font', 'title' => 'Параграф'], MarkdownEditor::BTN_HEADING => ['icon' => 'header', 'title' => 'Заголовок', 'items' => [MarkdownEditor::BTN_H3 => ['label' => 'Заголовок 3', 'options' => ['class' => 'kv-heading-3', 'title' => 'Заголовок 3']], MarkdownEditor::BTN_H4 => ['label' => 'Заголовок 4', 'options' => ['class' => 'kv-heading-4', 'title' => 'Заголовок 4']], MarkdownEditor::BTN_H5 => ['label' => 'Заголовок 5', 'options' => ['class' => 'kv-heading-5', 'title' => 'Заголовок 5']], MarkdownEditor::BTN_H6 => ['label' => 'Заголовок 6', 'options' => ['class' => 'kv-heading-6', 'title' => 'Заголовок 6']]]]]], ['buttons' => [MarkdownEditor::BTN_UL => ['icon' => 'list', 'title' => 'Маркированный список']]], ['buttons' => [MarkdownEditor::BTN_MAXIMIZE => ['icon' => 'fullscreen', 'title' => 'Переключить на полный экран', 'data-enabled' => true]], 'options' => ['class' => 'pull-right']]]);
 }
Пример #7
0
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 
}
Пример #8
0
					  <div class="alert alert-warning" role="alert" style="margin-top: 15px"><?php echo Yii::t('app', 'No more comments.');?></div>
					<?php endif ?>

				</div>





			</div>
			<div class="tab-pane" id="qa">
				<div class="qa-input" style="margin-top:20px">
					<?php
						echo MarkdownEditor::widget([
						    'name' => 'markdown', 
						    'options' => ['placeholder' => '求大神!'],
						    'height' => 150,
						]);
					?>
				</div>

				<div class="qa-detail">
					<?php foreach (Question::getQuestionList($course->id) as $question): ?>
						<div class="media col-lg-12">
						  <div class="media-left media-middle col-lg-2">
						    <a href="#">
						      <img class="media-object img-circle" style="margin: 6% 0 0 0 " src="<?php echo User::findModel($question->user_id)->head_picture?>" alt="" width="60px">
						    </a>
						    <span class="qa-name" style="text-align: center"><?php echo User::findModel($question->user_id)->username?></span>
						  </div>
						  <div class="media-body">
Пример #9
0
    </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 
Пример #10
0
<h3>
    添加新文章
    <div class="pull-right">
        <?php 
echo Html::a('返回文章列表', ['index'], ['class' => 'btn btn-sm btn-default']);
?>
    </div>
</h3>
<?php 
$form = ActiveForm::begin(['enableClientValidation' => false]);
$categories = Category::getCategories();
$items = ArrayHelper::map($categories, 'id', 'name');
$tab1 = $form->field($model, 'category_id')->dropDownList($items);
$tab1 .= $form->field($model, 'title')->textInput();
$slug = Html::tag('span', rtrim(Yii::$app->request->getHostInfo(), '/') . '/', ['class' => 'input-group-addon']);
$slugTemplate = "{label}\n<div class=\"input-group\">{$slug}{input}</div>\n{hint}\n{error}";
$tab1 .= $form->field($model, 'slug', ['template' => $slugTemplate])->textInput();
$tab1 .= MarkdownEditor::widget(['model' => $model, 'attribute' => 'content']);
$tab2 = $form->field($model, 'meta_title')->textInput();
$tab2 .= $form->field($model, 'meta_description')->textInput();
$tab2 .= $form->field($model, 'meta_keywords')->textInput();
echo Tabs::widget(['items' => [['label' => '主要内容', 'options' => ['style' => 'padding:1em;'], 'content' => $tab1, 'active' => true], ['label' => 'SEO', 'content' => $tab2, 'options' => ['style' => 'padding:1em;']]]]);
echo Html::a('清 空', ['create'], ['class' => 'btn btn-default']);
?>

<?php 
echo Html::submitButton('提 交', ['class' => 'btn btn-success']);
?>

<?php 
ActiveForm::end();