diff options
author | Kate Arzamastseva <pshns@ukr.net> | 2011-07-19 18:32:21 +0300 |
---|---|---|
committer | Kate Arzamastseva <pshns@ukr.net> | 2011-07-19 18:32:21 +0300 |
commit | 6316bc7147a7ef1e90e2040d46bd40d034a09f13 (patch) | |
tree | b82e3f89151523b7128252c7d18f96d9b843aaea /inc | |
parent | 80291f9e4256d8bd01f0b0a0589aab2ea402ab64 (diff) | |
download | rpg-6316bc7147a7ef1e90e2040d46bd40d034a09f13.tar.gz rpg-6316bc7147a7ef1e90e2040d46bd40d034a09f13.tar.bz2 |
mediamanager list view thumbnails
Diffstat (limited to 'inc')
-rw-r--r-- | inc/media.php | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/inc/media.php b/inc/media.php index 76d25acd6..43a3a07ca 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1361,35 +1361,43 @@ function media_printfile_thumbs($item,$auth,$jump=false){ */ function media_printimgdetail($item, $fullscreen=false){ // prepare thumbnail - if (!$fullscreen) $size = 120; - else $size = 90; - $w = (int) $item['meta']->getField('File.Width'); - $h = (int) $item['meta']->getField('File.Height'); - if($w>$size || $h>$size){ + if (!$fullscreen) { + $size_array[] = 120; + } else { + $size_array = array(90, 40); + } + foreach ($size_array as $index => $size) { + $w = (int) $item['meta']->getField('File.Width'); + $h = (int) $item['meta']->getField('File.Height'); + if($w>$size || $h>$size){ + if (!$fullscreen) { + $ratio = $item['meta']->getResizeRatio($size); + } else { + $ratio = $item['meta']->getResizeRatio($size,$size); + } + $w = floor($w * $ratio); + $h = floor($h * $ratio); + } + $src = ml($item['id'],array('w'=>$w,'h'=>$h,'t'=>$item['mtime'])); + $p = array(); if (!$fullscreen) { - $ratio = $item['meta']->getResizeRatio($size); - } else { - $ratio = $item['meta']->getResizeRatio($size,$size); + $p['width'] = $w; + $p['height'] = $h; + } + $p['alt'] = $item['id']; + $p['class'] = 'thumb'; + $att = buildAttributes($p); + + // output + if ($fullscreen) { + echo '<a name="d_:'.$item['id'].'" class="image'.$index.'" title="'.$item['id'].'" href="'. + media_managerURL(array('image' => hsc($item['id']))).'">'; + echo '<div><img src="'.$src.'" '.$att.' /></div>'; + echo '</a>'; } - $w = floor($w * $ratio); - $h = floor($h * $ratio); } - $src = ml($item['id'],array('w'=>$w,'h'=>$h,'t'=>$item['mtime'])); - $p = array(); - $p['width'] = $w; - if (!$fullscreen) $p['height'] = $h; - $p['alt'] = $item['id']; - $p['class'] = 'thumb'; - $att = buildAttributes($p); - // output - if ($fullscreen) { - echo '<a name="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'. - media_managerURL(array('image' => hsc($item['id']))).'">'; - echo '<div><img src="'.$src.'" '.$att.' /></div>'; - echo '</a>'; - return 1; - } + if ($fullscreen) return ''; echo '<div class="detail">'; echo '<div class="thumb">'; |