Output code to explicitly reference favicons.

This makes favicons work when Laconica is not installed at a web
server's DOCUMENT_ROOT. I've also added the capability to override the
Laconica default favicon.ico file with a theme-specific one simply by
dropping a themed favicon.ico in the appropriate theme directory.
This commit is contained in:
Meitar Moscovitz 2009-03-16 17:42:24 -04:00
parent 227514d525
commit 85d61475aa

View File

@ -112,6 +112,7 @@ class Action extends HTMLOutputter // lawsuit
// XXX: attributes (profile?) // XXX: attributes (profile?)
$this->elementStart('head'); $this->elementStart('head');
$this->showTitle(); $this->showTitle();
$this->showShortcutIcon();
$this->showStylesheets(); $this->showStylesheets();
$this->showScripts(); $this->showScripts();
$this->showOpenSearch(); $this->showOpenSearch();
@ -147,6 +148,22 @@ class Action extends HTMLOutputter // lawsuit
return _("Untitled page"); return _("Untitled page");
} }
/**
* Show themed shortcut icon
*
* @return nothing
*/
function showShortcutIcon()
{
if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/favicon.ico')) {
$this->element('link', array('rel' => 'shortcut icon',
'href' => theme_path('favicon.ico')));
} else {
$this->element('link', array('rel' => 'shortcut icon',
'href' => common_path('favicon.ico')));
}
}
/** /**
* Show stylesheets * Show stylesheets
* *