Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ApacheGallery] Patch for substitute underscores with spaces



Hi,

I don't like spaces in file names and very often use underscores
instead of them. But with ApacheGallery in the directories list it
look very bad. Names of directories are overlapping...

So, I wrote a little patch that allow you to set Gallery_ToSpaces
option to 1 and underscores are automatically converted to spaces.

If you want and it is possible, include it in next version.

Have a nice day

-- 
 .''`. Ondra 'Kepi' Kudlik
: :' : Debian GNU/Linux User
`. `'
  `-   Web: http://kepi.shell42.com * Jabber: kepi@xxxxxxxxxxxxx
diff -uN Gallery.pm.orig Gallery.pm
--- Gallery.pm.orig	2004-04-13 00:50:28.000000000 +0200
+++ Gallery.pm	2004-04-13 00:49:20.000000000 +0200
@@ -289,9 +289,12 @@
 						$dirtitle = get_filecontent($thumbfilename . ".folder");
 					}
 
+					$dirtitle = $dirtitle ? $dirtitle : $file;
+					$dirtitle =~ s/_/ /g if $r->dir_config('Gallery_ToSpaces');
+
 					$tpl_vars{FILES} .= fill_in_file($tpl_vars{directory},
 						HASH=> {FILEURL => uri_escape($fileurl, $escape_rule),
-						FILE    => ($dirtitle ? $dirtitle : $file),
+						FILE    => $dirtitle,
 					});
 
 				}

Attachment: signature.asc
Description: Digital signature