From dd8c91cb449f78e8d47073c60f134750194b478e Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Thu, 21 Oct 2010 13:51:34 +0200 Subject: [PATCH] Adding icons. --- .../Asset/Wobject/NewsletterCollection.pm | 2 +- sbin/install_icons.pl | 67 ++++++++++++++++++ www/extras/adminConsole/newsletter.gif | Bin 0 -> 456 bytes www/extras/adminConsole/small/newsletter.gif | Bin 0 -> 218 bytes www/extras/assets/newsletter_collection.gif | Bin 0 -> 456 bytes .../assets/small/newsletter_collection.gif | Bin 0 -> 218 bytes 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 sbin/install_icons.pl create mode 100644 www/extras/adminConsole/newsletter.gif create mode 100644 www/extras/adminConsole/small/newsletter.gif create mode 100644 www/extras/assets/newsletter_collection.gif create mode 100644 www/extras/assets/small/newsletter_collection.gif diff --git a/lib/WebGUI/Asset/Wobject/NewsletterCollection.pm b/lib/WebGUI/Asset/Wobject/NewsletterCollection.pm index 85a42d1..d35d745 100644 --- a/lib/WebGUI/Asset/Wobject/NewsletterCollection.pm +++ b/lib/WebGUI/Asset/Wobject/NewsletterCollection.pm @@ -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', diff --git a/sbin/install_icons.pl b/sbin/install_icons.pl new file mode 100644 index 0000000..88e623a --- /dev/null +++ b/sbin/install_icons.pl @@ -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."; diff --git a/www/extras/adminConsole/newsletter.gif b/www/extras/adminConsole/newsletter.gif new file mode 100644 index 0000000000000000000000000000000000000000..869f8628e45f9f594f73e4068ee508478aa6fc8c GIT binary patch literal 456 zcmV;(0XP0fNk%w1VK4wN0K^{vA0Pzz`RYPM3FGCrZgLOB%0}4Shoh%8Z*eTt*mm*r z)0UeRmYOG~tQzCxr^3fT$<9>W-g>GF(`t>86M%#n&Cy-q&DQJQ`#%5g;mwKoEu#cmz1*($(|;7Mg)VI#pFY;6^9XU46qHL)qJLf~^3=qq07o z-;>UxZn}d71Q!twTy=hL05}SKB8OmCSzCOLZyp>S36pJ=oL~!>nr@wlaRobNl$=l- zYpIn0ffg>ygn^znZ3K9z!k8uyDU8+Fopu|9j1(jC4D}ta}!Gj4q zutL?rf({Y}5x!AKkwF1>A2Jj;03h6x1qT#GNLqr!0SW~;Oj^N_i)9CwCt!Avd8=j+ ym4!&?I9 zNH+e>o<*&K0|q65BFDqDKo~Kj#}aV_ZloF2a%eO%3R4I22ow^V;zWU=L^`-ec+goq UG%=Vclej>AA_4#nfH)xlJMyPhH2?qr literal 0 HcmV?d00001 diff --git a/www/extras/assets/newsletter_collection.gif b/www/extras/assets/newsletter_collection.gif new file mode 100644 index 0000000000000000000000000000000000000000..869f8628e45f9f594f73e4068ee508478aa6fc8c GIT binary patch literal 456 zcmV;(0XP0fNk%w1VK4wN0K^{vA0Pzz`RYPM3FGCrZgLOB%0}4Shoh%8Z*eTt*mm*r z)0UeRmYOG~tQzCxr^3fT$<9>W-g>GF(`t>86M%#n&Cy-q&DQJQ`#%5g;mwKoEu#cmz1*($(|;7Mg)VI#pFY;6^9XU46qHL)qJLf~^3=qq07o z-;>UxZn}d71Q!twTy=hL05}SKB8OmCSzCOLZyp>S36pJ=oL~!>nr@wlaRobNl$=l- zYpIn0ffg>ygn^znZ3K9z!k8uyDU8+Fopu|9j1(jC4D}ta}!Gj4q zutL?rf({Y}5x!AKkwF1>A2Jj;03h6x1qT#GNLqr!0SW~;Oj^N_i)9CwCt!Avd8=j+ ym4!&?I9 zNH+e>o<*&K0|q65BFDqDKo~Kj#}aV_ZloF2a%eO%3R4I22ow^V;zWU=L^`-ec+goq UG%=Vclej>AA_4#nfH)xlJMyPhH2?qr literal 0 HcmV?d00001