favicon.module in Favicon 6
Same filename and directory in other branches
File
favicon.moduleView source
<?php
/**
* Implementation of hook_menu().
*/
function favicon_menu() {
// Override favicon.ico to forward to the theme's shortcut icon.
$items['favicon.ico'] = array(
'page callback' => 'favicon_shortcut_icon',
'access callback' => 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 {
$favicon = ltrim($favicon, '/');
drupal_goto($favicon);
}
}
Functions
Name | Description |
---|---|
favicon_menu | Implementation of hook_menu(). |
favicon_shortcut_icon | Menu callback; forwards to the favicon. |