Permalink
Browse files

Close #78

Favicon einfach konfigurierbar (ohne groß klimbim mit Themes und URLs
und bla, entweder es ist da und wird als URL verwendet, oder es ist
nicht da und dann wird das Favicon vom Theme verwendet)
  • Loading branch information...
1 parent 489ca59 commit a3636e4f331ae51d135c287d9b30823a70fdc226 Markus Pinkert committed Mar 19, 2013
View
1 etc/ffc.json.example
@@ -11,6 +11,7 @@
"sessiontimeout":3600,
"theme":"default",
"debug":0,
+ "favicon":"http://www.favicons.org/favicon.png",
"acttitles":{
"forum":"Forenboard",
"notes":"Notizen",
View
2 lib/Ffc/Data.pm
@@ -25,6 +25,7 @@ our $Themedir = '/themes/';
our $Themebasedir = File::Basename::dirname(__FILE__).'/../../public'.$Themedir;
our $DbTemplate = File::Basename::dirname(__FILE__).'/../../t/var/database.sql';
our $DbTestdata = File::Basename::dirname(__FILE__).'/../../t/var/testdata.sql';
+our $Favicon;
{
my $dbh;
my $config;
@@ -50,6 +51,7 @@ our $DbTestdata = File::Basename::dirname(__FILE__).'/../../t/var/testdata.sql';
$SessionTimeout = $config->{sessiontimeout};
$Theme = $config->{theme};
$Debug = $config->{debug};
+ $Favicon = $config->{favicon} if $config->{favicon};
{
opendir my $dh, $Themebasedir or die qq(could not open theme directory $Themebasedir: $!);
while ( my $d = readdir $dh ) {
View
3 t/02_backend_data.t
@@ -10,7 +10,7 @@ use Data::Dumper;
use Mojolicious;
use Mock::Config;
-use Test::More tests => 33;
+use Test::More tests => 34;
srand;
@@ -67,6 +67,7 @@ ok( Ffc::Data::set_config($app), 'config set returned true' );
sessiontimeout => 'SessionTimeout',
debug => 'Debug',
theme => 'Theme',
+ favicon => 'Favicon',
);
while ( my ( $k, $v ) = each %order ) {
no strict 'refs';
View
1 t/lib/Mock/Config.pm
@@ -29,6 +29,7 @@ sub new {
. '_',
"cryptsalt" => int( rand 100000 ),
"postlimit" => int( rand 30 ),
+ "favicon" => r(),
"title" => r(),
"pagelinkpreview" => int( rand 15 ),
"sessiontimeout" => int( rand 10000 ),
View
2 templates/layouts/default.html.ep
@@ -3,7 +3,7 @@
<head>
<title><%= $Ffc::Data::Title %> - <%= acttitle() %></title>
<%= stylesheet $Ffc::Data::Themedir.session()->{theme}.'/css/style.css' %>
- <link rel="icon" type="image/ico" href="<%= url_for $Ffc::Data::Themedir.session()->{theme}.'/img/favicon.png' %>" />
+ <link rel="icon" type="image/ico" href="<%= $Ffc::Data::Favicon || url_for $Ffc::Data::Themedir.session()->{theme}.'/img/favicon.png' %>" />
</head>
<body>
% if ( session()->{user} ) {
View
2 templates/layouts/login.html.ep
@@ -3,7 +3,7 @@
<head>
<title><%= $Ffc::Data::Title %> - <%= acttitle() %></title>
<%= stylesheet $Ffc::Data::Themedir.$Ffc::Data::Theme.'/css/style.css' %>
- <link rel="icon" type="image/ico" href="<%= url_for $Ffc::Data::Themedir.$Ffc::Data::Theme.'/img/favicon.png' %>" />
+ <link rel="icon" type="image/ico" href="<%= $Ffc::Data::Favicon || url_for $Ffc::Data::Themedir.$Ffc::Data::Theme.'/img/favicon.png' %>" />
</head>
<body>
%= include 'parts/error'

0 comments on commit a3636e4

Please sign in to comment.