From b32afd1331ee881dedf4ed0467b468248ebba16b Mon Sep 17 00:00:00 2001 From: Stephan Bergemann Date: Thu, 14 Jun 2012 12:39:18 +0200 Subject: [PATCH] we don't have empty previewstacks any more - code cleaned up --- apps/gallery/lib/tiles.php | 35 ++++++++++------------------------- 1 file 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 = ''; - if(count($this->tiles_array) == 0) { - // aint no pictures in this folder... - $r.=''; - } 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 .= ''; + 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 .= ''; } 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;'; } -- 2.39.5