/**
  * @inheritdoc
  */
 public function run()
 {
     $id = Html::getInputId($this->model, 'image_deleted');
     $options = ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false], 'pluginEvents' => ['fileclear' => "function() { \$('#{$id}').val(1);}"]];
     if ($this->model->imageUrl !== null) {
         $options['pluginOptions']['initialPreview'] = [Html::img($this->model->imageUrl, ['class' => 'file-preview-image'])];
     }
     echo $this->form->field($this->model, 'image_deleted', ['template' => '{input}'])->hiddenInput();
     echo $this->form->field($this->model, 'image')->widget(FileInput::classname(), $options);
 }
Ejemplo n.º 2
3
                for(var i = 0; i < arr.length; i++){
                    if(arr[i] === fileName){
                        arr.splice(i, 1);
                    }
                }

                $("#tour-smallimg").val("");
            }']]);
?>

    <?php 
echo $form->field($model, 'smallimg')->label("")->textInput(['maxlength' => true, 'class' => 'sr-only']);
?>

    <?php 
echo $form->field($model, 'limg', ['options' => ['name' => 'limg', 'class' => 'form-group']])->label('Largeimg')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true, 'name' => 'smallimg'], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['/file-upload/upload']), 'maxFileCount' => 10], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index){
                var lag = $("#tour-largeimg").val().split(" "),
                    //fileName = data.files[index].name.replace(" (Copy)", "1").replace(" ", "_");
                    fileName = data.response.files.name;

                for(var i = 0; i < lag.length; i++){
                    if(lag[i] === ""){
                        lag.splice(i, 1);
                    }
                }

                lag.push(fileName);
                $("#tour-largeimg").val(lag.join(" "));
            }', 'filesuccessremove' => 'function(event, id){
                var name = $("#" + id + " img").attr("title"),
                    fileName = name.replace(" ", "_");
Ejemplo n.º 3
1
   <?php 
    echo $form->field($model, 'o4')->textInput();
    ?>
  <?php 
    echo $form->field($model, 'o5')->textInput();
    ?>
  <?php 
    echo $form->field($model, 'o6')->textInput();
    ?>
    <?php 
} else {
    ?>
     <div class="form-group">
                 <?php 
    echo '<label class="control-label">เพิ่มไฟล์</label>';
    echo FileInput::widget(['model' => $model, 'attribute' => 'myfile[]', 'id' => 'upfile', 'options' => ['multiple' => true, 'accept' => '.xlsx', 'style' => 'width: 300px'], 'pluginOptions' => ['showUpload' => false, 'maxFileCount' => 30]]);
    ?>
            </div>
    <?php 
}
?>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'บันทึกข้อมูล' : 'แก้ไขข้อมูล', ['id' => 'btnsub', 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
Ejemplo n.º 4
0
    public function run()
    {
        if (!$this->model || !$this->attribute) {
            return null;
        }
        $extraData = $this->model->isNewRecord ? ['sign' => $this->model->sign] : ['id' => $this->model->id];
        $previewImages = [];
        $previewImagesConfig = [];
        $existModelImages = EntityToFile::find()->where('entity_model_name = :emn', [':emn' => $this->model->formName()]);
        if ($this->saveAttribute !== null) {
            $existModelImages->andWhere('attribute = :attr', [':attr' => $this->saveAttribute]);
        }
        $existModelImages = $this->model->isNewRecord ? $existModelImages->andWhere('temp_sign = :ts', [':ts' => $this->model->sign]) : $existModelImages->andWhere('entity_model_id = :id', [':id' => $this->model->id]);
        $existModelImages = $existModelImages->orderBy('position DESC')->all();
        /**
         * @var \common\models\EntityToFile $file
         */
        foreach ($existModelImages as $image) {
            $fileName = $image->file->base_name . '.' . $image->file->extension;
            $previewImages[] = Html::img(FPM::originalSrc($image->file_id), ['class' => 'file-preview-image', 'id' => 'preview-image-' . $image->file_id]);
            $previewImagesConfig[] = ['caption' => $fileName, 'width' => '120px', 'url' => ImagesUploadModel::deleteImageUrl(['id' => $image->id]), 'key' => $image->id];
        }
        $output = Html::hiddenInput('urlForSorting', ImagesUploadModel::sortImagesUrl(), ['id' => 'urlForSorting']);
        $output .= Html::hiddenInput('aspectRatio', $this->aspectRatio, ['class' => 'aspect-ratio']);
        $output .= FileInput::widget(['model' => $this->model, 'attribute' => $this->attribute, 'options' => ['multiple' => $this->multiple, 'accept' => 'image/*'], 'pluginOptions' => ['dropZoneEnabled' => false, 'browseClass' => 'btn btn-success', 'browseIcon' => '<i class="glyphicon glyphicon-picture"></i> ', 'removeClass' => "btn btn-danger", 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i> ', 'uploadClass' => "btn btn-info", 'uploadIcon' => '<i class="glyphicon glyphicon-upload"></i> ', 'uploadUrl' => Url::to($this->uploadUrl), 'allowedFileTypes' => ['image'], 'allowedPreviewTypes' => ['image'], 'uploadExtraData' => $extraData, 'initialPreview' => $previewImages, 'initialPreviewConfig' => $previewImagesConfig, 'overwriteInitial' => false, 'showRemove' => false, 'otherActionButtons' => $this->render('_crop_button'), 'fileActionSettings' => ['indicatorSuccess' => $this->render('_success_buttons_template')]], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index) {
                       var elem = $("#"+previewId).find(".file-actions .file-upload-indicator .kv-file-remove");
                       var cropElem = $("#"+previewId).find(".file-actions .crop-link");
                       var img = $("#"+previewId).find("img");
					   //id for cropped image replace
                       img.attr("id", "preview-image-"+data.response.imgId);

                       elem.attr("data-url", data.response.deleteUrl);
                       elem.attr("data-key", data.response.id);
                       cropElem.attr("href", data.response.cropUrl);

                       //Resort images
                       saveSort();

                       //Fix crop url for old images
                       fixMultiUploadImageCropUrl();
                    }', 'fileloaded' => 'function(file, previewId, index, reader) {
                        //Fix url for old images
                        fixMultiUploadImageCropUrl();
                    }']]);
        $output .= '<br>';
        $output .= $this->render('_modal');
        return $output;
    }
Ejemplo n.º 5
0
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'type')->dropDownList(['hot' => 'Hot', 'usual' => 'Usual'], ['prompt' => '']);
?>

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

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

    <?php 
echo $form->field($model, 'photo')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*']]);
?>

    <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>
 public function run()
 {
     if ($this->label === null) {
         $this->label = Yii::t('mediafile', 'Files');
     }
     if ($this->newFileLabel === null) {
         $this->newFileLabel = Yii::t('mediafile', 'New file');
     }
     $html = '';
     $html .= '<div class="form-group file-preview-wrapper ">';
     $html .= '<label class="control-label col col-sm-3">' . $this->label . '</label>';
     $html .= '<div class="col col-sm-6">';
     foreach ($this->model->mediafiles as $mediafile) {
         // Steal classes from kartik's plugin.
         if (preg_match('/^image\\//', $mediafile->mediafiletype->mimetype)) {
             $html .= '<div class="file-preview-frame">';
         } else {
             $html .= '<div class="file-preview-frame" style="width: 160px; height: auto; ">';
         }
         if (preg_match('/^image\\//', $mediafile->mediafiletype->mimetype)) {
             $html .= '<img src="' . Url::to(['mediafile/view', 'id' => $mediafile->primaryKey]) . '" style="width: auto; height: 160px;" />';
         } else {
             //$html .= '<div class="file-preview-other"><i class="glyphicon glyphicon-file"></i></div>';
             $name = $mediafile->title;
             if (!$name) {
                 $name = Yii::t('mediafile', 'File') . ' ' . $mediafile->primaryKey;
             }
             $name = preg_replace('/\\.[^\\.]+$/', '', $name);
             $html .= '<div class="file-caption-name">';
             $html .= $name;
             $html .= '</div>';
             $html .= '<div class="file-caption-name">';
             $html .= $mediafile->mediafiletype->extension . Yii::t('mediafile', '-file');
             $html .= '</div>';
         }
         $html .= '<br />';
         $html .= '<br />';
         $html .= '<a href="' . Url::to([$this->unassignAction, 'id' => $this->model->primaryKey, 'mediafile' => $mediafile->primaryKey]) . '" class="btn btn-warning center-block">' . Yii::t('mediafile', 'Unassign') . '</a>';
         $html .= '<br />';
         $html .= '</div>';
         // preview pane
     }
     $html .= '</div>';
     // col
     $html .= '</div>';
     // form-group
     $html .= '<div class="file-upload-wrapper">';
     // HACK: if you do not manually append [] to the name of the
     // attribute, only one file will be uploaded.
     $html .= $this->form->field($this->model, 'newFiles[]')->widget(FileInput::classname(), ['options' => ['accept' => ['image/*', 'video/*'], 'multiple' => true], 'pluginOptions' => ['showUpload' => false, 'maxFileCount' => $this->maxFileCount, 'autoReplace' => true]])->label($this->newFileLabel);
     $html .= '</div>';
     return $html;
 }
Ejemplo n.º 7
0
?>
        
        <?php 
echo $form->field($model, 'mode')->dropDownList(Ad::getAdMode());
?>

	    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
	    
	    <?php 
echo $form->field($model, 'short_code')->textInput(['maxlength' => true]);
?>
	    
	    <?php 
echo $form->field($model, 'pic_url')->hint('<i class="fa fa-info-circle"></i> ' . Yii::t('fileinput', 'Note: Limit upload one picture.'))->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => ['uploadUrl' => Url::to(['/cms/ad/file-upload']), 'uploadAsync' => true, 'initialPreview' => General::showImages($model->pic_url), 'initialPreviewConfig' => General::showLinks($model->pic_url, 'pic_url', 'ad', '/cms/ad/file-upload'), 'previewFileType' => 'any', 'overwriteInitial' => true, 'maxFileSize' => Yii::$app->params['config']['config_pic_size'], 'allowedFileExtensions' => explode(',', Yii::$app->params['config']['config_pic_extension']), 'allowedFileTypes' => ['image'], 'maxFileCount' => 1, 'uploadExtraData' => ['dir' => 'ad', 'name' => 'Ad[pic_url]', 'route' => '/cms/ad/file-upload', 'field' => 'pic_url']]]);
?>
	    
	    <?php 
/*
	    FileInput::widget([
	    	'name' => 'pic_url',
	    	'options'=>[
	    		'accept' => 'image/*',//只接收图片类型
	    		'multiple'=>false,//这里不需要多选
	    	],
	    	'pluginOptions' => [
	    		'uploadUrl' => Url::to(['/cms/ad/file-upload']),
// 	    		'uploadAsync' => true,//异步上传
	    		'initialPreview'=>[
	    			//Html::img("/images/moon.jpg", ['class'=>'file-preview-image', 'alt'=>'The Moon', 'title'=>'The Moon']),
Ejemplo n.º 8
0
/* @var $model common\models\User */
$this->title = 'Profile: ' . $model->username;
$this->params['breadcrumbs'][] = ['label' => 'Profile', 'url' => ['view']];
?>

<div class="user-view">

    <h1><?php 
echo Html::encode($model->username);
?>
</h1>

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

    echo $form->field($model, 'imgsource')->widget(FileInput::className(), [
        'options' => [
            'accept' => 'image/*',
        ],
        'pluginOptions' => [
            'uploadUrl' => Url::to(['file-upload-avatar']),
            'allowedFileExtensions' => ['jpg', 'png', 'gif', 'jpeg'],
            'initialPreview' => $image,
            'showUpload' => true,
            'showRemove' => false,
            'dropZoneEnabled' => false,
        ]
    ]);

    ?>
Ejemplo n.º 9
0
    ?>
-image">

    <?php 
    Modal::end();
}
?>

<div id="field-<?php 
echo $selector;
?>
" class="form-group uploader">
    <div class="fullinput">
        <div class="uploader-browse">
            <?php 
echo FileInput::widget(['model' => $model, 'attribute' => $attribute, 'options' => ['id' => $selector, 'onchange' => 'readFile(this, "' . $selector . '", ' . (int) $crop . ', ' . Json::encode($jcropSettings) . ')'], 'pluginOptions' => ['showRemove' => false, 'uploadAsync' => false, 'showUpload' => false, 'showUploadedThumbs' => false, 'showPreview' => false, 'previewFileType' => false]]);
?>
        </div>
    </div>
    <?php 
if ($crop) {
    ?>
        <?php 
    echo Html::hiddenInput($model->formName() . "[{$attribute}-coords][x]", null, ['id' => "{$selector}-coords-x"]);
    ?>
        <?php 
    echo Html::hiddenInput($model->formName() . "[{$attribute}-coords][w]", null, ['id' => "{$selector}-coords-w"]);
    ?>
        <?php 
    echo Html::hiddenInput($model->formName() . "[{$attribute}-coords][y]", null, ['id' => "{$selector}-coords-y"]);
    ?>
Ejemplo n.º 10
0
        </div>
    </div>
    <div class="row">
        <div class="col-md-4"><?php 
echo $form->field($model, 'drivers_passport')->textInput(['maxlength' => true]);
?>
</div> 
        <div class="col-md-4"> <?php 
echo $form->field($model, 'drivers_licence')->textInput(['maxlength' => true]);
?>
</div>
    </div>    
    <div class="row">
        <div class=" col-md-12">
            <?php 
echo $form->field($model, 'docs[]')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['initialPreview' => $model->initialPreview($model->docs, 'docs', 'file'), 'initialPreviewConfig' => $model->initialPreview($model->docs, 'docs', 'config'), 'allowedFileExtensions' => ['pdf', 'jpg'], 'showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'overwriteInitial' => false]])->label(false);
?>
        </div>
    </div>

    <?php 
if ($model->isNewRecord) {
    echo $form->field($model, 'appilcant_id')->hiddenInput(['maxlength' => true, 'value' => $id])->label(false);
} else {
    echo $form->field($model, 'appilcant_id')->hiddenInput(['maxlength' => true])->label(false);
}
?>
    <?php 
//$form->field($model, 'appilcant_id')->textInput(['maxlength' => true, 'value' => $id])->label(false)
?>
Ejemplo n.º 11
0
<div class="modal-body">
    <div class="row">
        <div class="col-xs-12">

            <?php 
echo $form->field($model, 'nombre', $inputOpciones)->textInput(['class' => $inputClase, 'autocomplete' => 'off']);
?>
            <span class="glyphicon glyphicon-ok form-control-feedback"></span>
            <?php 
//$form->field($model, 'icono', $inputOpciones)->fileInput(['class' => $inputClase])
?>

            <?php 
// your fileinput widget for single file upload
echo $form->field($model, 'imagenes')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showCaption' => true, 'showRemove' => false, 'showUpload' => false, 'showPreview' => false, 'browseClass' => 'btn ink-reaction btn-primary btn-block', 'browseIcon' => '<i class="md md-photo-camera"></i> ', 'browseLabel' => 'Seleccionar icono']])->label(false);
?>

            <?php 
echo $form->field($model, 'estado')->radioList($model->listadoEstados(), $inputRadioListOpciones)->label($model->getAttributeLabel('tipo'), ['style' => 'margin-bottom: 10px;']);
?>

            <span class="opacity-50"><?php 
echo $model->getAttributeLabel('descripcion');
?>
</span>
            <?php 
echo $form->field($model, 'descripcion')->textarea(['class' => $inputClase . ' editorTexto control-3-rows', 'style' => 'margin-top:10px', 'placeholder' => 'Me describo como...'])->label(false);
?>
        </div>
    </div>
Ejemplo n.º 12
0
 * @var app\models\TESTIMONIALS $model
 * @var yii\widgets\ActiveForm $form
 */
$this->registerJsFile("//cdn.tinymce.com/4/tinymce.min.js");
?>

<div class="testimonials-form">
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
    <?php 
echo $form->field($model, 'comment')->textarea(['rows' => 6]);
?>

<?php 
echo FileInput::widget(['model' => $model, 'attribute' => 'image', 'pluginOptions' => ['initialPreview' => [], 'initialCaption' => "User Image", 'overwriteInitial' => false, 'options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]]);
?>
  <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>


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

</div>

<?php 
Ejemplo n.º 13
0
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use kartik\dynagrid\DynaGrid;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Fregat\DocfilesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Загруженные файлы';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this);
?>
<div class="docfiles-index">

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

    <?php 
echo $form->field($model, 'docFile')->widget(FileInput::classname(), ['pluginOptions' => ['uploadUrl' => Url::to(['Fregat/docfiles/create']), 'dropZoneEnabled' => false, 'previewZoomSettings' => ['image' => ['width' => 'auto', 'height' => '100%']]], 'pluginEvents' => ["fileuploaded" => 'function(event, data, previewId, index) { UploadedFiles("docfilesgrid", event, data); }']]);
?>

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

    <?php 
$result = Proc::GetLastBreadcrumbsFromSession();
$foreign = isset($result['dopparams']['foreign']) ? $result['dopparams']['foreign'] : '';
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'docfilesgrid'], 'columns' => Proc::DGcols(['columns' => [['attribute' => 'docfiles_ext', 'format' => 'raw', 'value' => 'docfiles_iconshow', 'contentOptions' => ['style' => 'width: 40px; text-align: center;'], 'filter' => false], ['attribute' => 'docfiles_name', 'format' => 'raw', 'value' => 'docfiles_name_html'], ['attribute' => 'docfiles_hash', 'visible' => false]], 'buttons' => array_merge(empty($foreign) ? [] : ['chooseajax' => ['Fregat/docfiles/assign-to-select2']], Yii::$app->user->can('DocfilesEdit') ? ['deleteajax' => ['Fregat/docfiles/delete']] : [])]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<i class="glyphicon glyphicon-file"></i> ' . $this->title]]]));
?>
</div>
Ejemplo n.º 14
0
    <?php 
$language_items = [];
foreach ($languages as $key => $language) {
    $field = $form->field($model, "name_{$language->url}")->textInput(['maxlength' => true])->label('Name');
    if ($languageDefault->url == $language->url) {
        $field = $form->field($model, "name")->textInput(['maxlength' => true]);
    }
    $language_items[] = ['label' => Yii::t('backend', $language->name), 'content' => "<p>{$field}</p>", 'active' => $key == 0];
}
echo Tabs::widget(['items' => $language_items]);
?>


    <?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['options' => ['multiple' => false, 'accept' => 'pdf/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showUpload' => false]])->label(Yii::t('backend', 'PDF File'));
?>

    <?php 
echo Html::a($model->file, $model->getUploadedFileUrl('file'), array('target' => '_blank'));
?>
    <br/><br/>

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

    <?php 
echo $form->field($model, 'id')->hiddenInput();
?>
Ejemplo n.º 15
0
    var tpl = '<div class = "col-md-4"><div class="thumbnail"><p>'
            + '<a href="{$editAction}" class="imgaction blue" title="Редактировать">'
            + '<i class="glyphicon glyphicon-pencil"></i></a>'
            + '<a href="#" class="imgaction red pull-right" title="Удалить" data-id="{id}">'
            + '<i class="glyphicon glyphicon-trash"></i></a></p>'
            + '<img src="{thumb}">'
            + '<p><a href="#" class="imgaction grey" title="Сделать главным" data-id="{id}">'
            + '<i class="glyphicon glyphicon-ok"></i></a></p></div></div>';
    for(var i in data.response) {
        var el = tpl.replace('{id}', data.response[i].id).
                    replace('{thumb}', data.response[i].thumb);
        \$(el).appendTo('#page-images');
    }
}
fileuploaded;
echo FileInput::widget(['name' => 'files', 'options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['uploadUrl' => Url::to(['image/ajax-upload', 'table' => $model::$tableId, 'id' => $model->id]), 'maxFileCount' => 5, 'browseClass' => 'btn btn-success', 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i> ', 'dropZoneEnabled' => false], 'pluginEvents' => ['fileuploaded' => $jsUploaded]]);
?>
</div>
<hr>
<div id="page-images" class="row">
<?php 
if ($files != null) {
    foreach ($files as $f) {
        $f->attachBehavior('imageBehavior', ['class' => \app\components\imageBehavior::className()]);
        ?>
        <div class = "col-md-4">
            <div class="thumbnail">
                <p>
                    <a href="<?php 
        echo Url::to(['image/edit', 'id' => $f->id]);
        ?>
Ejemplo n.º 16
0
            <?php 
echo $form->field($model, 'detail_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->getFileUrl('detail_image') ? [Html::img($model->getFileUrl('detail_image'), ['class' => 'file-preview-image'])] : [], 'initialPreviewConfig' => [['caption' => $model->getFileUrl('detail_image'), 'url' => \yii\helpers\Url::to(['delete-file', 'pk' => $model->id, 'attribute' => 'detail_image'])]], 'showUpload' => false, 'showRemove' => false]]);
?>

            <?php 
//= $form->field($model, 'path')->textInput(['maxlength' => 2000])
?>
        </div>
        <div id="advanced-options" class="tab-pane">
            <?php 
echo $form->field($model, 'preview_text')->textarea(['rows' => 10]);
?>

            <?php 
echo $form->field($model, 'preview_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->getFileUrl('preview_image') ? [Html::img($model->getFileUrl('preview_image'), ['class' => 'file-preview-image'])] : [], 'initialPreviewConfig' => [['caption' => $model->getFileUrl('preview_image'), 'url' => \yii\helpers\Url::to(['delete-file', 'pk' => $model->id, 'attribute' => 'preview_image'])]], 'showUpload' => false, 'showRemove' => false]]);
?>
        </div>
        <div id="meta-options" class="tab-pane">
            <?php 
echo $form->field($model, 'metakey')->textInput(['maxlength' => 255]);
?>

            <?php 
echo $form->field($model, 'metadesc')->textarea(['maxlength' => 2048]);
?>
        </div>
    </div>

    <?php 
echo Html::activeHiddenInput($model, 'lock');
Ejemplo n.º 17
0
/* @var $model app\models\Books */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="books-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

    <?php 
echo $form->field($model, 'preview')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false]]);
?>

    <?php 
echo $form->field($model, 'date')->widget(DatePicker::classname(), ['value' => date('Y-m-d', strtotime('today')), 'options' => ['placeholder' => Yii::t('books', 'select Date')], 'pluginOptions' => ['hideInput' => true, 'format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Authors::find()->all(), 'id', 'fullName'), ['prompt' => Yii::t('books', 'select Author')]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Ejemplo n.º 18
0
<?php

use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
<div class="containerqq" style="background-color: #FFFFFF;border-radius: 10px">
<div style=" clear:both;display:block;">
<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']], ['data-pjax' => '']);
?>

    <?php 
echo $form->field($model, 'imageFiles')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*']]);
?>

<?php 
ActiveForm::end();
?>
</div>
<?php 
foreach ($pic as $pc) {
    ?>

    <div class=" col-xs-6 col-sm-3" style="position: relative;width: 19%">   <?php 
    $a = Html::img('@web/' . $pc->pic_name, ['alt' => ')))))))', 'data-lightbox' => "roadtrip", 'id' => $pc->id, 'style' => ['cursor' => 'pointer', 'width' => '206px', 'height' => '206px'], 'class' => '']);
    ?>
               <?php 
    echo Html::a($a, ['@web/' . $pc->pic_name], ['data-lightbox' => "roadtrip", 'data-toggle' => "confirmation"]);
    ?>
 <div class="nkr  "> <div aria-expanded="false" data-toggle="tooltip" title="Edit options" class=" dropdown ">
                <a href="#" data-toggle="dropdown" class="dropdown-toggle edopt"> </a>
Ejemplo n.º 19
0
<?php

use yii\widgets\ActiveForm;
use yii\helpers\Url;
use kartik\file\FileInput;
?>

<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'action' => Url::to(['upload', 'id' => $model->id])]);
?>

    <?php 
echo $form->field($model, 'files[]')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['maxFileCount' => 5, 'browseClass' => 'btn btn-success', 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i> ']])->label(false);
?>

<?php 
ActiveForm::end();
Ejemplo n.º 20
0
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'amount_text')->widget(TouchSpin::classname(), ['pluginOptions' => ['min' => 0.25, 'max' => 9.0, 'step' => 0.25, 'decimals' => 2, 'boostat' => 1, 'maxboostedstep' => 1]])->label(Yii::t('backend', 'Amount') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
$unit_data = backend\models\Unit::find()->select(['unit_id', 'unit_text'])->orderBy('unit_text')->all();
$unit_list = \yii\helpers\ArrayHelper::map($unit_data, 'unit_id', 'unit_text');
echo $form->field($model, 'unit_id')->dropDownList($unit_list, ['prompt' => Yii::t('backend', 'Select...')])->label(Yii::t('backend', 'Use Unit') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
echo $form->field($model, 'amount_img_temp')->widget(FileInput::classname(), ['options' => ['accept' => 'image/jpeg, image/gif, image/png, image/svg+xml'], 'pluginOptions' => ['showCaption' => true, 'showRemove' => true, 'showUpload' => false, 'browseLabel' => '', 'removeLabel' => '', 'removeClass' => 'btn btn-danger', 'initialPreview' => !empty($model->amount_img) ? [Html::img($model->amount_img, ['class' => 'file-preview-image'])] : [], 'initialCaption' => !empty($model->amount_img) ? ' /' . $model->amount_img : ' ']])->label(Yii::t('backend', 'Image') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
echo $form->field($model, 'note')->textarea(['rows' => 6]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton(Yii::t('backend', 'Save'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-warning']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
Ejemplo n.º 21
0
echo $form->field($model, 'reminder_hours')->dropDownList($model->getEarlyReminderOptions(), ['prompt' => Yii::t('frontend', 'When would you like your early reminder?')])->label(Yii::t('frontend', 'Early reminders'));
?>

                  <?php 
echo $form->field($model, 'contact_share')->checkbox(['label' => Yii::t('frontend', 'Share my contact information with meeting participants'), 'uncheck' => $model::SETTING_NO, 'checked' => $model::SETTING_YES]);
?>
 

                  <?php 
echo $form->field($model, 'no_email')->checkbox(['label' => Yii::t('frontend', 'Turn off all email'), 'uncheck' => $model::SETTING_NO, 'checked' => $model::SETTING_YES]);
?>
                </div>
           <div class="tab-pane vertical-pad" id="photo">

             <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
?>
           </div> <!-- end of upload photo tab -->
           <div class="form-group">
               <?php 
echo Html::submitButton(Yii::t('frontend', 'Save Settings'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
           </div>
         </div> <!-- end tab content -->
         </div> <!--end left col -->
         <div class="col-md-4">
           <?php 
if ($model->avatar != '') {
    echo '<img src="' . Yii::getAlias('@web') . '/uploads/avatar/sqr_' . $model->avatar . '" class="profile-image"/>';
} else {
    echo \cebe\gravatar\Gravatar::widget(['email' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->email, 'options' => ['class' => 'profile-image', 'alt' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->username], 'size' => 128]);
Ejemplo n.º 22
0
                      </ul>

                      <div class="col-md-12 save_sort_order_btn_wrap" style="">
                          <a class="btn btn-sm btn-primary pull-right save_sort_order_btn" href="#">Save Order</a>
                      </div>
                  </div>
                </div>
            </div>

            <div role="tabpanel" class="tab-pane" id="files">
              <?php 
$files_model = new ProductFiles();
echo FileInput::widget(['model' => $files_model, 'attribute' => 'file_name', 'options' => ['multiple' => true], 'pluginOptions' => ['uploadUrl' => Url::to(['/product/upload_file']), 'uploadExtraData' => ['id' => $model->id], 'maxFileCount' => 10, 'allowedFileExtensions' => ['docx', 'doc', 'txt', 'pdf']], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index){
                                $(".product_files_table").append(data.response.view);
                                //$(".uploaded_images").sortable();
                                
                            }', 'filebatchuploadcomplete' => 'function(event, files, extra){
                                $(".fileinput-remove-button").click();
                            }']]);
?>


                <div class="col-md-8">
                    <table class="table product_files_table">
                      <tr>
                        <th>File Name</th>
                        <th>File</th>
                        <th>Actions</th>
                      </tr>
                        <?php 
if (!empty($model->product_files)) {
Ejemplo n.º 23
0
                <?php 
echo $form->field($model, 'city')->textInput();
?>

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

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

                <?php 
echo $form->field($model, 'text')->textarea();
?>

                <?php 
echo $form->field($model, 'images[]')->widget(FileInput::className(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['showUpload' => false, 'showCaption' => false, 'showRemove' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Нажмите, чтобы выбрать фото']]);
?>

                <?php 
echo Html::submitButton('Отправить', ['class' => 'btn btn-primary']);
?>

                <?php 
ActiveForm::end();
?>
            </div>
    </div>
</div>
Ejemplo n.º 24
0
<div class="picture-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'Picture']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
<?php 
// Ajax uploads with drag and drop feature. Enable AJAX uploads by setting the `uploadUrl` property
// in pluginOptions. You can also pass extra data to your upload URL via `uploadExtraData`. Refer
// [plugin documentation and demos](http://plugins.krajee.com/file-input/demo) for more details
// and options on using AJAX uploads.
echo \kartik\file\FileInput::widget(['name' => 'Picture[file]', 'options' => ['multiple' => true], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['/medialib/picture/upload']), 'uploadExtraData' => ['album_id' => 20, 'cat_id' => 'Nature'], 'maxFileCount' => 100]]);
?>
	<div class="mlpicture">
		<?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_preview']);
?>
	</div>
	
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'folder', 'name', 'filetype', 'sizex', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Ejemplo n.º 25
0
<?php

$form = \yii\bootstrap\ActiveForm::begin();
?>

    <div class="row">
        <?php 
echo $form->field($model, 'general_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['file-upload-general']), 'uploadExtraData' => ['advert_id' => $model->idadvert], 'allowedFileExtensions' => ['jpg', 'png', 'gif'], 'initialPreview' => $image, 'showUpload' => true, 'showRemove' => false, 'dropZoneEnabled' => false]]);
?>

    </div>

    <div class="row">
        <?php 
echo \yii\helpers\Html::label('Images');
echo \kartik\file\FileInput::widget(['name' => 'images', 'options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['file-upload-images']), 'uploadExtraData' => ['advert_id' => $model->idadvert], 'overwriteInitial' => false, 'allowedFileExtensions' => ['jpg', 'png', 'gif'], 'initialPreview' => $images_add, 'showUpload' => true, 'showRemove' => false, 'dropZoneEnabled' => false]]);
?>

    </div>

    <div class="form-group">
        <?php 
echo \yii\helpers\Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

<?php 
\yii\bootstrap\ActiveForm::end();
Ejemplo n.º 26
0
/* @var $this yii\web\View */
/* @var $model common\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?//= $form->field($model, 'status')->textInput() ?>
    <div class="row">
        <div class="col-md-6">
            <?php 
echo $form->field($model, 'photo')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->photo ? [Html::img($model->photoUrl, ['class' => 'file-preview-image', 'alt' => $model->username, 'title' => $model->username])] : false, 'showUpload' => false, 'allowedFileExtensions' => ['jpg', 'gif', 'png', 'bmp']]]);
?>
            <?php 
echo $form->field($model, 'category_id')->dropDownList($model->categoryList());
?>
            <?php 
echo $form->field($model, 'tagIds')->checkboxList(ArrayHelper::map(\common\models\Tag::find()->all(), 'id', 'title'));
?>
        </div>
        <div class="col-md-6">
            <div class="row">
                <div class="col-md-6">
                    <?php 
echo $form->field($model, 'first_name')->textInput();
?>
                </div>
Ejemplo n.º 27
0
echo $form->field($profile, 'full_name')->textInput(['placeholder' => Yii::t('app', 'Enter user full name...')]);
?>
            </div>
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'company')->textInput(['placeholder' => Yii::t('app', 'Enter user company...')]);
?>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <?php 
if ($profile->avatar) {
    echo $form->field($profile, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t("app", "Select Picture"), 'initialPreview' => [Html::img($profile->getAvatarUrl(), ['class' => 'file-preview-image', 'alt' => $profile->full_name, 'title' => $profile->full_name])], 'overwriteInitial' => true, 'showRemove' => false, 'showUpload' => false]]);
} else {
    echo $form->field($profile, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t("app", "Select Photo"), 'showRemove' => false, 'showUpload' => false]]);
}
?>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'timezone')->dropDownList($timezones)->label(Yii::t("app", "Timezone"));
?>
            </div>
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'language')->dropDownList($languages)->label(Yii::t("app", "Language"));
?>
            </div>
Ejemplo n.º 28
0
<?php

use yii\helpers\Url;
use kartik\file\FileInput;
use app\models\UploadForm;
/* @var $this yii\web\View */
/* @var $model app\models\Post */
/* @var $form yii\widgets\ActiveForm */
$oUploadForm = new UploadForm();
$iPostValue = $_GET['id'];
?>

<div class="post-form">
<div class="add_picture">
                        <?php 
echo FileInput::widget(['model' => $oUploadForm, 'name' => 'attachment_' . $iPostValue . '[]', 'language' => 'pl', 'options' => ['multiple' => true], 'pluginOptions' => ['uploadUrl' => Url::to(['upload-form/upload?id=' . $iPostValue . '']), 'uploadAsync' => false, 'showRemove' => false, 'allowedFileTypes' => array('image')]]);
?>
                    </div>
</div>
Ejemplo n.º 29
0
/* @var $model backend\models\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form">
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(\backend\models\User::find()->asArray()->all(), 'id', 'username'));
?>

    <?php 
echo '<label class="control-label">图片</label>';
echo FileInput::widget(['model' => $model, 'attribute' => 'logo', 'pluginOptions' => ['uploadExtraData' => ['album_id' => 20, 'cat_id' => 'Nature'], 'maxFileCount' => 10, 'initialCaption' => $model->logo, "showUpload" => false]]);
?>

    <?php 
echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(\backend\models\Category::get(0, \backend\models\Category::find()->asArray()->all()), 'id', 'str_label'));
?>
    <?php 
echo $form->field($model, 'status')->dropDownList(\backend\models\Article::getArrayStatus());
?>
    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'intro')->textarea(['rows' => 6]);
?>
Ejemplo n.º 30
0
?>

    <?php 
echo $form->field($model, 'data_nasc')->input("date");
?>

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

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

    <?php 
echo $form->field($model, 'foto')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'jpeg', 'png', 'tif', 'tiff'], 'showUpload' => false, 'showRemove' => false, 'initialPreview' => [Html::img($model->getImageUrl(), ['class' => 'file-preview-image', 'alt' => 'Imagem atual', 'title' => 'Imagem Atual'])]]]);
?>

    <?php 
echo $form->field($model, 'email')->input("email");
?>
    
    <?php 
echo $form->field($model, 'password')->passwordInput(['value' => ""]);
?>

    <?php 
echo $form->field($model, 'password_repeat')->passwordInput(['value' => ""]);
?>

    <?php