commit 0062561d0196b758fbd5d2d32c57d670ddb71927
parent edd242b43c7518314fa15ac7f44394698908da01
Author: dankert <devnull@localhost>
Date: Wed, 3 Mar 2010 20:21:46 +0100
In den img-Tags die Bildgrößen erzeugen, das ganze in Definitionslisten schachteln, um CSS-Auszeichnungen zu vereinfachen.
Diffstat:
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/dynamicClasses/Album.class.php b/dynamicClasses/Album.class.php
@@ -1,9 +1,6 @@
<?php
-// ---------------------------------------------------------------------------
-// $Id$
-// ---------------------------------------------------------------------------
// OpenRat Content Management System
-// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de
+// Copyright (C) 2002-2010 Jan Dankert
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -18,13 +15,25 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ---------------------------------------------------------------------------
/**
* Erzeugt eine Bilder-Liste.
*
+ * Die Ordner-Id kann als Parameter "folderid" übergeben werden.
+ * Falls nicht, wird der aktuelle Ordner, in dem sich die Seite
+ * befindet, benutzt.
+ *
+ * Es wird eine Definitionsliste mit der CSS-Klasse "album" erzeugt, damit
+ * bequem eine Auszeichnung per CSS erfolgen kann.
+ *
+ * Beispiel:
+ * <dl class="album">
+ * <dt><img src="bild.jpg" width=".." .. /></dt>
+ * <dd>Beschreibung</dd>
+ * </dl>
+ *
* @author Jan Dankert
*/
class Album extends Dynamic
@@ -59,14 +68,23 @@ class Album extends Dynamic
$files = $f->getFiles();
+ $this->output('<dl class="album">');
+
foreach( $files as $fileid )
{
$file = new File($fileid);
$file->load();
- $img = '<img src="'.$this->pathToObject($fileid).'" alt="" />';
- $this->output($img.'<p>'.$file->desc.'</p><br/><br/>');
+ if ( $file->isImage() )
+ {
+ $file->getImageSize();
+ $img = '<img src="'.$this->pathToObject($fileid).'" alt="'.$file->name.'" width="'.$file->width.'" height="'.$file->height.'" />';
+ $this->output('<dt>'.$img.'</dt><dd>'.$file->desc.'</dd>');
+ }
+
}
+
+ $this->output('</dl>');
}
}