X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/884d958d4c76bed1625460b591c599094f7690c8..090eddcda4bf543db3463012f7a552a744364cd5:/src/BIFE/Album.php?ds=sidebyside diff --git a/src/BIFE/Album.php b/src/BIFE/Album.php index 1788ee8..1d9fa2b 100644 --- a/src/BIFE/Album.php +++ b/src/BIFE/Album.php @@ -30,6 +30,8 @@ require_once 'BIFE/Widget.php'; // ~X2C +require_once 'Image/Transform.php'; + // +X2C Class 20 :Album /** * Photo album widget. [TODO: Make a better explanation] @@ -83,6 +85,8 @@ class BIFE_Album extends BIFE_Widget { 'SELECTED' => '', 'MAXROWS' => 0, 'COLUMNS' => 4, + // TODO - agregar atributo para el LINK, ver de hacer el + // widget de un link. ); $this->attrs = array_merge($defaults, $attrs); $this->attrs['EXTENSIONS'] = explode(',', $this->attrs['EXTENSIONS']); @@ -161,21 +165,21 @@ Returns an array of associative arrays with this keys: $exts = $this->attrs['EXTENSIONS']; $format = $this->attrs['THUMBSFORMAT']; $return = array(); - $d = dir($root); - while (($file = $d->read()) !== false) { - list($path, $name, $ext) = $this->splitFilename("$root/$file"); - if (is_readable("$root/$file") and in_array($ext, $exts)) { - $thumb = $this->getThumbFilename("$root/$file"); - $return[] = array( - 'file' => "$root/$file", - 'desc' => $name, - 'thumb' => is_readable($thumb) ? $thumb : null, - ); - } + if ($d) { + while (($file = $d->read()) !== false) { + list($path, $name, $ext) = $this->splitFilename("$root/$file"); + if (is_readable("$root/$file") and in_array($ext, $exts)) { + $thumb = $this->getThumbFilename("$root/$file"); + $return[] = array( + 'file' => "$root/$name", + 'desc' => $name, + 'thumb' => is_readable($thumb) ? $thumb : null, + ); + } + } + $d->close(); } - $d->close(); - return $return; } // -X2C @@ -278,4 +282,4 @@ Returns an array of associative arrays with this keys: } // -X2C Class :Album -?> +?> \ No newline at end of file