Blame view

backend/views/objectkb/_form_language.php 3.99 KB
9f55ae51   Timur Kastemirov   big shot
1
  <?php
2054adde   Timur Kastemirov   objectsKb tinyMce...
2
      
9f55ae51   Timur Kastemirov   big shot
3
4
5
6
      use artbox\core\models\Language;
      use dosamigos\tinymce\TinyMce;
      use yii\web\View;
      use yii\widgets\ActiveForm;
35f6909f   Timur Kastemirov   big shot #2 наши ...
7
      use artbox\core\helpers\SlugifyDecorator;
2054adde   Timur Kastemirov   objectsKb tinyMce...
8
9
      use yii\helpers\Url;
      use yii\web\JsExpression;
9f55ae51   Timur Kastemirov   big shot
10
11
12
13
14
15
16
      
      /**
       * @var \artbox\core\models\SlideLang $model_lang
       * @var Language                      $language
       * @var ActiveForm                    $form
       * @var View                          $this
       */
9f55ae51   Timur Kastemirov   big shot
17
      
35f6909f   Timur Kastemirov   big shot #2 наши ...
18
      $attributeField = $form->field($model_lang, '[' . $language->id . ']object_name')
9f55ae51   Timur Kastemirov   big shot
19
20
                ->textInput([ 'maxlength' => true ]);
      
35f6909f   Timur Kastemirov   big shot #2 наши ...
21
      echo $attributeField;
9f55ae51   Timur Kastemirov   big shot
22
      
35f6909f   Timur Kastemirov   big shot #2 наши ...
23
24
25
26
27
28
29
30
      echo SlugifyDecorator::decorate(
          $form->field($model_lang, '[' . $language->id . ']aliasValue'),
          [ '/alias/slugify' ],
          $attributeField,
          false,
          $language->id
      )
                           ->textInput([ 'maxlength' => true ]);
9f55ae51   Timur Kastemirov   big shot
31
      
9f55ae51   Timur Kastemirov   big shot
32
      
35f6909f   Timur Kastemirov   big shot #2 наши ...
33
      echo $form->field($model_lang, '[' . $language->id . ']upper_text')
2054adde   Timur Kastemirov   objectsKb tinyMce...
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                ->widget(
                    TinyMce::className(),
                    [
                        'options'       => [ 'rows' => 30 ],
                        '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",
                            ],
8cd480b2   Timur Kastemirov   tiny mce fontsize...
56
                            'toolbar'               => "undo redo | styleselect | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
2054adde   Timur Kastemirov   objectsKb tinyMce...
57
58
59
60
                            'image_advtab'          => true,
                        ],
                    ]
                );
9f55ae51   Timur Kastemirov   big shot
61
      
35f6909f   Timur Kastemirov   big shot #2 наши ...
62
      echo $form->field($model_lang, '[' . $language->id . ']about_object_text')
2054adde   Timur Kastemirov   objectsKb tinyMce...
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
                ->widget(
                    TinyMce::className(),
                    [
                        'options'       => [ 'rows' => 30 ],
                        '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",
                            'image_advtab'          => true,
                        ],
                    ]
                );
9f55ae51   Timur Kastemirov   big shot
90
  ?>