Adding icons.
This commit is contained in:
parent
36edb4d00a
commit
dd8c91cb44
6 changed files with 68 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ sub definition {
|
|||
|
||||
push @{ $definition }, {
|
||||
assetName => $i18n->get('assetName'),
|
||||
icon => 'newWobject.gif',
|
||||
icon => 'newsletter_collection.gif',
|
||||
autoGenerateForms => 1,
|
||||
tableName => 'NewsletterCollection',
|
||||
className => 'WebGUI::Asset::Wobject::NewsletterCollection',
|
||||
|
|
|
|||
67
sbin/install_icons.pl
Normal file
67
sbin/install_icons.pl
Normal 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.";
|
||||
BIN
www/extras/adminConsole/newsletter.gif
Normal file
BIN
www/extras/adminConsole/newsletter.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 456 B |
BIN
www/extras/adminConsole/small/newsletter.gif
Normal file
BIN
www/extras/adminConsole/small/newsletter.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 218 B |
BIN
www/extras/assets/newsletter_collection.gif
Normal file
BIN
www/extras/assets/newsletter_collection.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 456 B |
BIN
www/extras/assets/small/newsletter_collection.gif
Normal file
BIN
www/extras/assets/small/newsletter_collection.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 218 B |
Loading…
Add table
Add a link
Reference in a new issue