| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: admin.install,v 1.1.2.7 2009/07/22 06:11:13 yhahn Exp $ 3 4 /** 5 * Implementation of hook_install(). 6 */ 7 function admin_install() { 8 db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'admin', 'Admin', 'Admin links.'); 9 } 10 11 /** 12 * Implementation of hook_enable(). 13 */ 14 function admin_enable() { 15 $result = db_query("SELECT * FROM {menu_links} WHERE link_path LIKE 'admin%'"); 16 while ($item = db_fetch_array($result)) { 17 _menu_delete_item($item, TRUE); 18 } 19 menu_rebuild(); 20 21 // Weight admin to come after other modules -- in particular, admin_theme(). 22 db_query("UPDATE {system} SET weight = 1 WHERE name = 'admin' AND type = 'module'"); 23 } 24 25 /** 26 * Update 6001: Create admin menu. 27 */ 28 function admin_update_6001() { 29 $return = array(); 30 $return[] = update_sql("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('admin', 'Admin', 'Admin links.')"); 31 return $return; 32 } 33 34 /** 35 * Update 6002: Update theme namespace to 'slate' & clears out any customizations to key admin menu items. 36 */ 37 function admin_update_6002() { 38 db_query("DELETE FROM {system} WHERE name = 'admin' AND type = 'theme'"); 39 _admin_theme_rebuild(TRUE); 40 41 if (variable_get('admin_theme', NULL) == 'admin') { 42 variable_set('admin_theme', 'slate'); 43 } 44 45 $result = db_query("SELECT * FROM {menu_links} WHERE link_path LIKE 'admin%'"); 46 while ($item = db_fetch_array($result)) { 47 _menu_delete_item($item, TRUE); 48 } 49 menu_rebuild(); 50 51 return array(); 52 } 53 54 /** 55 * Update 6003: Weight admin module. 56 */ 57 function admin_update_6003() { 58 // Weight admin to come after other modules -- in particular, admin_theme(). 59 $return = array(); 60 $return[] = update_sql("UPDATE {system} SET weight = 1 WHERE name = 'admin' AND type = 'module'"); 61 return $return; 62 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |