favicon.module in Favicon 5
Same filename and directory in other branches
File
favicon.moduleView source
<?php
/**
* Implementation of hook_menu().
*/
function favicon_menu($may_cache) {
$items = array();
if ($may_cache) {
// Override favicon.ico to forward to the theme's shortcut icon.
$items[] = array(
'path' => 'favicon.ico',
'callback' => 'favicon_shortcut_icon',
'access' => TRUE,
'type' => MENU_CALLBACK,
);
}
return $items;
}
/**
* Menu callback; forwards to the favicon.
*/
function favicon_shortcut_icon() {
init_theme();
$favicon = theme_get_setting('favicon', TRUE);
if (empty($favicon)) {
drupal_not_found();
}
else {
header('Location: ' . $favicon);
}
}
Functions
Name | Description |
---|---|
favicon_menu | Implementation of hook_menu(). |
favicon_shortcut_icon | Menu callback; forwards to the favicon. |