require_once 'BIFE/Widget.php';
// ~X2C
+require_once 'Image/Transform.php';
+
// +X2C Class 20 :Album
/**
* Photo album widget. [TODO: Make a better explanation]
'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']);
$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
} // -X2C Class :Album
-?>
+?>
\ No newline at end of file