Changeset 7767
- Timestamp:
- Nov 13, 2010, 10:49:53 PM (13 years ago)
- Location:
- extensions/PersoFavicon
- Files:
-
- 7 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PersoFavicon/main.inc.php
r7701 r7767 9 9 */ 10 10 11 define('PFI_DIR' , basename(dirname(__FILE__))); 12 define('PFI_PATH' , PHPWG_PLUGINS_PATH . PFI_DIR . '/'); 13 14 //Ajout du menu admin 15 add_event_handler('get_admin_plugin_menu_links', 'PersoFavicon_admin_menu'); 16 function PersoFavicon_admin_menu($menu) 17 { 18 array_push($menu, array( 19 'NAME' => 'PersoFavicon', 20 'URL' => get_admin_plugin_menu_link(PFI_PATH . 'admin/admin.php'))); 21 return $menu; 22 } 23 24 25 // Remplace le code dans le header 11 26 add_event_handler('loc_begin_page_header', 'Change_Favicon', 55 ); 12 13 27 14 28 function Change_Favicon() … … 21 35 { 22 36 $search = '#<link rel="shortcut icon".*?favicon.ico">#'; 37 38 global $conf; 23 39 40 $favicon_name = & $conf['PersoFavicon']; 41 42 if (!empty($favicon_name)) 43 { 44 $replacement = '<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}local/'.$favicon_name.'.ico">'; 45 } 46 else 47 { 24 48 $replacement = '<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}local/favicon.ico">'; 25 49 } 26 50 return preg_replace($search, $replacement, $content); 27 51 }
Note: See TracChangeset
for help on using the changeset viewer.