Esempio n. 1
0
 private function getHTMLEditor($translation, $index, $language)
 {
     $toolbar = [['style', ['bold', 'italic', 'underline', 'clear']], ['font', ['strikethrough', 'superscript', 'subscript']], ['para', ['ul', 'ol', 'paragraph']], ['misc', ['codeview']]];
     $toolbar = $this->allowHTMLEditorToUploadImages ? array_merge($toolbar, [['insert', ['picture']]]) : $toolbar;
     $callbackOnImageUpload = "function(files) {\n          var editorHTML = \$(this);\n          var data = new FormData();\n          data.append('fileUploaded', files[0]);\n          \$.ajax({\n            url: '{$this->uploadImageUrl}',\n            method: 'POST',\n            data: data,\n            processData: false,\n            contentType: false,\n            success: function(data) {\n                var imgURL = data.url;\n                editorHTML.summernote('insertImage', imgURL);\n            }\n          });\n        }";
     $htmlEditor = $this->form->field($translation, "[{$index}]{$this->fieldName}")->widget(Summernote::className(), ['clientOptions' => ['toolbar' => $toolbar, 'onImageUpload' => new JsExpression($callbackOnImageUpload)], 'options' => ['class' => 'translation-summernote form-control']])->label(false);
     return $htmlEditor;
 }
Esempio n. 2
0
?>
</p></div>
                <div class="col-sm-8">
                    <?php 
echo $form->field($model, 'topic')->textInput(['placeholder' => Yii::t('podium/view', 'Message Topic')])->label(false);
?>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-3 text-right"><p class="form-control-static"><?php 
echo Yii::t('podium/view', 'Message Content');
?>
</p></div>
                <div class="col-sm-8">
                    <?php 
echo $form->field($model, 'content')->label(false)->widget(Summernote::className(), ['clientOptions' => ['height' => '100', 'lang' => Yii::$app->language != 'en-US' ? Yii::$app->language : null, 'codemirror' => null, 'toolbar' => Helper::summerNoteToolbars('full')]]);
?>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-8 col-sm-offset-3">
                    <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-ok-sign"></span> ' . Yii::t('podium/view', 'Send Message'), ['class' => 'btn btn-block btn-primary', 'name' => 'send-button']);
?>
                </div>
            </div>
        <?php 
ActiveForm::end();
?>
        <br>
        <div <?php 
Esempio n. 3
0
        <div class="panel panel-default">
            <?php 
$form = ActiveForm::begin(['id' => 'forum-form', 'options' => ['enctype' => 'multipart/form-data']]);
?>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-sm-12">
                            <?php 
echo $form->field($model, 'location')->textInput(['autocomplete' => 'off'])->label(Yii::t('podium/view', 'Location'));
?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <?php 
echo $form->field($model, 'signature')->label(Yii::t('podium/view', 'Signature under each post'))->widget(Summernote::className(), ['clientOptions' => ['height' => '100', 'lang' => Yii::$app->language != 'en-US' ? Yii::$app->language : null, 'codemirror' => null, 'toolbar' => Helper::summerNoteToolbars()]]);
?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <a href="http://gravatar.com" target="_blank" class="pull-right"><?php 
echo Yii::t('podium/view', 'What is Gravatar?');
?>
</a>
                            <?php 
echo $form->field($model, 'gravatar')->checkbox()->label('<strong>' . Yii::t('podium/view', 'Use Gravatar image as avatar') . '</strong>');
?>
                        </div>
                    </div>
                    <div class="row">
Esempio n. 4
0
            <?php 
$form = ActiveForm::begin(['id' => 'Author', 'layout' => 'horizontal', 'enableClientValidation' => true, 'errorSummaryCssClass' => 'error-summary alert alert-error']);
?>

            <div class="">
                <?php 
$this->beginBlock('main');
?>

                <p>

			<?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
			<?php 
echo $form->field($model, 'biography')->widget(Summernote::className(), ['clientOptions' => []]);
?>
			<?php 
echo $form->field($model, 'url_info')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'url_vine')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'url_instagram')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'url_youtube')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'handle_twitter')->textInput(['maxlength' => true]);
Esempio n. 5
0
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3" for="meme-memevidmages">
                            Vidmages
                        </label>
                        <div class="col-sm-6">
                            <?php 
echo Select2::widget(['name' => 'memeVidmages', 'data' => Vidmage::getMappedArray(), 'value' => ArrayHelper::getColumn($model->notOriginMemeVidmages, 'vidmage_id'), 'options' => ['placeholder' => 'Select a Vidmage ...', 'multiple' => true], 'pluginOptions' => ['tags' => true]]);
?>
                        </div>
                    </div>

                    <?php 
echo $form->field($model, 'description')->widget(Summernote::className(), ['clientOptions' => []]);
?>

                    <?php 
echo $form->field($model, 'url_info')->textInput(['maxlength' => true]);
?>
                </p>
                <?php 
$this->endBlock();
?>

                <?php 
echo Tabs::widget(['encodeLabels' => false, 'items' => [['label' => 'Meme', 'content' => $this->blocks['main'], 'active' => true]]]);
?>
                <hr/>
                <?php