diff --git a/includes/template.class.php b/includes/template.class.php new file mode 100644 index 0000000..d68fc26 --- /dev/null +++ b/includes/template.class.php @@ -0,0 +1,63 @@ + + * + * @version $Id$ + * + * Copyright (c) 2009 Jan Dittberner + * Jan Dittberner IT-Consulting & -Solutions + * Cottbuser Str. 1, D-01129 Dresden + * + * This file is part of the ScrollingJQueryGallery component of the + * gnuviech-server.de Websitetools + * + * ScrollingJQueryGallery is free software: you can redistribute it + * and/or modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * ScrollingJQueryGallery is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ScrollingJQueryGallery. If not, see + * . + */ + +/** + * This class provides a simple template mechanism. It was inspired by + * http://mylittlehomepage.net/ueber-den-sinn-von-php-template-engines + * (german). + */ +class Template { + /** + * associative array containing the template content. + * @var array + */ + var $content; + + /** + * Assign a value to the template. + * @param string $name variable name + * @param mixed $value variable value + */ + function assign($name, $value) { + $this->content[$name] = $value; + } + + /** + * Display the given template file. + * @param string $template template file name + */ + function display($template) { + if($this->content) { + $content = $this->content; + } + include($template); + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php index 36b4671..23f6c27 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ * @author Jan Dittberner , Jeremias Arnstadt * * - * @version \$Id$ + * @version $Id$ * * Copyright (c) 2008, 2009 Jan Dittberner * Jan Dittberner IT-Consulting & -Solutions @@ -35,7 +35,7 @@ /** * Inkludiert die Funktionsbibliothek. */ -require 'includes/galleryfunctions.php'; +require('includes/galleryfunctions.php'); /** * Name der aktuellen Galerie. @@ -47,25 +47,20 @@ $gallery = getCurrentGallery(); */ $thumbinfo = getThumbNailInfo($gallery); -?> - - - - -<?php print getGalleryTitle($thumbinfo); ?> - - - - - - - - - - - -
-
- -
-
-
nach links
-
%s
', - $thumbdata['src'], $thumbdata['alt'], $thumbdata['sizes']); - } - ?>
-
nach rechts
-
-
-
-
-
' . - '%s', - $data['title'], $data['full'], $data['src'], $data['alt'], - $data['sizes']); - ?>
-
-
- backnext -
-
-
-
- - - - \ No newline at end of file +EOD; + +$template->assign('scripts', $scripts); +$template->assign('styles', $styles); +$template->assign('inlinestyle', $inlinestyles); +$template->assign('title', getGalleryTitle($thumbinfo)); +$template->assign('gallerylinks', getGalleryLinks()); +$template->assign('thumbnails', getAllThumbnails($thumbinfo)); +$template->assign('firstpreview', getFirstPreview($thumbinfo)); +$template->assign('firstdescription', getFirstDescription($thumbinfo)); +$template->assign('lang', 'de'); +$template->assign('themepath', 'themes/default_horizontal'); + +$template->display('themes/default_horizontal/theme.php'); + +?> \ No newline at end of file diff --git a/css/format.css b/themes/default_horizontal/css/format.css similarity index 100% rename from css/format.css rename to themes/default_horizontal/css/format.css diff --git a/css/main.css b/themes/default_horizontal/css/main.css similarity index 100% rename from css/main.css rename to themes/default_horizontal/css/main.css diff --git a/themes/default_horizontal/theme.php b/themes/default_horizontal/theme.php new file mode 100644 index 0000000..7b5dd95 --- /dev/null +++ b/themes/default_horizontal/theme.php @@ -0,0 +1,60 @@ + + + + +<?php echo $content['title']; ?> + + + + + + + + + + + +
+
+ +
+
+
nach links
+
<?php echo $thumbdata['alt']; ?> />
+
nach rechts
+
+
+
+
+
' . + '%s', + $data['title'], $data['full'], $data['src'], $data['alt'], + $data['sizes']); + ?>
+
+
+ backnext +
+
+
+
+
+ + \ No newline at end of file