summaryrefslogtreecommitdiffstats
path: root/apps/gallery
diff options
context:
space:
mode:
authorStephan Bergemann <st.bergemann@htw-berlin.de>2012-06-14 12:39:18 +0200
committerStephan Bergemann <st.bergemann@htw-berlin.de>2012-06-14 12:39:18 +0200
commitb32afd1331ee881dedf4ed0467b468248ebba16b (patch)
treec6b3a0cabb37c5626f8bdb6a0b4dab9cb405009f /apps/gallery
parent56d2e99239f0bd3221162d719a958494534c2080 (diff)
downloadnextcloud-server-b32afd1331ee881dedf4ed0467b468248ebba16b.tar.gz
nextcloud-server-b32afd1331ee881dedf4ed0467b468248ebba16b.zip
we don't have empty previewstacks any more - code cleaned up
Diffstat (limited to 'apps/gallery')
-rw-r--r--apps/gallery/lib/tiles.php35
1 files changed, 10 insertions, 25 deletions
diff --git a/apps/gallery/lib/tiles.php b/apps/gallery/lib/tiles.php
index 817939759d0..2ff4fa5647b 100644
--- a/apps/gallery/lib/tiles.php
+++ b/apps/gallery/lib/tiles.php
@@ -134,47 +134,32 @@ class TileStack extends TileBase {
public function getWidth() {
$max = 0;
- if(count($this->tiles_array) == 0) {
- $max = IMAGE_WIDTH;
- } else {
- for ($i = 0; $i < count($this->tiles_array); $i++) {
- $max = max($max, $this->tiles_array[$i]->getWidth());
- }
+ for ($i = 0; $i < count($this->tiles_array); $i++) {
+ $max = max($max, $this->tiles_array[$i]->getWidth());
}
return min(IMAGE_WIDTH, $max);
}
public function get() {
$r = '<div class="title gallery_div">'.$this->stack_name.'</div>';
- if(count($this->tiles_array) == 0) {
- // aint no pictures in this folder...
- $r.='<div class="miniature_border gallery_div"></div>';
- } else {
- for ($i = 0; $i < count($this->tiles_array); $i++) {
- $top = rand(-5, 5);
- $left = rand(-5, 5);
- $img_w = $this->tiles_array[$i]->getWidth();
- $extra = '';
- if ($img_w < IMAGE_WIDTH) {
- $extra = 'width:'.$img_w.'px;';
- }
- $r .= '<div class="miniature_border gallery_div" style="background-image:url(\''.$this->tiles_array[$i]->getMiniatureSrc().'\');margin-top:'.$top.'px; margin-left:'.$left.'px;'.$extra.'"></div>';
+ for ($i = 0; $i < count($this->tiles_array); $i++) {
+ $top = rand(-5, 5);
+ $left = rand(-5, 5);
+ $img_w = $this->tiles_array[$i]->getWidth();
+ $extra = '';
+ if ($img_w < IMAGE_WIDTH) {
+ $extra = 'width:'.$img_w.'px;';
}
+ $r .= '<div class="miniature_border gallery_div" style="background-image:url(\''.$this->tiles_array[$i]->getMiniatureSrc().'\');margin-top:'.$top.'px; margin-left:'.$left.'px;'.$extra.'"></div>';
}
return $r;
}
public function getOnHoverAction() {
- if(count($this->tiles_array) == 0) {
- return 'javascript:explode_empty(this);return false;';
- }
return 'javascript:explode(this);return false;';
}
public function getOnOutAction() {
- if(count($this->tiles_array) == 0) {
- return 'javascript:deplode_empty(this);return false;';
- }
return 'javascript:deplode(this);return false;';
}