<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
use home\models\Message;
use common\widgets\Editor;

$attrLabels = $model->attributeLabels();

$form = ActiveForm::begin([
			'id' => 'main-form',
			'options' => ['class' => 'informationform f14'],
			'action' => $action,
			'fieldConfig' => [
				'options' => ['tag' => 'td'],
				'template' => "{input}{hint}{error}",
				'errorOptions' => ["class" => "error"]
			]
]);
?>

<table cellpadding="0" cellspacing="10" width="100%">
	<tbody>

		<tr>
			<td align="right" width="80"><?= $model->getAttributeLabel('title') ?>：</td>
			<?= $form->field($model, 'title')->textInput(['class' => 'form-control']) ?>
			<td><span class="redstar">*</span></td>
		</tr>

        <tr>
			<td align="right" width="80"><?= $model->getAttributeLabel('get_user_names') ?>：</td>
                <?= $form->field($model, 'get_user_names')->textInput(['class' => 'form-control select-multi-user', 'placeholder' => '点击选择', 'data-hidden-id' => 'user-ids', 'data-url' => Url::to(['/link/multi-user']), 'data-title' => '选择收件人']) ?>
                <?= $form->field($model, 'get_user_ids', ['options' => ['tag'=>'div']])->hiddenInput(['id' => 'user-ids']) ?>
			<td><span class="redstar">*</span></td>
		</tr>

        <?php if ($model->type == 1) : ?>
        <tr>
			<td align="right"><?= $model->getAttributeLabel('is_reply') ?>：</td>
			<?= $form->field($model, 'is_reply')->radioList(Message::getStatusList(), ['itemOptions' => ['labelOptions' => ['class' => 'radio-inline']]]) ?>
			<td></td>
		</tr>
        <?php else : ?>
            <?= Html::hiddenInput('Message[is_reply]' ,0); ?>
        <?php endif; ?>
		
		<tr>
			<td align="right">内容：</td>
            <?= Editor::widget(['model' => $model, 'form' => $form, 'attribute' => 'content','fieldConfig' => ['options' => ['colspan' => '4']], 'inputConfig' => ['class' => ''], 'width' => '100%', 'height' => 250,'editorType' => 'simple']) ?>
			<td><span class="redstar"></span></td> 
		</tr>

	</tbody>
</table>
<?= Html::hiddenInput('Message[type]' ,$model->type); ?>

<?php ActiveForm::end(); ?>