Adding icons.

This commit is contained in:
Martin Kamerbeek 2010-10-21 13:51:34 +02:00
parent 36edb4d00a
commit dd8c91cb44
6 changed files with 68 additions and 1 deletions

View file

@ -38,7 +38,7 @@ sub definition {
push @{ $definition }, { push @{ $definition }, {
assetName => $i18n->get('assetName'), assetName => $i18n->get('assetName'),
icon => 'newWobject.gif', icon => 'newsletter_collection.gif',
autoGenerateForms => 1, autoGenerateForms => 1,
tableName => 'NewsletterCollection', tableName => 'NewsletterCollection',
className => 'WebGUI::Asset::Wobject::NewsletterCollection', className => 'WebGUI::Asset::Wobject::NewsletterCollection',

67
sbin/install_icons.pl Normal file
View file

@ -0,0 +1,67 @@
use strict;
use warnings;
use 5.010;
use Getopt::Long;
my ( $customRoot, $webguiRoot );
GetOptions(
'customRoot=s' => \$customRoot,
'webguiRoot=s' => \$webguiRoot,
);
die 'No custom root, use --customRoot' unless $customRoot;
$webguiRoot ||= '/data/WebGUI';
for ( qw{ assets adminConsole } ) {
my $largeDest = "$webguiRoot/www/extras/$_";
my $smallDest = "$webguiRoot/www/extras/$_/small";
my $largeOrig = "$customRoot/www/extras/$_";
my $smallOrig = "$customRoot/www/extras/$_/small";
say "Proccesing $_ icons...";
die "Cannot find large icon directory $largeDest" unless -d $largeDest;
die "Cannot find small icon directory $smallDest" unless -d $smallDest;
my ( %large, %small );
opendir my $largeDir, "$largeOrig";
while ( my $file = readdir $largeDir ) {
next unless $file =~ m{ \.gif $ }xmsi;
say "\tFound large icon $file.";
$large{ $file } = 1;
};
closedir $largeDir;
opendir my $smallDir, "$smallOrig";
while ( my $file = readdir $smallDir ) {
next unless $file =~ m{ \.gif $ }xmsi;
say "\tFound small icon $file.";
$small{ $file } = 1;
};
closedir $smallDir;
foreach my $file ( keys %large ) {
if ( !exists $small{ $file } ) {
say "\tLarge icon $file has no small equivalent. Skipping.";
next;
}
print "\tInstalling large icon $file...";
symlink "$largeOrig/$file", "$largeDest/$file";
say -l "$largeDest/$file" ? "Ok" : "Failed";
print "\tInstalling small icon $file...";
symlink "$smallOrig/$file", "$smallDest/$file";
say -l "$smallDest/$file" ? "Ok" : "Failed";
}
}
say "Done.";

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B