_form_language.php 1.74 KB
<?php

use artbox\core\models\Language;
use common\models\ProductLang;
use dosamigos\tinymce\TinyMce;
use yii\helpers\Url;
use yii\web\JsExpression;
use yii\web\View;
use yii\widgets\ActiveForm;

/**
 * @var ProductLang $model_lang
 * @var Language $language
 * @var ActiveForm $form
 * @var View $this
 */

$attributeField = $form->field($model_lang, '[' . $language->id . ']title')
    ->textInput(['maxlength' => true]);

echo $attributeField;


echo $form->field($model_lang, '[' . $language->id . ']description')
    ->widget(
        TinyMce::className(),
        [
            'options'       => [ 'rows' => 20 ],
            '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 | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",
                'image_advtab'          => true,
            ],
        ]
    );


?>