]> mj.ucw.cz Git - gallery.git/commitdiff
Gallery2: Configuration and a test gallery
authorMartin Mares <mj@ucw.cz>
Wed, 26 Dec 2012 13:07:58 +0000 (14:07 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Feb 2015 20:14:09 +0000 (21:14 +0100)
gal2/Makefile
gal2/UCW/Gallery.pm

index 52f2f042d4fe191280ec5f2e38965aec9e05ed63..88b61de44c63ac4b48158d8a14c88dde1f277a6d 100644 (file)
@@ -2,4 +2,5 @@ $(eval $(dir-setup))
 
 $(call lib-copy, UCW/Gallery.pm UCW/Gallery/Web.pm)
 
-$(call copy, $(addprefix nrt-blue/,back.png bot.png left.png next.png prev.png right.png top.png theme.pm style.css))
+$(call copy, $(addprefix nrt-blue/,back.png bot.png left.png next.png prev.png right.png top.png style.css))
+$(call lib-copy, nrt-blue/theme.pm)
index f0a1e97ccb01cd11f69f94793d4cf481ab6d084a..f97ddd8bc4332e9bb3fafc1848471291c417a1cd 100644 (file)
@@ -21,31 +21,34 @@ BEGIN {
 
 our %CF;
 
-BEGIN {
-       # FIXME: Check config
-       $CF{'Title'} = 'An Unnamed Gallery',
-       $CF{'HeadExtras'} = "",
-       $CF{'TopExtras'} = "",
-       $CF{'BotExtras'} = "",
-       $CF{'ParentURL'} = '../',
-       $CF{'BackURL'} = "",
-       $CF{'FwdURL'} = "",
-       $CF{'ImageSubpages'} = 1,
-       $CF{'AllowArchives'} = 1,
-       $CF{'PhotoUrlPrefix'} = "",
-       $CF{'ThumbUrlPrefix'} = "",
-       $CF{'MetaDataDir'} = '.',
-       $CF{'PhotoDir'} = '.',
-       # FIXME: Who sets GalDir?
-
-       $CF{'ScanDefaultTransform'} = 's';
-       $CF{'OrigDir'} = '.';
-       $CF{'PhotoDir'} = 'photo';
-       $CF{'CacheDir'} = 'cache',
-       $CF{'PhotoMaxWidth'} = 1024,
-       $CF{'PhotoMaxHeight'} = 1024,
-       $CF{'ThumbFormats'} = {},
-}
+BEGIN { %CF = (
+       # Directories
+       OrigDir => '.',                 # Original images
+       PhotoDir => 'photo',            # Scaled-down photos for web
+       CacheDir => 'cache',            # Cache with meta-data and thumbnails
+       ThemeDir => 'gal',              # Themes
+
+       # URL prefixes
+       PhotoUrlPrefix => 'photo/',
+       ThumbUrlPrefix => 'thumb/',
+       ThemeUrlPrefix => 'gal/',
+
+       # Processing machinery settings
+       ScanDefaultTransform => 's',
+       PhotoMaxWidth => 1024,
+       PhotoMaxHeight => 1024,
+       ThumbFormats => {},             # Set up by themes
+
+       # HTML output settings
+       Title => 'An Unnamed Gallery',
+       HeadExtras => "",
+       TopExtras => "",
+       BotExtras => "",
+       ParentURL => '../',
+       BackURL => "",
+       FwdURL => "",
+       ImageSubpages => 1,
+); }
 
 sub LoadConfig() {
        my $cfg = "./gallery.cf";
@@ -65,8 +68,8 @@ sub SetOptions(@) {
                my $v = shift @_;
                $CF{$o} = $v;
                if ($o eq "Theme") {
-                       require $CF{"GalDir"} . "/$v/theme.pm";
-                       UCW::Gallery::Theme::Init($CF{"GalURL"} . "/$v");
+                       require $CF{'ThemeDir'} . "/$v/theme.pm";
+                       UCW::Gallery::Theme::Init($CF{'ThemeUrlPrefix'} . $v);
                }
        }
 }