Blame view

common/modules/comment/views/artbox_comment_reply.php 1.84 KB
c05bf005   Yarik   Comment added
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  <?php
      use common\modules\comment\models\CommentModel;
      use yii\base\Model;
      use yii\helpers\Html;
      use yii\helpers\Url;
      use yii\web\View;
      use yii\widgets\ActiveForm;
      
      /**
       * @var CommentModel $comment_model
       * @var array        $form_params
       * @var Model        $model
       * @var string       $formId
       * @var View         $this
       */
      $text_input_id = Html::getInputId($comment_model, 'text') . '-reply';
      $artbox_comment_pid_input_id = Html::getInputId($comment_model, 'artbox_comment_pid') . '-reply';
      $text_input_selectors = [
          'container' => '.field-' . $text_input_id,
          'input'     => '#' . $text_input_id,
      ];
      $artbox_comment_pid_input_selectors = [
          'container' => '.field-' . $artbox_comment_pid_input_id,
          'input'     => '#' . $artbox_comment_pid_input_id,
      ];
      $form = ActiveForm::begin([
          'id'     => $formId . '-reply',
          'action' => Url::to([
              'artbox-comment/default/create',
              'entity' => $comment_model->encryptedEntity,
          ]),
      ]);
      echo $form->field($comment_model, 'artbox_comment_pid', [
          'selectors'    => $artbox_comment_pid_input_selectors,
          'inputOptions' => [
              'id'    => $artbox_comment_pid_input_id,
              'class' => 'form-control',
          ],
      ])
                ->hiddenInput()
                ->label(false);
      echo $form->field($comment_model, 'text', [
          'selectors'    => $text_input_selectors,
          'inputOptions' => [
              'id'    => $text_input_id,
              'class' => 'form-control',
          ],
      ])
                ->textarea();
      echo Html::submitButton(/*Yii::t('artbox-comment', 'Submit')*/
          'Submit');
      echo Html::button(/*Yii::t('artbox-comment', 'Cancel')*/
          'Cancel', [ 'data-action' => 'reply-cancel' ]);
      ActiveForm::end();