/** * @return string */ public function run() { $content = '<span id="' . $this->blockId . '" style="display:none;"><br>'; $content .= \trntv\filekit\widget\Upload::widget($this->originConfig); $js = 'setTimeout(function(){ '; $js .= 'var block = $("#' . $this->blockId . '").detach();'; $js .= '$(\'input[name="' . $this->fieldName . '"]\').parent().append(block);'; $js .= '$("#' . $this->blockId . '").show();'; $js .= '$("#' . $this->blockId . '").change(function(){ setTimeout(function() '; $js .= '{ var src = $("#' . $this->blockId . '").find(\'img\').attr(\'src\'); var content = window.jsoneditorcsseditors[\'' . $this->editorKey . '\'].getEditor(\'' . $this->fieldEditorKey . '\'); content.setValue(src); },2000); });'; $js .= '},3000);'; $content .= '</span>'; $this->view->registerJs($js); return $content; }
echo $form->field($model, 'wx')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'type')->textInput(); ?> <?php echo $form->field($model, 'sort')->textInput(); ?> <?php echo $form->field($model, 'status')->textInput(); ?> <?php echo $form->field($model, 'qrcode_file')->widget(Upload::className(), ['url' => ['upload'], 'maxFileSize' => 5000000]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
?> <?php echo $form->field($model, 'news_content')->widget(Ueditor::className(), ['id' => 'Post[news_content]', 'ucontent' => $model->news_content, 'options' => ['toolbars' => [['fullscreen', 'undo', 'redo', 'bold', 'italic', 'source', 'underline', 'fontborder', 'backcolor', 'fontsize', 'fontfamily', 'insertimage'], ['justifyleft', 'justifyright', 'justifycenter', 'justifyjustify', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']], 'initialFrameWidth' => '100%', 'initialFrameHeight' => '500', 'autoHeightEnabled' => false, 'autoFloadEnabled' => true]]); ?> <?php echo $form->field($model, 'news_author')->textInput(['maxlength' => 30]); ?> <?php echo $form->field($model, 'news_from')->textInput(['maxlength' => 100]); ?> <?php echo $form->field($model, 'news_cover_url')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000])->hint('(图片大小不要超过5MB)'); ?> <?php echo $form->field($model, 'news_video_url')->textInput(['maxlength' => 2000]); ?> <?php echo $form->field($model, 'rel_tag')->textInput(['id' => 'rel_tag', 'data-role' => 'tagsinput'])->hint('(添加方式,自由输入)'); ?> <?php echo $form->field($model, 'rel_user')->textInput(['id' => 'rel_user', 'data-role' => 'tagsinput'])->hint('(通过下拉框选择。添加方式,姓名|手机号|uid)'); ?> <?php
<div> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($ticketTopicRelationModel, 'topic_id', array('labelOptions' => array('label' => "选择话题", 'class' => "myOption")))->checkboxList($topic_list); ?> <?php echo $form->field($ticketCdataModel, 'subject')->textInput(); ?> <?php echo $form->field($ticketCdataModel, 'detail')->textarea(); ?> <?php echo $form->field($fileModel, 'file_index')->widget(Upload::className(), ['url' => ['upload'], 'sortable' => true, 'maxFileSize' => 10000000, 'maxNumberOfFiles' => 10]); ?> <div class="form-group"> <?php echo Html::submitButton("提交工单", array('class' => 'btn btn-success')); ?> </div> <?php ActiveForm::end(); ?> </div> </div>
</div> </div> </div> <!-- End panel-body --> </div> </div> <div class="col-lg-4"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php echo \Yii::t('wallet', 'Receipt Image'); ?> </h3> </div> <div class="panel-body"> <?php echo $form->field($receipt, 'image', ['template' => '<div class="col-lg-12">{input}</div>'])->widget(Upload::className(), ['url' => ['/transaction/upload'], 'maxFileSize' => 5000000]); ?> </div> </div> </div> </div> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php echo \Yii::t('wallet', 'Products'); ?> </h3> </div>
use yii\bootstrap\ActiveForm; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\UserProfile */ /* @var $form yii\bootstrap\ActiveForm */ $this->title = Yii::t('backend', 'Edit profile'); ?> <div class="user-profile-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'picture')->widget(\trntv\filekit\widget\Upload::classname(), ['url' => ['avatar-upload']]); ?> <?php echo $form->field($model, 'firstname')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'middlename')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'lastname')->textInput(['maxlength' => 255]); ?> <?php
?> <?php echo $form->field($model, 'category_id')->dropDownList(\yii\helpers\ArrayHelper::map($categories, 'id', 'name'), ['prompt' => Yii::t('app', 'Select category')]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'action_url')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'picture')->widget(Upload::classname(), ['url' => ['banner-upload']]); ?> <?php echo $form->field($model, 'status')->dropDownList($model->getStatusesArray(), ['options' => [$model->status => ['selected ' => true]]]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>
/* @var $form yii\bootstrap\ActiveForm */ ?> <div class="employer-create-form"> <?php $form = ActiveForm::begin(); ?> <?php echo \common\models\Languages::showSelectButtons(); ?> <hr/> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 50, 'class' => 'form-control mlang']); ?> <?php echo $form->field($model, 'image')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'multiple' => false]); ?> <?php echo $form->field($model, 'description')->textarea(['maxlength' => 1500, 'class' => 'mlang', 'id' => 'ckeditor']); ?> <?php echo $form->field($model, 'position')->textInput(['maxlength' => 50, 'class' => 'form-control mlang']); ?> <?php echo $form->field($model, 'period')->textInput(['maxlength' => 50, 'class' => 'form-control mlang']); ?> <?php echo $form->field($model, 'sort')->textInput(); ?> <?php echo $form->field($model, 'active')->checkbox();
?> <div class="pet-category-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->errorSummary($model); ?> <div class="row"> <div class="col-md-3"> <?php echo $form->field($model, 'category_image')->widget(\trntv\filekit\widget\Upload::classname(), ['url' => ['picture-upload'], 'maxFileSize' => 5000000])->label('Основное изображение'); ?> </div> <div class="col-md-9"> <div class="row"> <div class="col-md-6"> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-6"> <?php echo $form->field($model, 'parent_id')->dropDownList($categories, ['prompt' => ''])->label("Родительская категория"); ?> </div> </div>
?> <?php echo $form->field($model, 'start_time')->widget(DateTimeWidget::className(), ['phpDatetimeFormat' => 'yyyy-MM-dd HH:mm:ss', 'momentDatetimeFormat' => 'YYYY-MM-DD HH:mm', 'clientOptions' => ['locale' => 'zh-CN']]); ?> <?php echo $form->field($model, 'end_time')->widget(DateTimeWidget::className(), ['phpDatetimeFormat' => 'yyyy-MM-dd HH:mm:ss', 'momentDatetimeFormat' => 'YYYY-MM-DD HH:mm', 'clientOptions' => ['locale' => 'zh-CN']]); ?> <?php echo $form->field($model, 'thumbnail')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000]); ?> <?php echo $form->field($model, 'bg_image')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000])->label('背景图片(1920X1288)'); ?> <?php echo $form->field($model, 'description')->textarea(['rows' => 4]); ?> <?php echo $form->field($model, 'guize')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video', 'fontsize'], 'options' => ['lang' => 'zh', 'minHeight' => 150, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'jiangli')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video', 'fontsize'], 'options' => ['lang' => 'zh', 'minHeight' => 150, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php
<?php echo $form->errorSummary($model); ?> <!-- --><?php //echo $form->field($model, 'user_id')->textInput() ?> <!-- --><?php //echo $form->field($model, 'slug')->textInput(['maxlength' => true]) ?> <div class="row"> <div class="col-md-12"> <?php echo $form->field($model, 'attachments')->widget(Upload::className(), ['url' => ['picture-upload'], 'sortable' => true, 'maxFileSize' => 5000000, 'maxNumberOfFiles' => 10])->label(Yii::t('backend', 'Прикрепить изображения')); ?> </div> </div> <div class="row"> <div class="col-md-4"> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'pet_category_id')->textInput(); ?> </div>
<div class="product-category-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->errorSummary($model); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'main_image')->widget(\trntv\filekit\widget\Upload::classname(), ['url' => ['product-category']]); ?> <?php echo $form->field($model, 'description')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video'], 'options' => ['minHeight' => 400, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'parent_id')->textInput(); ?> <?php echo $form->field($model, 'lvl')->textInput(); ?> <?php
height: 50px; width: 50px; } .upload-kit .upload-kit-item .remove { font-size: 2em; top: 35%; left: 60%; width: 40px; height: 40px; line-height: 33px; background-color: rgba(73, 112, 255, 0.8); } </style> <?php echo $form->field($model, 'pictures')->widget(Upload::className(), ['url' => ['upload'], 'sortable' => true, 'maxFileSize' => 10 * 1024 * 1024, 'maxNumberOfFiles' => 10, 'clientOptions' => []]); ?> </div> </div> </div> <div class="form-group"> <div class="col-sm-6 col-sm-offset-3"> <?php echo Html::submitButton($model->product->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->product->isNewRecord ? 'btn btn-success btn-block' : 'btn btn-primary btn-block']); ?> </div> </div> </section> <?php ActiveForm::end();
echo $form->field($model, 'slug')->hint(Yii::t('backend', 'If you\'ll leave this field empty, slug will be generated automatically'))->textInput(['maxlength' => 1024]); ?> <?php echo $form->field($model, 'parent_id')->dropDownList($categories, ['prompt' => '']); ?> <?php echo $form->field($model, 'status')->checkbox(); ?> <?php echo $form->field($model, 'order')->textInput(['maxlength' => 11]); ?> <?php echo $form->field($model, 'thumbnail')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
$this->title = Yii::t('frontend', 'User Settings'); ?> <div class="user-profile-form"> <?php $form = ActiveForm::begin(); ?> <h2><?php echo Yii::t('frontend', 'Profile settings'); ?> </h2> <?php echo $form->field($model->getModel('profile'), 'picture')->widget(Upload::classname(), ['url' => ['avatar-upload']]); ?> <?php echo $form->field($model->getModel('profile'), 'firstname')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model->getModel('profile'), 'middlename')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model->getModel('profile'), 'lastname')->textInput(['maxlength' => 255]); ?> <?php
/* @var $model common\models\Domain */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="domain-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'logo')->widget(\trntv\filekit\widget\Upload::classname(), ['url' => ['logo-upload']]); ?> <?php echo $form->field($model, 'm_logo')->widget(\trntv\filekit\widget\Upload::classname(), ['url' => ['m_logo-upload']]); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'description')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'locale')->dropDownList(['uk' => 'Укаїнська', 'ru' => 'Русский']); ?> <?php
<?php $form = ActiveForm::begin(); ?> <?php echo $form->errorSummary($model); ?> <?php echo $form->field($model, 'id')->textInput(); ?> <?php echo $form->field($model, 'img')->widget(Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000]); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>
?> <div class="row"> <div class="col-xs-12 col-sm-12 col-lg-12"> <?php echo common\widgets\jsoneditor\JsonEditor::widget(['fieldId' => $mId . '-body', 'schemaUrl' => Yii::getAlias('@web/js/json-editor/schema/article.body.json')]); ?> </div> </div> <?php echo $form->field($model, 'thumbnail')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'maxFileSize' => 5000000]); ?> <?php echo $form->field($model, 'attachments')->widget(\trntv\filekit\widget\Upload::className(), ['url' => ['/file-storage/upload'], 'sortable' => true, 'maxFileSize' => 10000000, 'maxNumberOfFiles' => 10]); ?> <?php echo $form->field($model, 'domain')->dropDownList($domains, ['prompt' => '', 'multiple' => true]); $js = '$("#' . $mId . '-domain").select2();'; $this->registerJs($js); ?> <?php echo $form->field($model, 'published_at')->widget('trntv\\yii\\datetimepicker\\DatetimepickerWidget', ['phpDatetimeFormat' => 'yyyy-MM-dd\'T\'HH:mm:ssZZZZZ']); ?> <?php echo $form->field($model, 'status')->checkbox(); ?>
?> </p> <?php $form = ActiveForm::begin(); ?> <blockquote> <p>หลังจากอัพโหลดไฟล์เสร็จทุกรายการ กรุณาคลิกบันทึกที่ด้านล่างด้วยครับ..</p> </blockquote> <table class="table table-bordered"> <tbody> <?php $i = 1; foreach ($documents as $index => $document) { echo "<tr><td style='width:30px;text-align:center;'><strong>{$i}</strong></td><td>" . ($document->filename ? '<i style="color:green;" class="glyphicon glyphicon-ok"></i> ' : '') . "{$document->documentType->name}</td><td style='width:80px;'>"; echo \trntv\filekit\widget\Upload::widget(['model' => $document, 'attribute' => "[{$index}]attach_file", 'url' => ['document-upload'], 'sortable' => true, 'maxFileSize' => 10 * 1024 * 1024, 'maxNumberOfFiles' => 1]); echo '</td></tr>'; $i++; } ?> </tbody> </table> <div class="form-group"> <?php echo Html::submitButton('SAVE', ['class' => 'btn btn-yellow btn-lg btn-block']); ?> </div> <?php ActiveForm::end(); ?> </div>