123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?php
- /**
- * @var $this View
- * @var $js string
- * @author Bogdan Savluk <savluk.bogdan@gmail.com>
- */
- use yii\helpers\Html;
- use yii\web\View;
- $gid = $this->context->model->galleryId;
- //print_a($this->context->model->galleryId);
- ?>
- <?php echo Html::beginTag('div', $this->context->options); ?>
- <!-- Gallery Toolbar -->
- <div class="btn-toolbar" style="padding:4px">
- <div class="btn-group" style="display: inline-block;">
- <div class="btn btn-success btn-file" style="display: inline-block">
- <i class="fas fa-plus"></i><?php echo Yii::t('galleryManager/main', 'Add…'); ?>
- <input type="file" name="gallery-image" class="afile" accept="image/*" multiple="multiple"/>
- </div>
- <div class="btn btn-success" style="display: inline-block">
- <i class="fas fa-plus"></i>
- <span id="addslid" data-toggle="modal" data-target="#md-<?=$this->context->options['id']?>">Добавить html</span>
- </div>
- </div>
- <div class="btn-group" style="display: inline-block;">
- <label class="btn btn-default">
- <input type="checkbox" style="margin-right: 4px;" class="select_all"><?php echo Yii::t(
- 'galleryManager/main',
- 'Select all'
- ); ?>
- </label>
- <div class="btn btn-default disabled edit_selected">
- <i class="fas fa-edit"></i> <?php echo Yii::t('galleryManager/main', 'Edit'); ?>
- </div>
- <div class="btn btn-default disabled remove_selected">
- <i class="fas fa-trash"></i> <?php echo Yii::t('galleryManager/main', 'Remove'); ?>
- </div>
- </div>
- </div>
- <hr/>
- <!-- Gallery Photos -->
- <div class="sorter">
- <div class="images"></div>
- <br style="clear: both;"/>
- </div>
- <!-- Modal window to edit photo information -->
- <div class="editor-modal modal fade">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <a class="close" data-dismiss="modal">×</a>
- <h3 class="modal-title"><?php echo Yii::t('galleryManager/main', 'Edit information') ?></h3>
- </div>
- <div class="modal-body">
- <div class="form"></div>
- </div>
- <div class="modal-footer">
- <a href="#" class="btn btn-primary save-changes">
- <?php echo Yii::t('galleryManager/main', 'Save changes') ?>
- </a>
- <a href="#" class="btn" data-dismiss="modal"><?php echo Yii::t(
- 'galleryManager/main',
- 'Close'
- ) ?></a>
- </div>
- </div>
- </div>
- </div>
- <div class="overlay">
- <div class="overlay-bg"> </div>
- <div class="drop-hint">
- <span class="drop-hint-info"><?php echo Yii::t('galleryManager/main', 'Drop Files Here…') ?></span>
- </div>
- </div>
- <div class="progress-overlay">
- <div class="overlay-bg"> </div>
- <!-- Upload Progress Modal-->
- <div class="modal progress-modal">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h3><?php echo Yii::t('galleryManager/main', 'Uploading images…') ?></h3>
- </div>
- <div class="modal-body">
- <div class="progress ">
- <div class="progress-bar progress-bar-info progress-bar-striped active upload-progress"
- role="progressbar">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="sl-modal-<?=$this->context->options['id']?> modal fade" id="md-<?=$this->context->options['id']?>">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">Создание слайда в <?=$this->context->options['id']?></h4>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- </div>
- <div class="modal-body">
- <div class="form"><div class="photo-editor row"><div class="col-xs-4"><div class="col-xs-8"><div class="form-group">
- <label class="control-label" for="photo_name_<?=$this->context->options['id']?>">Название:</label>
- <input class="form-control" type="text" name="photo[<?=$this->context->options['id']?>][name]" value="" id="photo_name_<?=$this->context->options['id']?>"></div>
- <div class="form-group"><label class="control-label" for="photo_description_<?=$this->context->options['id']?>">Описание:</label>
- <textarea class="form-control" name="photo[<?=$this->context->options['id']?>][description]" rows="3" cols="80" id="photo_description_<?=$this->context->options['id']?>"></textarea>
- </div>
- </div></div></div></div>
- <div class="modal-footer justify-content-between">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- <button type="button" class="btn btn-primary savehtml" data-onClick='slSave("<?=$this->context->options['id']?>", <?=$gid?>)' rel-mid="<?=$this->context->options['id']?>" rel-id=<?=$gid?>>Save changes</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php echo Html::endTag('div'); ?>
- <!-- Расположите это -->
- <div class="position-fixed p-3" style="bottom: 0; right: 0; z-index: 1000;" id="notycont">
- <div class="toast hide fade" role="status" aria-live="assertive" aria-atomic="true" data-autohide="false" id="noty0" style="min-width:300px;">
- <div class="toast-header">
- <strong class="mr-auto">Загрузка</strong>
- <small class="text-muted">Загружаю</small>
- </div>
- <div class="toast-body">
- Увидеть? Именно так.
- </div>
- <div class="progress" style="height: 3px;">
- <div class="progress-bar" style="width: 0%"></div>
- </div>
- </div>
- </div>
- <script>
- if(typeof $().galleryManager !== 'undefined'){
- <?=$js?>
- }
- function slSave(e, id, obj){
- title = $("input[name='photo["+e+"][name]']").val();
- description = encodeURIComponent($("textarea[name='photo["+e+"][description]']").val());
- $.ajax( 'ajaxgalleryslide?id='+e+'&gid='+id+'&title='+title+'&description='+description).done(function( data ) {
- d = JSON.parse(data);
- $('#md-'+d.id).modal('hide');
- obj(d.id, null, d.title, d.description, 0);
- });
- }
- </script>
|