setTitle('View Folder'); $display->setNavElement('dev'); if ( isset( $_GET['folder'] ) ) { $folder = $_GET['folder']; } else { $folder = '/' . $_SESSION['projectName']; } $resCmd = "hget attr thumbResX,thumbResY -inherit -web -name /uprising"; 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]; $typeCmd = "::helga::assets::getTypeIdFromName shot"; try { $shotTypeId = $shell->exec( $typeCmd ); } catch (Exception $e) { $display->add($e->getMessage() . "
"); $display->printHtml(); exit; } $childCmd = "hfind -start " . $folder . " -web -previews -return typeId -sortattr position"; try { $childResultString = $shell->exec( $childCmd ); $childList = $shell->decode( $childResultString ); } catch (Exception $e) { $display->add($e->getMessage() . "
"); $display->printHtml(); exit; } $crumbs = '
'; $folderSplit = explode( '/', $folder ); $parent = '/'; foreach ( $folderSplit as $f ) { if ( !$f ) { continue; } if ( $crumbs != '
' ) { $crumbs .= '>'; } $crumbs .= '
' . $f . '
'; $parent .= $f; } $crumbs .= "

"; $display->add( $crumbs ); // loop through all child info, build thumbs view $numChildren = count($childList); if ( $numChildren > 0 ) { $thumbsView = '
'; for ( $i = 0; $i < $numChildren; $i++ ) { $child = $childList[$i]; $nameSplit = explode( "/", $child->name ); $baseName = $nameSplit[count($nameSplit)-1]; if ( $child->typeId == $shotTypeId ) { $href = 'viewLeaf.php?name='; if ( $child->preview == '' || $child->preview == 'noweb' ) { $path = './images/no-preview.gif'; } else { $path = $child->preview; } } else { $href = 'viewFolder.php?folder='; if ( $child->preview == '' || $child->preview == 'noweb' ) { $path = './images/folder.png'; } else { $path = $child->preview; } } $href .= $child->name; $thumbsView .= '
' . $baseName . '
'; } $thumbsView .= '
'; $display->add($thumbsView); } else { $display->add('No children found.'); } $display->printHtml(); ?>