public static function moveAndCreateImages($galleryID)
 {
     if (!self::isDirectoryEmpty(self::$imgpath)) {
         foreach (scandir(self::$imgpath) as $img) {
             if (!is_dir($img)) {
                 GalleryAddView::uploadImage($img, self::$imgpath . $img);
             }
         }
     }
     foreach (GalleryAddView::$createdImagesForGallery as $id) {
         $image = new Image($id);
         $image->GalleryID = $galleryID;
         $image->save();
     }
 }
예제 #2
0
 protected function printViewContent()
 {
     parent::printViewContent();
     $html = new HtmlPageSettings();
     $html->PageTitle = 'Pievienot vēl bildes galerijā';
     ?>
         <div class="__container">
             Bildes jau galerijā<br>
             <div id="image-orders" class="serialization">
                 <?php 
     $images = Image::find(new Equals('GalleryID', $this->getData('GalleryID')))->addSort('Order');
     foreach ($images as $image) {
         print '<div class="image-existing-container" iiid="' . $image->ImageID . '"><a href="" class="delete-image"><i class="fa fa-minus-circle"></i></a><img iiid="' . $image->ImageID . '" src="' . $image->getThumbnail() . ' "></div>';
     }
     ?>
             </div>
             <div class="__clear-floats"></div>
         </div>
     <?php 
 }