]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/UCW/Gallery.pm
Gallery2: Debugging
[gallery.git] / gal2 / UCW / Gallery.pm
index f0a1e97ccb01cd11f69f94793d4cf481ab6d084a..f97ddd8bc4332e9bb3fafc1848471291c417a1cd 100644 (file)
@@ -21,31 +21,34 @@ BEGIN {
 
 our %CF;
 
 
 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";
 
 sub LoadConfig() {
        my $cfg = "./gallery.cf";
@@ -65,8 +68,8 @@ sub SetOptions(@) {
                my $v = shift @_;
                $CF{$o} = $v;
                if ($o eq "Theme") {
                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);
                }
        }
 }
                }
        }
 }