ckeditorOptions() публичный статический Метод

public static ckeditorOptions ( $controller, $options = [] )
Пример #1
0
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  */
 public function run()
 {
     $ckeditorOptions = [];
     if ($this->removeFirstTag) {
         $ckeditorOptions['enterMode'] = new JsExpression('CKEDITOR.ENTER_BR');
     }
     $ckeditorOptions = ArrayHelper::merge($ckeditorOptions, $this->clientOptions);
     $options = ArrayHelper::merge(['initOnEvent' => 'focus', 'options' => ['class' => 'form-control form-redactor']], $this->options);
     $options['editorOptions'] = ElFinder::ckeditorOptions(Adm::getInstance()->id . '/elfinder', $ckeditorOptions);
     return $this->form->field($this->model, $this->attribute)->widget(CKEditor::className(), $options);
 }
Пример #2
0
                <a data-toggle='modal' data-target='#myModal' href='#'>Обзор</a> |
                <a class = 'del_img_pages' href = '#'>Удалить</a>
            </div>
            <?php 
echo $form->field($model, 'images')->textInput(['maxlength' => true])->hiddenInput()->label(false);
?>
            <div class="cleared"></div>
            <br>
            <?/*= $form->field($model, 'count_product')->textInput() */?><!--
            --><?/*= $form->field($model, 'hint')->textInput(['maxlength' => true]) */?>
            <?php 
echo $form->field($model, 'fix_menu')->dropDownList(['0' => 'Не прикреплять', '1' => 'Меню 1-го уровня', '2' => 'Меню 2-го уровня']);
?>

            <?php 
echo $form->field($model, 'description')->widget(CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions('elfinder', ['preset' => 'standard', 'inline' => false])]);
?>
        </div>
        <div id="panel2" class="tab-pane fade <?php 
echo $tabContent2;
?>
">
            <h3>Вид</h3>
            <?php 
echo $form->field($model, 'blokc_id')->dropDownList($block);
?>
            <?php 
echo Html::button('Добавить блок', ['class' => 'btn btn-success', 'id' => 'addCustBlock']);
?>
            <br>
            <hr>
Пример #3
0
?>

    <?php 
echo $form->errorSummary($model);
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'short_text')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder-backend', ['preset' => 'basic'])]);
?>

    <?php 
echo $form->field($model, 'text')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder-backend')]);
?>

    <?php 
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(Post::getStatuses());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('blog', 'Create') : Yii::t('blog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Пример #4
0
 public function init()
 {
     $this->editorOptions = \mihaildev\elfinder\ElFinder::ckeditorOptions('/admin/file-manager-elfinder', ['preset' => 'full', 'extraPlugins' => 'sourcedialog', 'allowedContent' => true, 'inline' => true, 'height' => 'auto']);
     parent::init();
 }
Пример #5
0
 /**
  * @param \Yii\widgets\ActiveForm $form
  * @param array $options
  * @return \Yii\widgets\ActiveField|static
  */
 public function field($form, $options = [])
 {
     $options = array_merge(['labelOptions' => ['class' => 'col-sm-12'], 'wrapperOptions' => ['class' => 'col-sm-12']], $options);
     return parent::field($form, $options)->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions($this->controller, $this->editorOptions)]);
 }
Пример #6
0
    	<div class="col-lg-4"><?php 
echo $form->field($model, 'published')->dropDownList($model->publishedList, [$model->published]);
?>
</div>
    	<div class="col-lg-4"><?php 
echo $form->field($model, 'created_by')->dropDownList($model->authorsList, [$model->created_by]);
?>
</div>
    </div>

    <?php 
echo $form->field($model, 'intro')->textarea(['rows' => 6]);
?>
    
	<?php 
echo $form->field($model, 'text')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder', ['preset' => 'full', 'inline' => false])]);
?>

    
    <?php 
if ($model->image != '') {
    ?>
    <div class="row form-group">
    	<div class="col-lg-4">
    		<img src="<?php 
    echo $model->imageUrl;
    ?>
" alt="" class="img-responsive img-thumbnail" />
    		<br>
    		<?php 
    echo $form->field($model, 'image')->textInput()->label(false);
Пример #7
0
/* @var $this yii\web\View */
/* @var $model app\modules\appointment\models\Locality */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="locality-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'contact')->widget(\mihaildev\ckeditor\CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions('elfinder')]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-success']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Пример #8
0
    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'topic_image')->widget(CKEditor::className(), ['editorOptions' => ['filebrowserBrowseUrl' => '/images/content/', 'preset' => 'basic', 'inline' => false], 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [])]);
?>
 

    <?php 
echo $form->field($model, 'title_content')->widget(CKEditor::className(), ['editorOptions' => ['filebrowserBrowseUrl' => '/images/content/', 'preset' => 'full', 'inline' => false], 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [])]);
?>
 

    <?php 
echo $form->field($model, 'data')->widget(CKEditor::className(), ['editorOptions' => ['filebrowserBrowseUrl' => '/images/content/', 'preset' => 'full', 'inline' => false], 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [])]);
?>
 
    
    <?php 
echo $form->field($model, 'category_id')->dropDownList([1 => 'Games', 2 => 'Movies', 3 => 'Music']);
?>

    <?php 
echo $form->field($model, 'PUBLISHED')->dropDownList([1 => 'Publish', 0 => 'No Publish']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
Пример #9
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>
Пример #10
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();
Пример #11
0
    <?php 
echo $form->field($model, 'image')->fileInput();
?>


    <?php 
echo $form->field($model, 'category_id')->textInput();
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>


    <?php 
echo $form->field($model, 'description')->widget(CKEditor::className(), ['options' => ['rows' => 6], 'preset' => 'full', 'clientOptions' => ElFinder::ckeditorOptions('elfinder')]);
?>

    <?php 
echo $form->field($model, 'created_at')->textInput();
?>

    <?php 
echo $form->field($model, 'updated_at')->textInput();
?>

    <?php 
echo $form->field($model, 'status')->textInput();
?>

    <?php 
Пример #12
0
                <?php 
echo $form->field($model, 'intro_text')->textarea(['rows' => 6]);
?>
        

                <div class="row">

                    <div class="col-lg-12 col-md-12 col-sm-12">
                        <?php 
echo $form->field($model, 'full_image')->widget(NewWidget::className(), ['uploadUrl' => Url::toRoute(['/blog/posts/uploadphoto']), 'previewUrl' => $model->module->ImagePathPreview, 'tempPreviewUrl' => $model->module->ImageTempPathPreview, 'KeyFolder' => $model->id, 'width' => 200, 'height' => 200]);
?>
                    </div>

                </div>
                <?php 
echo $form->field($model, 'full_text')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('blog/elfinder', [])]);
?>


                <?php 
//                echo
//                $form->field($model, 'full_text')->widget(\vova07\imperavi\Widget::className(), [
//
//                    'settings' => [
//                        //  'lang' => 'en',
//                        'minHeight' => 200,
//                        //    'pastePlainText' => true,
//                        //  'pasteImages' => true,
//                        'plugins' => [
//                            'clips',
//                            'fullscreen'
Пример #13
0
Файл: _form.php Проект: apuc/api
?>

<div class="news-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'short_text')->widget(CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions('elfinder', ['preset' => 'basic', 'inline' => false, 'path' => 'frontend/web/image/upload'])]);
?>
    <?php 
echo $form->field($model, 'content')->widget(CKEditor::className(), ['editorOptions' => \mihaildev\elfinder\ElFinder::ckeditorOptions('elfinder', ['preset' => 'standard', 'inline' => false, 'path' => 'frontend/web/image/upload'])]);
?>

    <?php 
echo $form->field($model, 'tags')->textInput(['maxlength' => true]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Сохранить' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
Пример #14
0
 public function init()
 {
     $this->clientOptions = \mihaildev\elfinder\ElFinder::ckeditorOptions('elfinder', []);
     parent::init();
 }
Пример #15
0
 public function init()
 {
     parent::init();
     $bundle = \yii\bootstrap\BootstrapAsset::register(\Yii::$app->view);
     $this->editorOptions = \mihaildev\elfinder\ElFinder::ckeditorOptions('/admin/file-manager-elfinder', ['preset' => 'full', 'extraPlugins' => 'codemirror', 'entities' => false, 'allowedContent' => true, 'baseHref' => \Yii::$app->homeUrl, 'contentsCss' => [$bundle->baseUrl . '/css/bootstrap.css', '/main.css']]);
 }
Пример #16
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('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);
     }
 }
Пример #17
0
<?php

use mihaildev\ckeditor\CKEditor;
use mihaildev\elfinder\ElFinder;
use yii\web\View;
/**
 * @var $form \yii\widgets\ActiveForm
 * @var $block \nullref\cms\blocks\html\Block
 * @var $this \yii\web\View
 */
list(, $footnotesUrl) = Yii::$app->assetManager->publish('@nullref/cms/assets/ckeditor-plugins/codemirror');
$this->registerJs("CKEDITOR.plugins.addExternal( 'codemirror', '" . $footnotesUrl . "/','plugin.js');\nObject.keys(CKEDITOR.dtd.\$removeEmpty).forEach(function(key){CKEDITOR.dtd.\$removeEmpty[key] = 0;});\n", View::POS_END);
$editorConfig = ['id' => 'editor', 'editorOptions' => ['preset' => 'full', 'inline' => false, 'extraPlugins' => 'codemirror', 'allowedContent' => true, 'basicEntities' => false, 'entities' => false, 'entities_greek' => false, 'entities_latin' => false, 'htmlEncodeOutput' => false, 'entities_processNumerical' => false, 'fillEmptyBlocks' => false, 'fullPage' => false, 'codemirror' => ['autoCloseBrackets' => true, 'autoCloseTags' => true, 'autoFormatOnStart' => true, 'autoFormatOnUncomment' => true, 'continueComments' => true, 'enableCodeFolding' => true, 'enableCodeFormatting' => true, 'enableSearchTools' => true, 'highlightMatches' => true, 'indentWithTabs' => false, 'lineNumbers' => true, 'lineWrapping' => true, 'mode' => 'htmlmixed', 'matchBrackets' => true, 'matchTags' => true, 'showAutoCompleteButton' => true, 'showCommentButton' => true, 'showFormatButton' => true, 'showSearchButton' => true, 'showTrailingSpace' => true, 'showUncommentButton' => true, 'styleActiveLine' => true, 'theme' => 'default', 'useBeautify' => true]]];
$editorConfig['editorOptions'] = ElFinder::ckeditorOptions('elfinder-backend', $editorConfig['editorOptions']);
echo $form->field($block, 'content')->widget(CKEditor::className(), $editorConfig);
echo $form->field($block, 'tag')->textInput();
echo $form->field($block, 'tagClass')->textInput();
Пример #18
0
?>

            <?php 
echo $form->field($model, 'type')->dropDownList($pageTypesMap);
?>
        </div>

        <div id="editor-wrapper" class="col-md-9">

            <div class="row" data-type="<?php 
echo Page::TYPE_CONTENT;
?>
" style="display: none">
                <div class="col-md-12">
                    <?php 
echo $form->field($model, 'content')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder-backend', ['height' => 300])]);
?>
                </div>
            </div>

            <div class="row" data-type="<?php 
echo Page::TYPE_BLOCKS;
?>
" style="display: none">
                <?php 
echo $this->render('_blocks', ['model' => $model]);
?>
            </div>

        </div>
Пример #19
0
        <?php 
echo $form->field($model, 'state')->checkbox();
?>

        <hr>

        <?php 
echo $form->field($model, 'intro')->widget(\mihaildev\ckeditor\CKEditor::className(), ['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])]);
?>

        <?php 
echo $form->field($model, 'content')->widget(\mihaildev\ckeditor\CKEditor::className(), ['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])]);
?>

        <?php 
echo $form->field($model, 'quote')->widget(\mihaildev\ckeditor\CKEditor::className(), ['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])]);
?>

        <hr>

        <?php 
echo $form->field($model, 'metaTitle')->textInput(['maxlength' => true, 'class' => 'uk-width-1-1']);
?>

        <?php 
echo $form->field($model, 'metaDescription')->textarea(['rows' => 2, 'class' => 'uk-width-1-1']);
?>

        <?php 
echo $form->field($model, 'metaKeywords')->textInput(['maxlength' => true, 'class' => 'uk-width-1-1']);
?>
Пример #20
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);
     }
 }
Пример #21
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());
?>
Пример #22
0
// $form->field($model, 'informasi')->widget(TinyMce::className(), [
//     'options' => ['rows' => 15],
//     'clientOptions' => [
//      'content_style'=>'p {font-size:15px;}',
//         'plugins' => [
//             "advlist autolink lists link charmap print preview anchor",
//             "searchreplace visualblocks code fullscreen",
//             "insertdatetime media table contextmenu paste"
//         ],
//         'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
//     ]
// ]);
?>
 
<?php 
echo $form->field($model, 'informasi')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions(['elfinder', 'path' => 'some/sub/path'], ['preset' => Yii::$app->devicedetect->isMobile() ? 'basic' : 'full', 'skin' => 'office2013'])]);
?>



  <?php 
echo $form->field($model, 'status')->dropDownList(DataKerja::status(), ['maxlength' => true]);
?>

    <?php 
//= $form->field($model, 'created_at')->textInput()
?>

    <?php 
//= $form->field($model, 'modified_at')->textInput()
?>
Пример #23
0
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <?php 
echo $form->field($model, 'annotation')->textarea(['rows' => 2]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <?php 
echo $form->field($model, 'content')->widget(CKEditor::className(), ['editorOptions' => ElFinder::ckeditorOptions('elfinder', [])]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'image')->widget(InputFile::className(), ['controller' => 'elfinder', 'filter' => 'image', 'template' => '<div class="input-group">
                                                {input}<span class="input-group-btn">{button}</span>
                                            </div>', 'options' => ['class' => 'form-control'], 'buttonName' => Yii::t('document', 'Выбрать файл'), 'buttonOptions' => ['class' => 'btn btn-default'], 'multiple' => false]);
?>
        </div>
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'position')->textInput(['maxlength' => true]);
Пример #24
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