diff options
| author | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:49 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-10-12 15:13:49 +0000 |
| commit | cde7bd31e2ce90c2d16ca0b87f16b9d34f0a4bc9 (patch) | |
| tree | b00f9213fbf06b688363fae8727b4262cfa01311 /image_order.php | |
| parent | d4db512a3f25bde21350ac2ee6c18b978ce662da (diff) | |
| download | fisheye-cde7bd31e2ce90c2d16ca0b87f16b9d34f0a4bc9.tar.gz fisheye-cde7bd31e2ce90c2d16ca0b87f16b9d34f0a4bc9.tar.bz2 fisheye-cde7bd31e2ce90c2d16ca0b87f16b9d34f0a4bc9.zip | |
merge recent changes to HEAD
Diffstat (limited to 'image_order.php')
| -rw-r--r-- | image_order.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/image_order.php b/image_order.php index 854d777..f23ceeb 100644 --- a/image_order.php +++ b/image_order.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_fisheye/image_order.php,v 1.6 2005/08/30 22:17:54 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_fisheye/image_order.php,v 1.7 2005/10/12 15:13:49 spiderr Exp $ * @package fisheye * @subpackage functions */ @@ -33,8 +33,11 @@ if (!empty($_REQUEST['cancel'])) { die; } elseif (!empty($_REQUEST['updateImageOrder'])) { if( !empty( $_REQUEST['batch'] ) ) { - // flip so we can do instant has lookup + // flip so we can do instant hash lookup $batchCon = array_flip( $_REQUEST['batch'] ); + // increment the first element from 0 to 1 so any conditional tests will pass, particularly in the .tpl + $batchCon[key($batchCon)]++; + $gBitSmarty->assign_by_ref( 'batchEdit', $batchCon ); } if( !empty( $_REQUEST['reorder_gallery'] ) && $gContent->loadImages() ) { @@ -54,6 +57,11 @@ if (!empty($_REQUEST['cancel'])) { $reorder[$gContent->mItems[$imageId]->mContentId] = $gContent->mItems[$imageId]->mInfo['image_file']['filename']; } break; + case 'random': + foreach( array_keys( $gContent->mItems ) as $imageId ) { + $reorder[$gContent->mItems[$imageId]->mContentId] = rand( 0, 9999999 ); + } + break; } asort( $reorder ); $sortPos = 100; @@ -73,6 +81,15 @@ if (!empty($_REQUEST['cancel'])) { $galleryItem->expunge(); $galleryItem = NULL; break; + case 'remove': + $parents = $galleryItem->getParentGalleries(); + if( $galleryItem->isContentType( FISHEYEGALLERY_CONTENT_TYPE_GUID ) || count( $parents ) > 1 ) { + $gContent->removeItem( $contentId ); + } else { + $galleryItem->expunge(); + } + $galleryItem = NULL; + break; case 'rotate': $galleryItem->rotateImage( $batchParam ); $feedback['success'] = tra( "Images rotated" ); @@ -111,7 +128,7 @@ if (!empty($_REQUEST['cancel'])) { if( !empty( $_REQUEST['batch_security_id'] ) ) { } // if we are reordered, that takes precident - $newPos = (!empty( $newOrder[$contentId] ) ? $newOrder[$contentId] : $newPos); + $newPos = preg_replace( '/[\D]/', '', (!empty( $newOrder[$contentId] ) ? $newOrder[$contentId] : $newPos) ); if ($galleryItem->mInfo['title'] != $_REQUEST['imageTitle'][$contentId]) { $storageHash = array('title' => $_REQUEST['imageTitle'][$contentId]); } @@ -131,7 +148,7 @@ if (!empty($_REQUEST['cancel'])) { } // Get a list of all existing galleries -$listHash = array( 'user_id'=>$gBitUser->mUserId, 'max_records'=>-1, 'sort_mode'=>'title_asc' ); +$listHash = array( 'user_id'=>$gBitUser->mUserId, 'max_records'=>-1, 'no_thumbnails' => TRUE, 'sort_mode'=>'title_asc' ); $galleryList = $gContent->getList( $listHash ); $gBitSmarty->assign_by_ref('galleryList', $galleryList); $gContent->loadImages(); |
