Exemplo n.º 1
0
    public function currentRender()
    {
        $isNew = is_null($this->gallery->id);
        if (!$isNew) {
            $id = $this->gallery->id;
            $name = $this->gallery->name;
            $description = $this->gallery->description;
            $aGalleryItems = $this->gallery->getGalleryItems('position');
        } else {
            $id = $name = $description = '';
            $aGalleryItems = [];
        }
        ?>
        <form id="gallery-edit-form" action="/admin/modules/gallery/save/" method="post">
            <fieldset>
                <legend><?php 
        echo $isNew ? 'Добавление новой галереи' : "Редактирование галереи (<a target=\"_blank\" href=\"/admin/modules/gallery/item/?gallery_id={$id}\">перейти к редактированию элементов</a>)";
        ?>
</legend>
                <input type="hidden" name="gallery-edit-id" value="<?php 
        echo $id;
        ?>
" />

                <div class="row">
                    <div class="col-sm-6">
                        <div class="row">
                            <div class="col-lg-1">
                                <div class="form-group">
                                    <label for="gallery-edit-number">№</label>
                                    <input class="form-control input-sm" id="gallery-edit-number" name="gallery-edit-number" disabled="disabled" type="number" placeholder="№" value="<?php 
        echo $id;
        ?>
">
                                    <span class="help-block">Номер</span>
                                </div>
                            </div>
                            <div class="col-lg-11">
                                <div class="form-group">
                                    <label for="gallery-edit-name">Наименование</label>
                                    <input class="form-control input-sm" id="gallery-edit-name" name="gallery-edit-name" type="text" placeholder="Наименование" value="<?php 
        echo $name;
        ?>
">
                                    <span class="help-block">Название галереи</span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="gallery-edit-description">Описание</label>
                            <textarea class="form-control input-sm" id="gallery-edit-description" name="gallery-edit-description" placeholder="Описание" style="width: 100%; height: 100px;"><?php 
        echo $description;
        ?>
</textarea>
                            <span class="help-block">Служебная информация, к заполнению не обязательна.</span>
                        </div>
                    </div>

                    <?php 
        if (!empty($aGalleryItems)) {
            ?>
                    <div class="col-sm-6">
                        <h4>Режим галереи с прокруткой</h4>
                        <div class="galleria">
                            <?php 
            foreach ($aGalleryItems as $oGalleryItem) {
                ?>
                                <a href="<?php 
                echo $oGalleryItem->path;
                ?>
">
                                    <img src="<?php 
                echo $oGalleryItem->path;
                ?>
" data-big="<?php 
                echo $oGalleryItem->path;
                ?>
" data-title="<?php 
                echo $oGalleryItem->name;
                ?>
" data-description="<?php 
                echo $oGalleryItem->description;
                ?>
" />
                                </a>
                            <?php 
            }
            ?>
                        </div>
                    </div>
                    <?php 
        }
        ?>
                </div>
                <?php 
        if (!empty($aGalleryItems)) {
            ?>
                <hr/>
                <div class="row">
                    <h4 class="text-center">Режим галереи с плитками</h4>

                    <div class="col-xs-12">
                        <div class="container">
                            <div class="row eq-height">
                                <?php 
            foreach ($aGalleryItems as $oGalleryItem) {
                ?>
                                    <div class="col-md-3 col-sm-4 col-xs-6 thumb">
                                        <a class="fancyimage" rel="group" href="<?php 
                echo $oGalleryItem->path;
                ?>
">
                                            <img class="img-responsive" src="<?php 
                echo $oGalleryItem->path;
                ?>
" />
                                        </a>
                                    </div>
                                <?php 
            }
            ?>
                            </div>
                        </div>
                    </div>
                </div>
                <?php 
        }
        ?>

                <hr/>
                <a href="<?php 
        echo $this->backUrl;
        ?>
" class="btn btn-warning">Отмена</a>
                <button id="gallery-edit-save" name="gallery-edit-save" type="submit" class="btn btn-primary">Сохранить</button>
                <button id="gallery-edit-accept" name="gallery-edit-accept" type="submit" class="btn btn-success">Применить</button>
            </fieldset>
        </form>
        <?php 
    }
Exemplo n.º 2
0
    public function currentRender()
    {
        $aGalleryItems = $this->oGallery->getGalleryItems('position');
        ?>
        <div class="container">
            <h4><?php 
        echo $this->oStructure->name;
        ?>
</h4>
            <hr/>

            <?php 
        if ($this->displayType == Gallery::DISPLAY_TYPE_FANCY) {
            ?>
            <div class="row eq-height">
                <?php 
            foreach ($aGalleryItems as $oGalleryItem) {
                ?>
                    <div class="col-md-3 col-sm-3 col-xs-4">
                        <a class="fancyimage thumbnail" rel="group" href="<?php 
                echo $oGalleryItem->path;
                ?>
">
                            <img class="img-responsive" src="<?php 
                echo $oGalleryItem->getPathToThumbnail();
                ?>
" />
                        </a>
                    </div>
                <?php 
            }
            ?>
            </div>
            <?php 
        }
        ?>

            <?php 
        if ($this->displayType == Gallery::DISPLAY_TYPE_GALLERIA) {
            ?>
                <blockquote>
                    <p>Для перехода в полноэкранный режим сделайте двойное нажатие по галерее.</p>
                </blockquote>
                <div class="galleria">
                    <?php 
            foreach ($aGalleryItems as $oGalleryItem) {
                ?>
                        <a href="<?php 
                echo $oGalleryItem->path;
                ?>
">
                            <img src="<?php 
                echo $oGalleryItem->getPathToThumbnail();
                ?>
" data-big="<?php 
                echo $oGalleryItem->path;
                ?>
" data-title="<?php 
                echo $oGalleryItem->name;
                ?>
" data-description="<?php 
                echo $oGalleryItem->description;
                ?>
" />
                        </a>
                    <?php 
            }
            ?>
                </div>
            <?php 
        }
        ?>
        </div>
        <?php 
    }