X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=gal2%2FUCW%2FGallery.pm;h=f97ddd8bc4332e9bb3fafc1848471291c417a1cd;hb=af6a110cfa2e84b53328488f70e23a316bececfd;hp=f0a1e97ccb01cd11f69f94793d4cf481ab6d084a;hpb=3458be45556b066cd093f5c0696c1627808d71f6;p=gallery.git diff --git a/gal2/UCW/Gallery.pm b/gal2/UCW/Gallery.pm index f0a1e97..f97ddd8 100644 --- a/gal2/UCW/Gallery.pm +++ b/gal2/UCW/Gallery.pm @@ -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); } } }