- <?php
- /*
- * Lokorin.com
- * Copyright 2004-2006
- * Licensed under the GNU LGPL. See COPYING for full terms.
- */
- /**
- * A project module that displays all images connected to a project.
- * @author Andreas Launila
- * @version $Revision: 1.9 $
- * @package com.lokorin.lokorin.modules
- * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
- */
-
- /**
- * For access to common constants and functions.
- */
- require_once('common.php');
- doInclude('lib_images');
- doInclude('lib_projects');
- CssHandler::getInstance()->includeCss('gallery');
-
- /**
- * The maximum width, in pixels, that the images displayed in the gallery
- * should be allowed to have. Any images that have a larger width will be
- * resized to this width.
- * @var integer
- * @access private
- */
- define('GALLERY_THUMB_WIDTH', 280);
- /**
- * The maximum size, in kilobytes, that the images displayed in the gallery
- * should be allowed to be. Any images larger than these get their quality
- * reduced so they meet this condition.
- * @var integer
- * @access private
- */
- define('GALLERY_THUMB_SIZE', 15);
-
- try {
- $project = getProjectBasedOnDir();
- Page::getInstance()->setProject($project);
- } catch(Exception $e) {
- logFatalException($e);
- }
-
- Page::getInstance()->setTitle('Images');
-
- $images = $project->getImages();
-
- //Construct the output.
- $left = true;
- foreach($images as $imageName => $description) {
- if($left == true) {
- echo '<div class="galleryRow"><div class="galleryLeft">';
- } else {
- echo '<div class="galleryRight">';
- }
- echo getImage($imageName, $description,
- GALLERY_THUMB_WIDTH, GALLERY_THUMB_SIZE, GALLERY_THUMB_WIDTH,
- GALLERY_THUMB_SIZE);
- echo '<p>'.$description.'</p></div>'."\n";
- if($left == false) {
- echo '</div>';
- }
- $left = !$left;
- }
- if($left == false) {
- echo '</div>';
- }
-
- Page::getInstance()->display();
- ?>