setTitle('Browse Shots'); //$display->setHead(''); $display->setNavElement('shots'); $projName = $_SESSION['projectName']; try { $shotDefault = $shell->exec('hget attr shotDefault -name ' . $projName); } catch( Exception $e ) { $display->add($e->getMessage()); $display->printHtml(); exit; } if ( $shotDefault == '' ) { $shotDefault = 'inshow'; } // Build sequence filter pulldown $display->addNavSubElement(''); // Add shot filter box $display->addNavSubElement(''); $resCmd = "hget attr thumbResX,thumbResY -inherit -web -name " . $projName; try { $resString = $shell->exec( $resCmd ); $resArray = $shell->decode( $resString ); } catch (Exception $e) { $display->add($e->getMessage() . "
"); $display->printHtml(); exit; } $xres = $resArray[0]; $yres = $resArray[1]; $shotCmd = "hfind -type shot -r -web -maxdepth 1 -previews -return showPosition -start " . $projName; try { $shotResultString = $shell->exec( $shotCmd ); $shotList = $shell->decode( $shotResultString ); } catch (Exception $e) { $display->add($e->getMessage() . "
"); $display->printHtml(); exit; } /* for ( var i in shotList ) { var shot = shotList[i]; var newDiv = document.createElement('div'); dojo.attr( newDiv, "asset", shot.name ); var newImg = new Image( xRes, yRes ); newImg.src = shot.preview; var caption = document.createElement('span'); var basename = shot.name.substring(shot.name.lastIndexOf("/")+1); caption.innerHTML = basename; dojo.addClass( caption, "helgaCaption" ); newDiv.appendChild( newImg ); newDiv.appendChild( caption ); dojo.addClass( newDiv, "helgaThumbnail" ); this.displayNode.appendChild(newDiv); dojo.connect( newDiv, "onmouseover", function( event ) { dojo.addClass( this, "helgaThumbnailOver" ); }); dojo.connect( newDiv, "onmouseout", function( event ) { dojo.removeClass( this, "helgaThumbnailOver" ); }); dojo.connect( newDiv, "onclick", function( event ) { var assetName = dojo.attr( this, "asset" ); helga.layout.addTab( "ViewAsset", {asset:assetName} ); }); } */ // loop through all shot info, build thumbs view and list view divs $shotMax = count($shotList); if ( $shotMax > 0 ) { // display thumbnails of shots $sequenceColors = array('#E0E3E9', '#FFF8E4'); $thumbsView = ''; $thumbsView .= '
'; $shotCount = 0; for ( $i = 0; $i < $shotMax; $i++ ) { $shot = $shotList[$i]; $shotCount++; $nameSplit = explode( "/", $shot->name ); $baseName = $nameSplit[count($nameSplit)-1]; if ( $shot->preview == 'noweb' ) { $path = './images/no-preview.gif'; } else { $path = $shot->preview; } $thumbsView .= '
' . $baseName . '
'; } /* if ($user->can('admin')) { $thumbsView .= '

'; } */ $thumbsView .= '
'; $display->add($thumbsView); // $display->add(''); } else { $display->add('

Sorry, but there aren\'t any shots in this project yet.'); } $display->printHtml(); ?>