示例#1
0
</a></li>
            <li><a href="#meta-options" data-toggle="tab"><?php 
echo Yii::t('gromver.platform', 'Metadata');
?>
</a></li>
        </ul>
        <br/>
        <div class="tab-content">
            <div id="main-options" class="tab-pane active">
                <div class="form-group container">
                    <?php 
echo Html::activeLabel($model, 'detail_text');
?>
                    <div>
                        <?php 
echo \mihaildev\ckeditor\CKEditor::widget(['model' => $model, 'attribute' => 'detail_text', 'editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions('grom/media/manager', ['extraPlugins' => 'codesnippet'])]);
?>
                    </div>
                </div>
                <?php 
echo $form->field($model, 'language')->dropDownList(Yii::$app->getLanguagesList(), ['prompt' => Yii::t('gromver.platform', 'Select ...'), 'id' => 'language']);
?>

                <?php 
echo $form->field($model, 'category_id')->widget(\kartik\widgets\DepDrop::className(), ['pluginOptions' => ['depends' => ['language'], 'placeholder' => Yii::t('gromver.platform', 'Select ...'), 'url' => \yii\helpers\Url::to(['categories', 'selected' => $model->category_id])]]);
?>

                <?php 
echo $form->field($model, 'status')->dropDownList(['' => Yii::t('gromver.platform', 'Select ...')] + $model->statusLabels());
?>
示例#2
0
 protected function launch()
 {
     switch ($this->editor) {
         case self::EDITOR_CKEDITOR_BASIC:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'basic', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_CKEDITOR_STANDARD:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'standard', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_CKEDITOR_FULL:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('media/manager', array_merge($this->ckEditorOptions, ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'preset' => 'full', 'tabSpaces' => 4, 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]))]);
             break;
         case self::EDITOR_IMPERAVI:
             echo Imperavi::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'settings' => $this->imperaviOptions]);
             break;
         default:
             echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     }
 }
 protected function launch()
 {
     switch ($this->editor) {
         case self::EDITOR_CKEDITOR_BASIC:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'basic', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_CKEDITOR_STANDARD:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'standard', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_CKEDITOR_FULL:
             echo CKEditor::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => ['class' => 'form-control', 'rows' => 10], 'editorOptions' => ElFinder::ckeditorOptions('grom/media/manager', ['filebrowserBrowseUrl' => ['/grom/menu/backend/item/ckeditor-select'], 'extraPlugins' => 'codesnippet', 'preset' => 'full', 'tabSpaces' => 4])]);
             break;
         case self::EDITOR_IMPERAVI:
             echo Widget::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value]);
             break;
         default:
             echo $this->hasModel() ? Html::activeTextarea($this->model, $this->attribute, $this->options) : Html::textarea($this->name, $this->value, $this->options);
     }
 }
示例#4
0
    ?>
 
    <p class="hint-<?php 
    echo $input_id;
    ?>
 uk-hidden">
        <?php 
    echo $element->adminHint;
    ?>
    </p>    
<?php 
} else {
    ?>
    <?php 
    echo Html::activeLabel($model, $attribute, ['class' => 'uk-form-label']);
    ?>
 
<?php 
}
?>

<div class="uk-from-controls">
    
    <?php 
echo \mihaildev\ckeditor\CKEditor::widget(['model' => $model, 'attribute' => $attribute, 'editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions(['elfinder', 'path' => '/'], ['preset' => 'standart', 'allowedContent' => true, 'height' => '200px', 'toolbar' => Yii::$app->zoo->cke_editor_toolbar, 'contentsCss' => Yii::$app->zoo->cke_editor_css])]);
?>

    <div class="uk-form-help-block uk-text-danger"></div>

</div>
示例#5
0
<?php

use yii\helpers\Html;
use worstinme\uikit\ActiveForm;
$form = ActiveForm::begin(['layout' => 'horizontal', 'field_width' => 'full']);
?>

<?php 
echo \mihaildev\ckeditor\CKEditor::widget(['model' => $model, 'attribute' => 'content', 'editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions(['elfinder', 'path' => '/'], ['preset' => 'standart', 'allowedContent' => true, 'height' => '400px', 'toolbar' => [['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', 'Styles', 'Font', 'FontSize', 'Format', 'TextColor', 'BGColor', '-', 'Blockquote', 'CreateDiv', '-', 'Image', 'Table', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Outdent', 'Indent', '-', 'RemoveFormat', 'Source', 'Maximize']]])]);
?>

<?php 
ActiveForm::end();
示例#6
0
    $models = $group->getSettings()->orderBy('position')->All();
    foreach ($models as $model) {
        ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php 
        echo $model->label;
        ?>
</label>
                            <div class="col-sm-10">
                                <?php 
        if ($model->type == 0) {
            echo Html::textInput('Settings[' . $model->id . ']', $model->value, ['class' => 'form-control', 'placeholder' => $model->default]);
        } elseif ($model->type == 1) {
            echo Html::textarea('Settings[' . $model->id . ']', $model->value, ['class' => 'form-control', 'rows' => 3]);
        } elseif ($model->type == 2) {
            echo CKEditor::widget(['id' => 'Settings' . $model->id, 'name' => 'Settings[' . $model->id . ']', 'value' => $model->value, 'editorOptions' => ElFinder::ckeditorOptions('elfinder', ['language' => 'ru'])]);
        } elseif ($model->type == 3) {
            echo SwitchInput::widget(['name' => 'Settings[' . $model->id . ']', 'value' => (int) $model->value, 'pluginOptions' => ['onColor' => 'success', 'offColor' => 'danger']]);
        } elseif ($model->type == 4) {
            $pluginOptions = ['showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false, 'overwriteInitial' => true];
            if (!empty($model->value)) {
                $pluginOptions['initialPreview'] = [Html::img("/files/settings/" . $model->value, ['class' => 'file-preview-image'])];
            }
            echo FileInput::widget(['name' => 'Settings[' . $model->id . ']', 'language' => 'ru', 'pluginOptions' => $pluginOptions]);
        } elseif ($model->type == 5) {
            echo ColorInput::widget(['name' => 'Settings[' . $model->id . ']', 'value' => $model->value, 'options' => ['readonly' => true]]);
        } else {
            echo '<strong class="form-control">Не известный тип поля</strong>';
        }
        ?>
                                <span style="font-size: 12px;"><?php