/[drupal]/contributions/modules/firebug/firebug.module
ViewVC logotype

Contents of /contributions/modules/firebug/firebug.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu Feb 8 11:12:10 2007 UTC (2 years, 9 months ago) by stevemckenzie
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/x-php
bringing firebug to drupal
1 <?php
2 // $Id:
3
4 /**
5 * Bringing Firebug to Drupal.
6 */
7
8 /**
9 * Implementation of hook_perm().
10 */
11 function firebug_perm() {
12 return array('administer firebug', 'access firebug');
13 }
14
15 /**
16 * Implementation of hook_menu().
17 */
18 function firebug_menu($may_cache) {
19 $items = array();
20
21 if ($may_cache) {
22 $items[] = array(
23 'path' => 'admin/settings/firebug',
24 'title' => t('Firebug'),
25 'callback' => 'drupal_get_form',
26 'callback arguments' => array('firebug_settings'),
27 'access' => user_access('administer firebug'),
28 'type' => MENU_NORMAL_ITEM
29 );
30 }
31
32 if (user_access('access firebug')) {
33 $settings = array(
34 'path' => base_path() . drupal_get_path('module', 'firebug'),
35 'icon' => variable_get('firebug_icon', true)
36 );
37 drupal_add_js(array('firebug' => $settings), 'setting');
38 drupal_add_js(drupal_get_path('module', 'firebug') .'/firebug/firebug.js');
39 drupal_add_js(drupal_get_path('module', 'firebug') .'/firebug_controls.js');
40 }
41
42 return $items;
43 }
44
45 /**
46 * Settings page.
47 */
48 function firebug_settings() {
49 $form['firebug_icon'] = array(
50 '#type' => 'checkbox',
51 '#title' => t('Display Firebug Icon'),
52 '#default_value' => variable_get('firebug_icon', true),
53 '#return_value' => true
54 );
55
56 return system_settings_form($form);
57 }

  ViewVC Help
Powered by ViewVC 1.1.2