Blame view

views/blog-article/_form_language.php 2.31 KB
593851ec   Alexey Boroda   First commit
1
  <?php
ba196ec2   Alexey Boroda   -Blog in process
2
3
4
5
6
7
      use artbox\core\helpers\SlugifyDecorator;
      use artbox\weblog\models\ArticleLang;
      use artbox\core\models\Language;
      use dosamigos\tinymce\TinyMce;
      use yii\helpers\Url;
      use yii\web\JsExpression;
593851ec   Alexey Boroda   First commit
8
9
10
11
      use yii\web\View;
      use yii\widgets\ActiveForm;
      
      /**
ba196ec2   Alexey Boroda   -Blog in process
12
13
14
15
       * @var ArticleLang $model_lang
       * @var Language    $language
       * @var ActiveForm  $form
       * @var View        $this
593851ec   Alexey Boroda   First commit
16
17
       */
  ?>
ba196ec2   Alexey Boroda   -Blog in process
18
19
20
21
22
  <?php
      $attributeField = $form->field($model_lang, '[' . $language->id . ']title')
                             ->textInput([ 'maxlength' => true ]);
      echo $attributeField;
  ?>
593851ec   Alexey Boroda   First commit
23
  
ba196ec2   Alexey Boroda   -Blog in process
24
25
26
27
28
29
  <?= SlugifyDecorator::decorate(
      $form->field($model_lang, '[' . $language->id . ']aliasValue'),
      [ '/alias/slugify' ],
      $attributeField
  )
                      ->textInput([ 'maxlength' => true ]); ?>
593851ec   Alexey Boroda   First commit
30
31
32
  
  <?= $form->field($model_lang, '[' . $language->id . ']body')
           ->widget(
ba196ec2   Alexey Boroda   -Blog in process
33
               TinyMce::className(),
593851ec   Alexey Boroda   First commit
34
               [
ba196ec2   Alexey Boroda   -Blog in process
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                   'options'       => [ 'rows' => 6 ],
                   'language'      => 'ru',
                   'clientOptions' => [
                       'file_browser_callback' => new JsExpression(
                           "function(field_name, url, type, win) {
  window.open('" . Url::to(
                               [
                                   'imagemanager/manager',
                                   'view-mode'   => 'iframe',
                                   'select-type' => 'tinymce',
                               ]
                           ) . "&tag_name='+field_name,'','width=800,height=540 ,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
  }"
                       ),
                       'plugins'               => [
                           "advlist autolink lists link charmap print preview anchor",
                           "searchreplace visualblocks code fullscreen",
                           "insertdatetime media table contextmenu paste image",
                       ],
                       'toolbar'               => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
                   ],
593851ec   Alexey Boroda   First commit
56
               ]
ba196ec2   Alexey Boroda   -Blog in process
57
           ); ?>
593851ec   Alexey Boroda   First commit
58
59
60
61
62
63
64
  
  <?= $form->field($model_lang, '[' . $language->id . ']body_preview')
           ->textarea(
               [
                   'rows' => '10',
               ]
           ) ?>