diff options
author | Meitar Moscovitz <meitarm@gmail.com> | 2009-03-16 17:42:24 -0400 |
---|---|---|
committer | Meitar Moscovitz <meitarm@gmail.com> | 2009-03-16 17:42:24 -0400 |
commit | 85d61475aab64a08ba67cdedfcb795af4ce4850d (patch) | |
tree | 799fcbde329c3c5dee865f59c3e8cd93bfbc7bb1 /lib/action.php | |
parent | 227514d52593968f7f4b02090aa9a4fc0b815010 (diff) |
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.
Diffstat (limited to 'lib/action.php')
-rw-r--r-- | lib/action.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/action.php b/lib/action.php index 975c2bfcb..285eae59a 100644 --- a/lib/action.php +++ b/lib/action.php @@ -112,6 +112,7 @@ class Action extends HTMLOutputter // lawsuit // XXX: attributes (profile?) $this->elementStart('head'); $this->showTitle(); + $this->showShortcutIcon(); $this->showStylesheets(); $this->showScripts(); $this->showOpenSearch(); @@ -148,6 +149,22 @@ class Action extends HTMLOutputter // lawsuit } /** + * 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 * * @return nothing |