Пример #1
0
 private function _get_folder_thumbnails($folders)
 {
     $thumbnails = array();
     foreach ($folders as $i => $folder) {
         $thumbnails[$i] = null;
         $qb = org_openpsa_slideshow_image_dba::new_query_builder();
         $qb->add_constraint('topic', '=', $folder->id);
         $qb->add_order('position');
         $qb->set_limit(1);
         $results = $qb->execute();
         if (sizeof($results) == 1) {
             $thumbnails[$i] = $results[0];
         }
     }
     return $thumbnails;
 }
Пример #2
0
 private function _process_delete()
 {
     $guids = explode('|', $_POST['guids']);
     if (empty($guids)) {
         return;
     }
     $qb = org_openpsa_slideshow_image_dba::new_query_builder();
     $qb->add_constraint('topic', '=', $this->_topic->id);
     $qb->add_constraint('guid', 'IN', $guids);
     $images = $qb->execute();
     foreach ($images as $image) {
         if (!$image->delete()) {
             throw new midcom_error('Failed to delete image: ' . midcom_connection::get_error_string());
         }
     }
 }