### Eclipse Workspace Patch 1.0
#P Drupal FHead (MSSQL)
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.7
diff -u -r1.7 locale.install
--- modules/locale/locale.install	14 Nov 2006 06:20:40 -0000	1.7
+++ modules/locale/locale.install	5 Dec 2006 19:03:49 -0000
@@ -73,7 +73,33 @@
       db_query("CREATE INDEX {locales_target}_plural_idx ON {locales_target} (plural)");
       db_query("CREATE INDEX {locales_source}_source_idx ON {locales_source} (source)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {locales_meta} (
+        locale varchar(12) NOT NULL default '',
+        name varchar(64) NOT NULL default '',
+        enabled int NOT NULL default '0',
+        isdefault int NOT NULL default '0',
+        plurals int NOT NULL default '0',
+        formula varchar(128) NOT NULL default '',
+        PRIMARY KEY (locale)
+      );");
+      db_query("CREATE TABLE {locales_source} (
+        lid int NOT NULL identity(1,1),
+        location varchar(255) NOT NULL default '',
+        source varchar(max) NOT NULL,
+        PRIMARY KEY (lid)
+      );");
+      db_query("CREATE TABLE {locales_target} (
+        lid int NOT NULL default '0',
+        translation varchar(max) NOT NULL,
+        locale varchar(12) NOT NULL default '',
+        plid int NOT NULL default '0',
+        plural int NOT NULL default '0',
+      );");
+      break;
   }
+  
+  
   db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
 }
 
Index: modules/search/search.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.install,v
retrieving revision 1.6
diff -u -r1.6 search.install
--- modules/search/search.install	1 Sep 2006 07:40:08 -0000	1.6
+++ modules/search/search.install	5 Dec 2006 19:03:49 -0000
@@ -59,6 +59,26 @@
         PRIMARY KEY (word)
       )");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {search_dataset} (
+        sid int  NOT NULL default '0',
+        type varchar(16) default NULL,
+        data varchar(1024) NOT NULL
+      );");
+      db_query("CREATE TABLE {search_index} (
+        word varchar(50) NOT NULL default '',
+        sid int  NOT NULL default '0',
+        type varchar(16) default NULL,
+        fromsid int  NOT NULL default '0',
+        fromtype varchar(16) default NULL,
+        score float default NULL
+      );");
+      db_query("CREATE TABLE {search_total} (
+        word varchar(50) NOT NULL default '',
+        count float default NULL,
+        PRIMARY KEY (word)
+      );");
+      break;
   }
 }
 
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.8
diff -u -r1.8 profile.install
--- modules/profile/profile.install	28 Nov 2006 14:37:44 -0000	1.8
+++ modules/profile/profile.install	5 Dec 2006 19:03:49 -0000
@@ -64,6 +64,29 @@
       db_query("CREATE INDEX {profile_values}_uid_idx ON {profile_values} (uid)");
       db_query("CREATE INDEX {profile_values}_fid_idx ON {profile_values} (fid)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {profile_fields} (
+        fid int NOT NULL identity(1,1),
+        title varchar(255) default NULL,
+        name varchar(128) unique default NULL,
+        explanation TEXT default NULL,
+        category varchar(255) default NULL,
+        page varchar(255) default NULL,
+        type varchar(128) default NULL,
+        weight int DEFAULT '0' NOT NULL,
+        required int DEFAULT '0' NOT NULL,
+        register int DEFAULT '0' NOT NULL,
+        visibility int DEFAULT '0' NOT NULL,
+        autocomplete int DEFAULT '0' NOT NULL,
+        options text,
+        PRIMARY KEY (fid)
+      );");
+      db_query("CREATE TABLE {profile_values} (
+        fid int  default '0',
+        uid int  default '0',
+        value text
+      );");
+      break;
   }
 }
 
Index: modules/book/book.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.install,v
retrieving revision 1.6
diff -u -r1.6 book.install
--- modules/book/book.install	1 Sep 2006 07:40:08 -0000	1.6
+++ modules/book/book.install	5 Dec 2006 19:03:48 -0000
@@ -29,6 +29,15 @@
       db_query("CREATE INDEX {book}_nid_idx ON {book} (nid)");
       db_query("CREATE INDEX {book}_parent_idx ON {book} (parent)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {book} (
+                vid int  NOT NULL default '0',
+                nid int  NOT NULL default '0',
+                parent int NOT NULL default '0',
+                weight int NOT NULL default '0',
+                PRIMARY KEY (vid)
+              );");
+      break;
   }
 }
 
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.5
diff -u -r1.5 contact.install
--- modules/contact/contact.install	1 Sep 2006 07:40:08 -0000	1.5
+++ modules/contact/contact.install	5 Dec 2006 19:03:48 -0000
@@ -31,6 +31,17 @@
         UNIQUE (category)
       )");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {contact} (
+        cid int NOT NULL default '0',
+        category varchar(255) unique NOT NULL default '',
+        recipients varchar(1024) NOT NULL default '',
+        reply varchar(1024) NOT NULL default '',
+        weight int NOT NULL default '0',
+        selected int NOT NULL default '0',
+        PRIMARY KEY (cid)
+      );");
+      break;
   }
 }
 
Index: modules/poll/poll.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.install,v
retrieving revision 1.7
diff -u -r1.7 poll.install
--- modules/poll/poll.install	1 Sep 2006 07:40:08 -0000	1.7
+++ modules/poll/poll.install	5 Dec 2006 19:03:49 -0000
@@ -64,6 +64,27 @@
       )");
       db_query("CREATE INDEX {poll_choices}_nid_idx ON {poll_choices} (nid)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {poll} (
+          nid int  NOT NULL default '0',
+          runtime int NOT NULL default '0',
+          active int  NOT NULL default '0',
+          PRIMARY KEY (nid)
+        );");
+      db_query("CREATE TABLE {poll_votes} (
+        nid int  NOT NULL,
+        uid int  NOT NULL default 0,
+        hostname varchar(128) NOT NULL default ''
+      );");
+      db_query("CREATE TABLE {poll_choices} (
+        chid int  NOT NULL identity(1,1),
+        nid int  NOT NULL default '0',
+        chtext varchar(128) NOT NULL default '',
+        chvotes int NOT NULL default '0',
+        chorder int NOT NULL default '0',
+        PRIMARY KEY (chid)
+      );");
+      break;
   }
 }
 
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.8
diff -u -r1.8 aggregator.install
--- modules/aggregator/aggregator.install	26 Sep 2006 14:19:00 -0000	1.8
+++ modules/aggregator/aggregator.install	5 Dec 2006 19:03:48 -0000
@@ -113,6 +113,50 @@
       db_query("CREATE INDEX {aggregator_item}_fid_idx ON {aggregator_item} (fid)");
 
       break;
+    
+    case 'mssql':
+      db_query("CREATE TABLE aggregator_category (
+                cid int NOT NULL identity(1,1),
+                title varchar(255) unique NOT NULL default '',
+                description varchar(1024) NOT NULL,
+                block int NOT NULL default '0',
+                PRIMARY KEY (cid)
+              );");
+      db_query("CREATE TABLE aggregator_category_feed (
+                fid int NOT NULL default '0',
+                cid int NOT NULL default '0',
+                PRIMARY KEY (fid,cid)
+              );");
+      db_query("CREATE TABLE aggregator_category_item (
+                iid int NOT NULL default '0',
+                cid int NOT NULL default '0',
+                PRIMARY KEY (iid,cid)
+              );");
+      db_query("CREATE TABLE aggregator_feed (
+                fid int NOT NULL identity(1,1),
+                title varchar(255) unique NOT NULL default '',
+                url varchar(255) NOT NULL default '',
+                refresh int NOT NULL default '0',
+                checked int NOT NULL default '0',
+                link varchar(255) unique NOT NULL default '',
+                description varchar(1024) NOT NULL,
+                image varchar(1024) NOT NULL,
+                etag varchar(255) NOT NULL default '',
+                modified int NOT NULL default '0',
+                block int NOT NULL default '0',
+                PRIMARY KEY (fid)
+              );");
+      db_query("CREATE TABLE aggregator_item (
+                iid int NOT NULL identity(1,1),
+                fid int NOT NULL default '0',
+                title varchar(255) NOT NULL default '',
+                link varchar(255) NOT NULL default '',
+                author varchar(255) NOT NULL default '',
+                description varchar(1024) NOT NULL,
+                timestamp int default NULL,
+                PRIMARY KEY (iid)
+              );");
+      break;
   }
 }
 
Index: modules/drupal/drupal.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/drupal/drupal.install,v
retrieving revision 1.5
diff -u -r1.5 drupal.install
--- modules/drupal/drupal.install	1 Sep 2006 07:40:08 -0000	1.5
+++ modules/drupal/drupal.install	5 Dec 2006 19:03:48 -0000
@@ -53,6 +53,29 @@
         PRIMARY KEY (cid,name)
       )");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE client (
+        cid int  NOT NULL identity(1,1),
+        link varchar(255) NOT NULL default '',
+        name varchar(128) NOT NULL default '',
+        mail varchar(128) NOT NULL default '',
+        slogan varchar(1024) NOT NULL,
+        mission varchar(1024) NOT NULL,
+        users int NOT NULL default '0',
+        nodes int NOT NULL default '0',
+        version varchar(35) NOT NULL default'',
+        created int NOT NULL default '0',
+        changed int NOT NULL default '0',
+        PRIMARY KEY (cid)
+      );
+      ");
+      db_query("CREATE TABLE client_system (
+        cid int NOT NULL default '0',
+        name varchar(255) NOT NULL default '',
+        type varchar(255) NOT NULL default '',
+        PRIMARY KEY (cid,name)
+      );");
+      break;
   }
 }
 
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.52
diff -u -r1.52 system.install
--- modules/system/system.install	1 Dec 2006 17:00:21 -0000	1.52
+++ modules/system/system.install	5 Dec 2006 19:03:52 -0000
@@ -1035,6 +1035,366 @@
       )");
       db_query("CREATE INDEX {watchdog}_type_idx ON {watchdog} (type)");
       break;
+
+   case 'mssql':
+     db_query("CREATE TABLE {access} (
+         aid int NOT NULL identity(1,1),
+         mask varchar(255) NOT NULL default '',
+         type varchar(255) NOT NULL default '',
+         status int NOT NULL default '0',
+         PRIMARY KEY (aid)
+       );");
+     db_query("CREATE TABLE {authmap} (
+       aid int  NOT NULL identity(1,1),
+       uid int NOT NULL default '0',
+       authname varchar(128) unique NOT NULL default '',
+       module varchar(128) NOT NULL default '',
+       PRIMARY KEY (aid)
+     );");
+     db_query("CREATE TABLE {blocks} (
+       module varchar(64) DEFAULT '' NOT NULL,
+       delta varchar(32) NOT NULL default '0',
+       theme varchar(255) NOT NULL default '',
+       status int DEFAULT '0' NOT NULL,
+       weight int DEFAULT '0' NOT NULL,
+       region varchar(64) DEFAULT 'left' NOT NULL,
+       custom int DEFAULT '0' NOT NULL,
+       throttle int DEFAULT '0' NOT NULL,
+       visibility int DEFAULT '0' NOT NULL,
+       pages varchar(4000) DEFAULT '' NOT NULL,
+       title varchar(64) DEFAULT '' NOT NULL
+     );");
+     db_query("CREATE TABLE {boxes} (
+       bid int NOT NULL identity(1,1),
+       title varchar(64) NOT NULL default '',
+       body text,
+       info varchar(128) unique NOT NULL default '',
+       format int NOT NULL default '0',
+       PRIMARY KEY (bid),
+     );");
+     db_query("CREATE TABLE {cache} (
+       cid varchar(255) NOT NULL default '',
+       data text,
+       expire int NOT NULL default '0',
+       created int NOT NULL default '0',
+       headers text,
+       PRIMARY KEY (cid),
+     );");
+     db_query("CREATE TABLE {cache_filter} (
+       cid varchar(255) NOT NULL default '',
+       data text,
+       expire int NOT NULL default '0',
+       created int NOT NULL default '0',
+       headers text,
+       PRIMARY KEY (cid),
+     );");
+     db_query("CREATE TABLE {cache_menu} (
+       cid varchar(255) NOT NULL default '',
+       data text,
+       expire int NOT NULL default '0',
+       created int NOT NULL default '0',
+       headers text,
+       PRIMARY KEY (cid),
+     );");;
+     db_query("CREATE TABLE {cache_page} (
+       cid varchar(255) NOT NULL default '',
+       data text,
+       expire int NOT NULL default '0',
+       created int NOT NULL default '0',
+       headers text,
+       PRIMARY KEY (cid),
+     );");
+     db_query("CREATE TABLE {comments} (
+       cid int NOT NULL default '0',
+       pid int NOT NULL default '0',
+       nid int NOT NULL default '0',
+       uid int NOT NULL default '0',
+       subject varchar(64) NOT NULL default '',
+       comment text NOT NULL,
+       hostname varchar(128) NOT NULL default '',
+       timestamp int NOT NULL default '0',
+       score int NOT NULL default '0',
+       status int  NOT NULL default '0',
+       format int NOT NULL default '0',
+       thread varchar(255) NOT NULL,
+       users text,
+       name varchar(60) NULL default NULL,
+       mail varchar(64) NULL default NULL,
+       homepage varchar(255) NULL default NULL,
+       PRIMARY KEY (cid)
+     );");
+     db_query("CREATE TABLE {node_comment_statistics} (
+       nid int  NOT NULL default '0',
+       last_comment_timestamp int NOT NULL default '0',
+       last_comment_name varchar(60) NULL default NULL,
+       last_comment_uid int NOT NULL default '0',
+       comment_count int  NOT NULL default '0',
+       PRIMARY KEY (nid)
+     );");
+     db_query("CREATE TABLE {files} (
+       fid int  NOT NULL default 0,
+       nid int  NOT NULL default 0,
+       filename varchar(255) NOT NULL default '',
+       filepath varchar(255) NOT NULL default '',
+       filemime varchar(255) NOT NULL default '',
+       filesize int  NOT NULL default 0,
+       PRIMARY KEY (fid)
+     );
+     ");
+     db_query("CREATE TABLE {file_revisions} (
+       fid int  NOT NULL default 0,
+       vid int  NOT NULL default 0,
+       description varchar(255) NOT NULL default '',
+       list int  NOT NULL default 0,
+       PRIMARY KEY (fid, vid)
+     );");
+     db_query("CREATE TABLE {filter_formats} (
+       format int NOT NULL identity(1,1),
+       name varchar(255) unique NOT NULL default '',
+       roles varchar(255) NOT NULL default '',
+       cache int NOT NULL default '0',
+       PRIMARY KEY (format)
+     );");
+     db_query("CREATE TABLE {filters} (
+       format int NOT NULL default '0',
+       module varchar(64) NOT NULL default '',
+       delta int DEFAULT '0' NOT NULL,
+       weight int DEFAULT '0' NOT NULL
+     );");
+     db_query("CREATE TABLE {flood} (
+       event varchar(64) NOT NULL default '',
+       hostname varchar(128) NOT NULL default '',
+       timestamp int NOT NULL default '0'
+     );");
+     db_query("CREATE TABLE {history} (
+       uid int NOT NULL default '0',
+       nid int NOT NULL default '0',
+       timestamp int NOT NULL default '0',
+       PRIMARY KEY (uid,nid)
+     );");
+     db_query("CREATE TABLE {menu} (
+       mid int  NOT NULL default '0',
+       pid int  NOT NULL default '0',
+       path varchar(255) NOT NULL default '',
+       title varchar(255) NOT NULL default '',
+       description varchar(255) NOT NULL default '',
+       weight int NOT NULL default '0',
+       type int  NOT NULL default '0',
+       PRIMARY KEY (mid)
+     );");
+     db_query("CREATE TABLE {node} (
+       nid int  NOT NULL default '0',
+       vid int unique NOT NULL default '0',
+       type varchar(32) NOT NULL default '',
+       title varchar(128) NOT NULL default '',
+       uid int NOT NULL default '0',
+       status int NOT NULL default '1',
+       created int NOT NULL default '0',
+       changed int NOT NULL default '0',
+       comment int NOT NULL default '0',
+       promote int NOT NULL default '0',
+       moderate int NOT NULL default '0',
+       sticky int NOT NULL default '0',
+       PRIMARY KEY  (nid, vid)
+     );");
+     db_query("CREATE TABLE {node_access} (
+       nid int  NOT NULL default '0',
+       gid int  NOT NULL default '0',
+       realm varchar(255) NOT NULL default '',
+       grant_view int  NOT NULL default '0',
+       grant_update int  NOT NULL default '0',
+       grant_delete int  NOT NULL default '0',
+       PRIMARY KEY (nid,gid,realm)
+     );");
+     db_query("CREATE TABLE {node_revisions} (
+       nid int  NOT NULL,
+       vid int  NOT NULL,
+       uid int NOT NULL default '0',
+       title varchar(128) NOT NULL default '',
+       body text NOT NULL default '',
+       teaser varchar(4000) NOT NULL default '',
+       log text NOT NULL default '',
+       timestamp int NOT NULL default '0',
+       format int NOT NULL default '0',
+       PRIMARY KEY  (vid),
+     );");
+     db_query("CREATE TABLE {node_type} (
+       type varchar(32) NOT NULL,
+       name varchar(255) NOT NULL default '',
+       module varchar(255) NOT NULL,
+       description varchar(4000) NOT NULL default '',
+       help varchar(4000) NOT NULL default '',
+       has_title tinyint NOT NULL,
+       title_label varchar(255) NOT NULL default '',
+       has_body tinyint NOT NULL,
+       body_label varchar(255) NOT NULL default '',
+       min_word_count int NOT NULL,
+       custom int NOT NULL DEFAULT '0',
+       modified int NOT NULL DEFAULT '0',
+       locked int NOT NULL DEFAULT '0',
+       orig_type varchar(255) NOT NULL default '',
+       PRIMARY KEY (type))");
+     db_query("CREATE TABLE {url_alias} (
+       pid int  NOT NULL identity(1,1),
+       src varchar(128) NOT NULL default '',
+       dst varchar(128) unique NOT NULL default '',
+       PRIMARY KEY (pid)
+     );");
+     db_query("CREATE TABLE {permission} (
+       rid int  NOT NULL default '0',
+       perm varchar(4000),
+       tid int  NOT NULL default '0'
+     );");
+     db_query("CREATE TABLE {role} (
+       rid int  NOT NULL identity(1,1),
+       name varchar(32) unique NOT NULL default '',
+       PRIMARY KEY (rid)
+     );");
+     db_query("CREATE TABLE {blocks_roles} (
+       module varchar(64) NOT NULL,
+       delta varchar(32) NOT NULL,
+       rid int NOT NULL,
+       PRIMARY KEY (module, delta, rid)
+     );");
+     db_query("CREATE TABLE {sessions} (
+       uid int  NOT NULL,
+       sid varchar(32) NOT NULL default '',
+       hostname varchar(128) NOT NULL default '',
+       timestamp int NOT NULL default '0',
+       cache int NOT NULL default '0',
+       session text,
+       PRIMARY KEY (sid)
+     );");
+     db_query("CREATE TABLE {sequences} (
+       name varchar(255) NOT NULL default '',
+       id int  NOT NULL default '0',
+       PRIMARY KEY (name)
+     );");
+     db_query("CREATE TABLE {node_counter} (
+       nid int NOT NULL default '0',
+       totalcount int  NOT NULL default '0',
+       daycount int NOT NULL default '0',
+       timestamp int  NOT NULL default '0',
+       PRIMARY KEY (nid)
+     );");
+     db_query("CREATE TABLE {system} (
+       filename varchar(255) NOT NULL default '',
+       name varchar(255) NOT NULL default '',
+       type varchar(255) NOT NULL default '',
+       description varchar(255) NOT NULL default '',
+       status char NOT NULL default '0',
+       throttle int DEFAULT '0' NOT NULL,
+       bootstrap int NOT NULL default '0',
+       schema_version smallint NOT NULL default -1,
+       weight int NOT NULL default '0',
+       PRIMARY KEY (filename)
+     );");
+     db_query("CREATE TABLE {term_data} (
+       tid int  NOT NULL default '0',
+       vid int  NOT NULL default '0',
+       name varchar(255) NOT NULL default '',
+       description varchar(4000),
+       weight int NOT NULL default '0',
+       PRIMARY KEY (tid)
+     );");
+     db_query("CREATE TABLE {term_hierarchy} (
+       tid int  NOT NULL default '0',
+       parent int  NOT NULL default '0',
+       PRIMARY KEY (tid, parent)
+     );");
+     db_query("CREATE TABLE {term_node} (
+     nid int  NOT NULL default '0',
+     tid int  NOT NULL default '0',
+     PRIMARY KEY (tid,nid)
+     );");
+     db_query("CREATE TABLE {term_relation} (
+       tid1 int  NOT NULL default '0',
+       tid2 int  NOT NULL default '0'
+     );");
+     db_query("CREATE TABLE {term_synonym} (
+       tid int  NOT NULL default '0',
+       name varchar(255) NOT NULL default ''
+     );");
+     db_query("CREATE TABLE {users} (
+       uid int  NOT NULL default '0',
+       name varchar(60) unique NOT NULL default '',
+       pass varchar(32) NOT NULL default '',
+       mail varchar(64) default '',
+       mode int NOT NULL default '0',
+       sort int default '0',
+       threshold int default '0',
+       theme varchar(255) NOT NULL default '',
+       signature varchar(255) NOT NULL default '',
+       created int NOT NULL default '0',
+       access int NOT NULL default '0',
+       login int NOT NULL default '0',
+       status int NOT NULL default '0',
+       timezone varchar(8) NULL default NULL,
+       language varchar(12) NOT NULL default '',
+       picture varchar(255) NOT NULL DEFAULT '',
+       init varchar(64) default '',
+       data text NULL,
+       PRIMARY KEY (uid)
+     );");
+     db_query("CREATE TABLE {users_roles} (
+       uid int  NOT NULL default '0',
+       rid int  NOT NULL default '0',
+       PRIMARY KEY (uid, rid)
+     );");
+     db_query("CREATE TABLE {variable} (
+       name varchar(48) NOT NULL default '',
+       value text NOT NULL,
+       PRIMARY KEY (name)
+     );");
+     db_query("CREATE TABLE {vocabulary} (
+       vid int  NOT NULL default '',
+       name varchar(255) NOT NULL default '',
+       description varchar(4000),
+       help varchar(255) NOT NULL default '',
+       relations int  NOT NULL default '0',
+       hierarchy int  NOT NULL default '0',
+       multiple int  NOT NULL default '0',
+       required int  NOT NULL default '0',
+       tags int  NOT NULL default '0',
+       module varchar(255) NOT NULL default '',
+       weight int NOT NULL default '0',
+       PRIMARY KEY (vid)
+     );");
+     db_query("CREATE TABLE {vocabulary_node_types} (
+       vid int  NOT NULL DEFAULT '0',
+       type varchar(32) NOT NULL DEFAULT '',
+       PRIMARY KEY (vid, type)
+     );");
+     db_query("CREATE TABLE {watchdog} (
+       wid int NOT NULL identity(1,1),
+       uid int NOT NULL default '0',
+       type varchar(16) NOT NULL default '',
+       message text NOT NULL,
+       severity int  NOT NULL default '0',
+       link varchar(255) NOT NULL default '',
+       location varchar(128) NOT NULL default '',
+       referer varchar(128) NOT NULL default '',
+       hostname varchar(128) NOT NULL default '',
+       timestamp int NOT NULL default '0',
+       PRIMARY KEY (wid)
+     );");
+     // Functions to implement GREATEST function from MySQL, Oracle, and PostGres
+     db_query("CREATE FUNCTION dbo.GREATEST
+              ( @val1 SQL_VARIANT,
+                @val2 SQL_VARIANT, 
+                @val3 SQL_VARIANT )
+                RETURNS SQL_VARIANT 
+                AS
+                BEGIN
+                RETURN ( 
+                  CASE 
+                    WHEN @val1 > @val2 AND @val1 > @val3 THEN @val1 
+                    WHEN @val2 > @val3 THEN @val2
+                  ELSE @val3
+                  END
+                    )
+                END;");
+     break;
   }
 
   db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0)");
Index: modules/statistics/statistics.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.install,v
retrieving revision 1.7
diff -u -r1.7 statistics.install
--- modules/statistics/statistics.install	7 Nov 2006 22:27:07 -0000	1.7
+++ modules/statistics/statistics.install	5 Dec 2006 19:03:49 -0000
@@ -37,6 +37,20 @@
       )");
       db_query("CREATE INDEX {accesslog}_accesslog_timestamp_idx ON {accesslog} (timestamp)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {accesslog} (
+        aid int NOT NULL identity(1,1),
+        sid varchar(32) NOT NULL default '',
+        title varchar(255) default NULL,
+        path varchar(255) default NULL,
+        url varchar(255) default NULL,
+        hostname varchar(128) default NULL,
+        uid int  default '0',
+        timer int  NOT NULL default '0',
+        timestamp int  NOT NULL default '0',
+        PRIMARY KEY (aid)
+      );");
+      break;
   }
 }
 
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.6
diff -u -r1.6 forum.install
--- modules/forum/forum.install	1 Sep 2006 07:40:08 -0000	1.6
+++ modules/forum/forum.install	5 Dec 2006 19:03:48 -0000
@@ -27,6 +27,14 @@
       db_query("CREATE INDEX {forum}_nid_idx ON {forum} (nid)");
       db_query("CREATE INDEX {forum}_tid_idx ON {forum} (tid)");
       break;
+    case 'mssql':
+      db_query("CREATE TABLE {forum} (
+        nid int  NOT NULL default '0',
+        vid int  NOT NULL default '0',
+        tid int  NOT NULL default '0',
+        PRIMARY KEY (vid)
+      );");
+      break;
   }
 }
 
Index: modules/devel/po/devel-module.pot
===================================================================
RCS file: modules/devel/po/devel-module.pot
diff -N modules/devel/po/devel-module.pot
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/po/devel-module.pot	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,87 @@
+Content-type: text/html
+X-Powered-By: PHP/4.3.9
+
+# LANGUAGE translation of PROJECT
+# Copyright YEAR NAME <EMAIL@ADDRESS>
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: V 1.00\n"
+"POT-Creation-Date: 2005-07-25 17:54+0200\n"
+"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
+"Last-Translator: MATTEO <m.ferrari@tiscali.it>\n"
+"Language-Team:  MATTEO <m.ferrari@tiscali.it>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:30
+msgid "empty cache"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:33
+msgid "variable viewer"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:48
+msgid " Page execution time was %time ms."
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:64
+msgid "<p>The user is being redirected to %destination.</p>"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:191
+msgid "Development helper functions"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page timer"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Disabled"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Enabled"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page execution time in the query log box."
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display query log"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display a log of the database queries needed to generate the current page, the and the execution time for each. Also, a queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching."
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Query execution threshhold"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibliy inefficient query, or a candidate for caching."
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "Display redirection page"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page."
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:210
+msgid "access devel information"
+msgstr ""
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:0
+msgid "devel"
+msgstr ""
+
Index: modules/devel/devel.install
===================================================================
RCS file: modules/devel/devel.install
diff -N modules/devel/devel.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel.install	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,108 @@
+<?php
+// $Id: devel.install,v 1.8 2006/08/21 02:43:20 weitzman Exp $
+/**
+ * Implementation of hook_install()
+ */
+function devel_install() {
+  // New module weights in core: put devel as the very last in the chain.
+  db_query("UPDATE {system} SET weight = 10 WHERE name = 'devel'");
+
+  switch ($GLOBALS['db_type']) {
+    case 'mysqli':
+    case 'mysql':
+      $sql = "CREATE TABLE {devel_queries} (
+        qid int(10) NOT NULL auto_increment,
+        function varchar(255) NOT NULL default '',
+        query text NOT NULL,
+        hash varchar(255) NOT NULL default '',
+        PRIMARY KEY (`hash`),
+        KEY qid (qid)
+        ) /*!40100 DEFAULT CHARACTER SET utf8 */;";
+      db_query($sql);
+
+      $sql = "CREATE TABLE {devel_times} (
+        tid int(10) NOT NULL auto_increment,
+        qid int(10) NOT NULL default 0,
+        time float default NULL,
+        PRIMARY KEY (tid),
+        KEY qid (qid)
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */;";
+      db_query($sql);
+      break;
+    case 'mssql':
+      $sql = "CREATE TABLE {devel_queries} (
+        qid INT IDENTITY(1,1),
+        \"function\" varchar(255) NOT NULL default '',
+        query text NOT NULL,
+        hash varchar(255) NOT NULL default '',
+        PRIMARY KEY (qid));";
+      db_query($sql);
+
+      $sql = "CREATE TABLE {devel_times} (
+        tid INT IDENTITY(1,1),
+        qid INT NOT NULL default 0,
+        time FLOAT default NULL,
+        PRIMARY KEY (tid)
+      );";
+      db_query($sql);
+      
+  }
+
+  // Enable the blocks automatically at install.
+  _block_rehash();
+}
+
+/**
+ * Do update 1 again as the hook_install() was missing and new
+ * installations are not having the weight set.
+ */
+function devel_update_2() {
+  // New module weights in core: put devel as the very last in the chain.
+  $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'devel'");
+  return $ret;
+}
+
+function devel_update_3() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysqli':
+    case 'mysql':
+      $sql = "CREATE TABLE {devel_queries} (
+        qid int(10) NOT NULL auto_increment,
+        query varchar(255) NOT NULL default '',
+        hash varchar(255) NOT NULL default '',
+        PRIMARY KEY (`hash`),
+        KEY qid (qid)
+        ) /*!40100 DEFAULT CHARACTER SET utf8 */;";
+      $ret[] = update_sql($sql);
+
+      $sql = "CREATE TABLE {devel_times} (
+        tid int(10) NOT NULL auto_increment,
+        qid int(10) NOT NULL default 0,
+        time float default NULL,
+        PRIMARY KEY (tid),
+        KEY qid (qid)
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */;";
+      $ret[] = update_sql($sql);
+      return $ret;
+  }
+}
+
+function devel_update_4() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'mysqli':
+    case 'mysql':
+      $ret[] = update_sql("ALTER TABLE {devel_queries} ADD `function` varchar(255) NOT NULL default ''");
+  }
+  return $ret;
+}
+
+function devel_update_5() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'mysqli':
+    case 'mysql':
+      $ret[] = update_sql("ALTER TABLE {devel_queries} CHANGE query query text NOT NULL");
+  }
+  return $ret;
+}
Index: modules/devel/generate/AUTHOR
===================================================================
RCS file: modules/devel/generate/AUTHOR
diff -N modules/devel/generate/AUTHOR
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/AUTHOR	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,1 @@
+Authors are Moshe Weitzman, Dries Buytaert, Jonathan Chaffer, and Gerhard Killesreiter.
Index: modules/devel/po/it.po
===================================================================
RCS file: modules/devel/po/it.po
diff -N modules/devel/po/it.po
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/po/it.po	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,85 @@
+# Hungarian translation of Drupal devel.module
+# Copyright Weblabor Team <info [at] weblabor.hu>
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"POT-Creation-Date: 2004-03-06 14:27+0100\n"
+"PO-Revision-Date: 2005-07-25 18:04+0100\n"
+"Last-Translator: Matteo Ferrari <webmaster@cantincoro.org>\n"
+"Language-Team: DrupalItalia\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-Country: ITALY\n"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:30
+msgid "empty cache"
+msgstr "svuota cache"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:33
+msgid "variable viewer"
+msgstr "visualizzatore variabili"
+
+# msgid "Disabled"
+# msgstr ""
+# msgid "Enabled"
+# msgstr ""
+msgid " Page execution time was %time ms."
+msgstr "Il tempo esecuzione pagine è stato %time ms."
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:64
+msgid "<p>The user is being redirected to %destination.</p>"
+msgstr "<p>L'untente è stato rediretto verso %destination.</p>"
+
+msgid "Development helper functions"
+msgstr "Funzioni di aiuto alla programmazione"
+
+msgid "Display page timer"
+msgstr "Mostra i tempi della pagina"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Disabled"
+msgstr "Disabilitato"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Enabled"
+msgstr "Abilitato"
+
+# msgid "Disabled"
+# msgstr ""
+# msgid "Enabled"
+# msgstr ""
+msgid "Display page execution time in the query log box."
+msgstr "Mostra i tempi di esecuzione della pagina nel riquadro delle query"
+
+msgid "Display query log"
+msgstr "Mostra il log delle query"
+
+msgid "Display a log of the database queries needed to generate the current page, the and the execution time for each. Also, a queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching."
+msgstr "Visualizza un logo delle query database che servono per generare la seguente pagina, ed il tempo di esecuzione per ognuna. Inoltre, le query che sono ripetute in una pagina singola sono sommarizzate nella colonna #, e visualizzate in rosso, sicocme sono candidate al caching."
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Query execution threshhold"
+msgstr "Soglia esecuzione query"
+
+msgid "Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibliy inefficient query, or a candidate for caching."
+msgstr "Inserire un numero intero di millisecondi. Qualsiasi query che dura più di questo valore in millisencondi verrà evidenziata nel log delle query. Ciò indica una possibile query inefficiente, o un candidato per il caching."
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "Display redirection page"
+msgstr "Mostra redirezione pagine"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page."
+msgstr "Quando un modulo esegue drupal_goto(), il log delle query e altre informazioni utili agli sviluppatori sono perse. Abilitando questo parametro viene presentata una pagina per gli sviluppatori, così il log puù essere esaminato prima di continuare con la pagina di destinazione."
+
+msgid "access devel information"
+msgstr "accedere alle funzioni di aiuto allo sviluppo"
+
+# d:\Drupal-contributions-CVS\modules\devel\devel.module:0
+msgid "devel"
+msgstr "devel"
+
Index: modules/devel/generate/generate-og2list-mail.php
===================================================================
RCS file: modules/devel/generate/generate-og2list-mail.php
diff -N modules/devel/generate/generate-og2list-mail.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/generate-og2list-mail.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,47 @@
+<?php
+
+// $Id: generate-og2list-mail.php,v 1.4 2006/06/27 21:51:29 killes Exp $:
+
+/**
+ * This script creates bogus mails from existing users to existing groups.
+ * Requires Drupal 4.7, OG2list and OG module.
+ *
+ * If n is the total number of members of a group, this script will
+ * generate n*(n-1) mails. Use with caution.
+ *
+ * Sponsored by CivicSpace Labs
+ */
+require_once './includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+function gom_get_groups() {
+  $result = db_query("SELECT g.nid, g.recipient, u.uid, u.name, u.mail FROM {og2list_groups} g INNER JOIN {og_uid} o ON o.nid = g.nid INNER JOIN {users} u ON o.uid = u.uid WHERE u.status >= 1");
+  $groups = array();
+  while ($group = db_fetch_array($result)) {
+    $groups[$group['nid']]['recipient'] = $group['recipient'];
+    $groups[$group['nid']]['users'][] = array(
+      'uid' => $group['uid'],
+      'mail' => $group['mail'],
+      'name' => $group['name'],
+      );
+  }
+
+  return $groups;
+}
+
+function gom_create_content($groups) {
+  foreach ($groups as $nid => $group) {
+    foreach ($group['users'] as $user) {
+      $msg_id = '<'. time() .'.'. mt_rand() .'@'. strtolower(variable_get('og2list_domain', $_SERVER['SERVER_NAME'])) .'>';
+
+      $subject = 'Test mail from '. $user['name'] .' to '. $group['recipient'];
+      db_query("INSERT INTO {og2list_incoming_content} (from_address,from_name,subject,msgid,content_type,body) VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", $user['mail'], $user['name'], $subject, $msg_id, 'text/plain', "totally irrelevant message body, sent at ". format_date(time(), 'custom', t('Y/m/d - G:i')));
+      db_query("INSERT INTO {og2list_incoming_groups} SET mid=(SELECT mid FROM {og2list_incoming_content} WHERE msgid='%s'), oid=(SELECT nid FROM {og2list_groups} WHERE recipient='%s')", $msg_id, $group['recipient']);
+    }
+  }
+}
+
+
+$groups = gom_get_groups();
+
+gom_create_content($groups);
Index: modules/devel/README_devel_node_access.txt
===================================================================
RCS file: modules/devel/README_devel_node_access.txt
diff -N modules/devel/README_devel_node_access.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/README_devel_node_access.txt	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,41 @@
+README
+======
+
+This module contains tools for developers using access control modules
+to restrict access to some nodes.  It is intended to help catch some
+common mistakes and provide feedback to confirm that restricted nodes
+are in fact visible only to the intended users.
+
+Provides a summary page which queries the node_access table and
+reports common mistakes such as the presence of Drupal's default entry
+which grants all users read access to all nodes.  Also reports the
+presence of nodes not represented in node_access table.  This may
+occur when an access control module is installed after nodes have
+already been created.
+
+Provides a block which shows all node_access entries for the nodes
+shown on a given page.  This gives developers a quick check to see
+that grants are provided as they should be.  This block auto-enables to the footer region. You may move it as desired.
+
+If Views module is installed, allows browsing of nodes by realm,
+including those nodes not in the node_access table (NULL realm).
+
+WISHLIST
+========
+
+Things I'd like to see but haven't had time to do:
+
+* Automatically solve common problems.  I.e. delete the "all" realm
+  entry, and automatically save all nodes not in the node_access table.
+
+* Nicer feedback indicating whether nodes are visible to the public or
+  not.  I.e. use color coding or icons.
+
+* Summary does not differentiate between view grants and other types
+  of grants.  I personally use node_access only for view grants so I'm
+  not sure exactly what else it should show.
+
+AUTHOR
+======
+
+Dave Cohen AKA yogadex on drupal.org
Index: modules/devel/generate/generate-content.php
===================================================================
RCS file: modules/devel/generate/generate-content.php
diff -N modules/devel/generate/generate-content.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/generate-content.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,252 @@
+<?php
+// $Id: generate-content.php,v 1.14 2006/09/08 04:31:00 dww Exp $
+include_once "includes/bootstrap.inc";
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+// If not in 'safe mode', increase the maximum execution time:
+if (!ini_get('safe_mode')) {
+  set_time_limit(240);
+}
+
+function create_nodes($records, $users) {
+
+  $possible_types = array("story", "blog", "forum", "page");
+  // Only use types that exist.
+  $installed_types = array_keys(node_get_types('types'));
+  foreach ($possible_types as $type) {
+    if (in_array($type, $installed_types)) {
+      $types[] = $type;
+    }
+  }
+  $users = array_merge($users, array('0'));
+
+  if (is_array($types)) {
+    // Insert new data:
+    for ($i = 1; $i <= $records; $i++) {
+      $node->uid = $users[array_rand($users)];
+      $node->type = $types[array_rand($types)];
+      $next_nid = db_result(db_query("SELECT id FROM {sequences} WHERE name = '{node}_nid'"))+1;
+      $node->title = "node #$next_nid ($node->type)";
+      $node->body = create_content();
+      $node->teaser = node_teaser($node->body);
+      $node->filter = variable_get('filter_default_format', 1);
+      $node->status = 1;
+      $node->revision = rand(0,1);
+      $node->promote = rand(0, 1);
+      $node->comment = 2;
+      $node->created = time();
+      $node->changed = time();
+
+      // Save the node:
+      node_save($node);
+
+      // Setup a path:
+      db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", "node/$node->nid", "node-$node->nid-$node->type");
+      print "created node #$node->nid with alias ". url("node-$node->nid-$node->type") ."<br />";
+      unset($node);
+    }
+  }
+}
+
+function create_comments($records, $users, $nodes, $comments) {
+  $users = array_merge($users, array('0'));
+  // Insert new data:
+  for ($i = 1; $i <= $records; $i++) {
+    $comment->cid = db_next_id("{comments}_cid");
+    $comment->nid = array_rand($nodes);
+
+    switch ($i % 3) {
+      case 1:
+        $comment->pid = db_result(db_query("SELECT cid FROM {comments} WHERE pid = 0 AND nid = %d ORDER BY RAND() LIMIT 1", $comment->nid));
+        break;
+      case 2:
+        $comment->pid = db_result(db_query("SELECT cid FROM {comments} WHERE pid > 0 AND nid = %d ORDER BY RAND() LIMIT 1", $comment->nid));
+        break;
+      default:
+        $comment->pid = 0;
+    }
+
+    $comment->subject = "comment #$i";
+    $comment->comment = "body of comment #$i";
+    $comment->uid = $users[array_rand($users)];
+
+    db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, status, thread, timestamp) VALUES (%d, %d, %d, %d, '%s', '%s', %d, %d, %d)", $comment->cid, $comment->nid, $comment->pid, $comment->uid, $comment->subject, $comment->comment, 0, 0, time());
+
+    print "created comment #$i<br />";
+  }
+}
+
+function create_content() {
+  $nparas = rand(1,12);
+  $type = rand(0,3);
+
+  $output = "";
+  switch($type % 3) {
+    case 1: // html
+      for ($i = 1; $i <= $nparas; $i++) {
+        $output .= create_para(rand(10,60),1);
+      }
+      break;
+
+    case 2: // brs only
+      for ($i = 1; $i <= $nparas; $i++) {
+        $output .= create_para(rand(10,60),2);
+      }
+      break;
+
+    default: // plain text
+      for ($i = 1; $i <= $nparas; $i++) {
+        $output .= create_para(rand(10,60)) ."\n";
+      }
+  }
+
+  return $output;
+}
+
+function create_para($words, $type = 0) {
+  $output = "";
+  switch ($type) {
+    case 1:
+      $output .= "<p>";
+      $output .= create_greeking($words);
+      $output = trim($output) ."</p>";
+      break;
+
+    case 2:
+      $output .= create_greeking($words);
+      $output = trim($output) ."<br />";
+      break;
+
+    default:
+      $output .= create_greeking($words);
+      $output = trim($output);
+  }
+  return $output;
+}
+
+function create_greeking($words) {
+  $dictionary = array("abbas", "abdo", "abico", "abigo", "abluo", "accumsan",
+    "acsi", "ad", "adipiscing", "aliquam", "aliquip", "amet", "antehabeo",
+    "appellatio", "aptent", "at", "augue", "autem", "bene", "blandit",
+    "brevitas", "caecus", "camur", "capto", "causa", "cogo", "comis",
+    "commodo", "commoveo", "consectetuer", "consequat", "conventio", "cui",
+    "damnum", "decet", "defui", "diam", "dignissim", "distineo", "dolor",
+    "dolore", "dolus", "duis", "ea", "eligo", "elit", "enim", "erat",
+    "eros", "esca", "esse", "et", "eu", "euismod", "eum", "ex", "exerci",
+    "exputo", "facilisi", "facilisis", "fere", "feugiat", "gemino",
+    "genitus", "gilvus", "gravis", "haero", "hendrerit", "hos", "huic",
+    "humo", "iaceo", "ibidem", "ideo", "ille", "illum", "immitto",
+    "importunus", "imputo", "in", "incassum", "inhibeo", "interdico",
+    "iriure", "iusto", "iustum", "jugis", "jumentum", "jus", "laoreet",
+    "lenis", "letalis", "lobortis", "loquor", "lucidus", "luctus", "ludus",
+    "luptatum", "macto", "magna", "mauris", "melior", "metuo", "meus",
+    "minim", "modo", "molior", "mos", "natu", "neo", "neque", "nibh",
+    "nimis", "nisl", "nobis", "nostrud", "nulla", "nunc", "nutus", "obruo",
+    "occuro", "odio", "olim", "oppeto", "os", "pagus", "pala", "paratus",
+    "patria", "paulatim", "pecus", "persto", "pertineo", "plaga", "pneum",
+    "populus", "praemitto", "praesent", "premo", "probo", "proprius",
+    "quadrum", "quae", "qui", "quia", "quibus", "quidem", "quidne", "quis",
+    "ratis", "refero", "refoveo", "roto", "rusticus", "saepius",
+    "sagaciter", "saluto", "scisco", "secundum", "sed", "si", "similis",
+    "singularis", "sino", "sit", "sudo", "suscipere", "suscipit", "tamen",
+    "tation", "te", "tego", "tincidunt", "torqueo", "tum", "turpis",
+    "typicus", "ulciscor", "ullamcorper", "usitas", "ut", "utinam",
+    "utrum", "uxor", "valde", "valetudo", "validus", "vel", "velit",
+    "veniam", "venio", "vereor", "vero", "verto", "vicis", "vindico",
+    "virtus", "voco", "volutpat", "vulpes", "vulputate", "wisi", "ymo",
+    "zelus");
+
+  $greeking = "";
+
+  while ($words > 0) {
+    $sentence_length = rand(3,10);
+
+    $greeking .= ucfirst($dictionary[array_rand($dictionary)]);
+    for ($i = 1; $i < $sentence_length; $i++) {
+      $greeking .= " " . $dictionary[array_rand($dictionary)];
+    }
+
+    $greeking .= ". ";
+    $words -= $sentence_length;
+  }
+
+  return $greeking;
+}
+
+function add_terms($nodes, $terms) {
+  if(count($terms) > 0){
+    foreach($nodes as $nid => $type) {
+     $tid = $terms[$type][@array_rand($terms[$type])];
+      if ($tid) {
+        db_query("INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)", $nid, $tid);
+      }
+    }
+  }
+}
+
+function get_users() {
+  $users = array();
+  $result = db_query("SELECT uid FROM {users}");
+  while($user = db_fetch_object($result)){
+    $users[] = $user->uid;
+  }
+  return $users;
+}
+
+function get_nodes() {
+  $nodes = array();
+  $result = db_query("SELECT nid, type FROM {node} WHERE type IN ('story', 'blog', 'forum', 'page') AND comment = 2");
+  while($node = db_fetch_object($result)){
+    $nodes[$node->nid] = $node->type ;
+  }
+  return $nodes;
+}
+
+function get_comments() {
+  $comments = array();
+  $result = db_query("SELECT nid, cid FROM {comments}");
+  while($comment = db_fetch_object($result)){
+    $comments[$comment->nid][] = $comment->cid ;
+  }
+  return comments;
+}
+
+function get_terms() {
+  $terms = array();
+  $result = db_query("SELECT d.tid, v.vid FROM {vocabulary} v, {term_data} d WHERE v.vid = d.vid");
+  while($term = db_fetch_object($result)){
+    $result2 = db_query("SELECT n.type FROM {vocabulary_node_types} n WHERE n.vid = %d", $term->vid);
+    while ($nt = db_fetch_object($result2)) {
+      $terms[$nt->type][] = $term->tid;
+    }
+  }
+  return $terms;
+}
+
+db_query("DELETE FROM {comments}");
+db_query("DELETE FROM {node}");
+db_query("DELETE FROM {node_revisions}");
+db_query("DELETE FROM {node_comment_statistics}");
+if (db_table_exists(forum)) { db_query("DELETE FROM {forum}"); }
+db_query("DELETE FROM {url_alias}");
+db_query("UPDATE {sequences} SET id = '0' WHERE name = 'node_nid'");
+db_query("UPDATE {sequences} SET id = '0' WHERE name = 'comments_cid'");
+db_query("ALTER TABLE {node} AUTO_INCREMENT = 1");
+db_query("ALTER TABLE {comments} AUTO_INCREMENT = 1");
+
+// get user id
+$users = get_users();
+
+$terms = get_terms();
+
+// create 100 pseudo-random nodes:
+create_nodes(50, $users);
+
+$nodes = get_nodes();
+
+add_terms($nodes, $terms);
+
+$comments = get_comments();
+
+create_comments(500, $users, $nodes, $comments);
+
+?>
Index: modules/devel/po/hu.po
===================================================================
RCS file: modules/devel/po/hu.po
diff -N modules/devel/po/hu.po
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/po/hu.po	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,67 @@
+# Hungarian translation of Drupal devel.module
+# Copyright Weblabor Team <info [at] weblabor.hu>
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.28\n"
+"POT-Creation-Date: 2004-03-06 14:27+0100\n"
+"PO-Revision-Date: 2003-03-06 14:44+0100\n"
+"Last-Translator: Weblabor Team <info [at] weblabor.hu>\n"
+"Language-Team: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#: devel.module:56
+msgid "Query log"
+msgstr "SQL napló"
+
+#: devel.module:116
+msgid "Development helper functions"
+msgstr "Fejlesztést segítő eszközök"
+
+#: devel.module:123
+msgid "Display Page Timer"
+msgstr "Oldal idémérő megjelenítése"
+
+#: devel.module:123 ;124
+# msgid "Disabled"
+# msgstr ""
+
+#: devel.module:123 ;124
+# msgid "Enabled"
+# msgstr ""
+
+#: devel.module:123
+msgid "Display page execution time in the query log box."
+msgstr "Az oldal előállításához szükséges idő megjelenítése."
+
+#: devel.module:124
+msgid "Display query log"
+msgstr "SQL napló megjelenítése"
+
+#: devel.module:124
+msgid ""
+"Display a log of the database queries needed to generate the current page, "
+"the and the execution time for each. Also, a queries which are repeated "
+"during a single page view are summed in the # column, and printed in red "
+"since they are candidates for caching."
+msgstr ""
+"Az oldal előállításához szükséges adatbázis lekérdezések naplóját jeleníti "
+"meg azok futási idejével. Ismétlődő lekérdezések piros színben jelennek meg, "
+"hiszen éppen ezek azok, amelyek gyorsítótárazásra a legjobb jelöltek."
+
+#: devel.module:125
+msgid ""
+"Enter an integer in milliseconds. Any query which takes longer than this "
+"many milliseconds will be highlighted in the query log. This indicates a "
+"possibliy inefficient query, or a candidate for caching."
+msgstr ""
+"Adj meg egy egész számot. Bármely lekérdezés, mely ennyi milliszekundumnál "
+"hosszabban fut kiemelt lesz az SQL naplóban. Ezek általában rossz "
+"hatékonyságú parancsok vagy gyorsítótárazható lekérdezések."
+
+#: devel.module:130
+msgid "access devel information"
+msgstr "elérés: fejlesztői információk"
Index: modules/devel/devel.info
===================================================================
RCS file: modules/devel/devel.info
diff -N modules/devel/devel.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel.info	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+; $Id: devel.info,v 1.1 2006/09/06 03:52:26 weitzman Exp $
+name = Devel
+description = Various blocks, pages, and functions for developers.
Index: modules/devel/generate/generate-users.php
===================================================================
RCS file: modules/devel/generate/generate-users.php
diff -N modules/devel/generate/generate-users.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/generate-users.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+<?php
+  /**
+   * This script generates users for testing purposes.
+   */
+include_once 'includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+
+// use one of your own domains. Using somebody else's domain is rude.
+$domain = '';
+
+make_users(50, $domain);
+
+function make_users($num, $domain) {
+  db_query('DELETE FROM {users} WHERE uid > 1');
+  for ($i = 2; $i <= $num; $i++) {
+    $uid = $i;
+    $name = md5($i);
+    $mail = $name .'@'. $domain;
+    $status = 1;
+    db_query("INSERT INTO {users} (uid, name, mail, status, created, access) VALUES (%d, '%s', '%s', %d, %d, %d)", $uid, $name, $mail, $status, time(), time());
+  }
+  db_query("UPDATE {sequences} SET id = %d WHERE name = 'users_uid'", $uid);
+}
Index: modules/devel/generate/generate-taxonomy.php
===================================================================
RCS file: modules/devel/generate/generate-taxonomy.php
diff -N modules/devel/generate/generate-taxonomy.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/generate-taxonomy.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,91 @@
+<?php
+// $Id: generate-taxonomy.php,v 1.6 2006/04/05 10:28:00 jaza Exp $
+include_once "includes/bootstrap.inc";
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+// If not in 'safe mode', increase the maximum execution time:
+if (!ini_get('safe_mode')) {
+  set_time_limit(240);
+}
+
+function create_vocabularies($records) {
+  $types = array("story", "blog", "forum", "page");
+
+  // Insert new data:
+  for ($i = 1; $i <= $records; $i++) {
+    $voc = array();
+    $voc['name'] = "vocabulary #$i";
+    $voc['description'] = "description of vocabulary #$i";
+    $voc['nodes'] = array_flip(array($types[array_rand($types)]));
+    foreach ($voc['nodes'] as $key => $value) {
+      $voc['nodes'][$key] = $key;
+    }
+    $voc['multiple'] = 1;
+    $voc['required'] = 0;
+    $voc['relations'] = 1;
+    $voc['hierarchy'] = 1;
+    $voc['weight'] = rand(0,10);    
+
+    taxonomy_save_vocabulary($voc);
+    $output .= "created vocabulary #$i<br />";
+  }
+  return $output;
+}
+
+function create_terms($records, $vocs) {
+
+  // Insert new data:
+  for ($i = 1; $i <= $records; $i++) {
+
+    switch ($i % 2) {
+      case 1:
+        $term['vid'] = $vocs[array_rand($vocs)];
+        // dont set a parent. handled by taxonomy_save_term()
+        // $term->parent = 0;
+        break;
+      case 2:
+      default:
+        $parent = db_fetch_object(db_query_range("SELECT t.tid, v.vid FROM {term_data} t INNER JOIN {vocabulary} v ON t.vid = v.vid ORDER BY RAND()", 0, 1));
+        $term['parent'] = array($parent->tid);
+        $term['vid'] = $parent->vid;
+        break;
+    }
+ 
+    $term['name'] = "term #$i";
+    $term['description'] = "description of term #$i";
+    $term['weight'] = rand(0,10);
+   
+    $status = taxonomy_save_term($term);
+    unset($term);
+    
+    $output .= $status. ": #$i<br />";
+  }
+  return $output;
+}
+
+function get_vocabularies() {
+  $vocs = array();
+  $result = db_query("SELECT vid FROM {vocabulary}");
+  while($voc = db_fetch_object($result)){
+    $vocs[] = $voc->vid;
+  }
+  return $vocs;
+}
+
+
+db_query("DELETE FROM {term_data}");
+db_query("DELETE FROM {term_node}");
+db_query("DELETE FROM {term_hierarchy}");
+db_query("DELETE FROM {term_relation}");
+db_query("DELETE FROM {term_synonym}");
+db_query("DELETE FROM {vocabulary}");
+db_query("DELETE FROM {vocabulary_node_types}");
+db_query("UPDATE {sequences} SET id = '0' WHERE name = '{vocabulary_vid}'");
+db_query("UPDATE {sequences} SET id = '0' WHERE name = '{term_data_tid}'");
+
+$output = create_vocabularies(15);
+$vocs = get_vocabularies();
+$output .= create_terms(50, $vocs);
+print theme('page', $output);
+drupal_page_footer();
+
+?>
Index: modules/devel/devel.module
===================================================================
RCS file: modules/devel/devel.module
diff -N modules/devel/devel.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel.module	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,865 @@
+<?php
+// $Id: devel.module,v 1.106 2006/09/22 08:37:44 weitzman Exp $
+
+// This module holds functions useful for Drupal development.
+// Please contribute!
+
+// suggested profiling and stacktrace library from http://www.xdebug.org/index.php
+// if you activate this extension, this module will use it.
+// you probably want these php.ini or .htaccess directives:
+// xdebug.auto_profile=1
+// xdebug.auto_profile_mode=3
+// xdebug.output_dir='/php'
+// xdebug.default_enable
+
+define(DEVEL_QUERY_SORT_BY_SOURCE, 0);
+define(DEVEL_QUERY_SORT_BY_DURATION, 1);
+
+/**
+ * Implementation of hook_help().
+ */
+function devel_help($section) {
+  switch ($section) {
+    case 'admin/settings/devel':
+      return '<p>'. t('Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the <a href="%admin-blocks">block administration</a> page.', array('%admin-blocks' => url('admin/build/block'))). '</p>';
+    case 'devel/reinstall':
+      return '<p>'. t('Clicking a module\'s reinstall button will simulate installing a module. <code>hook_install()</code> will be executed and the schema version number will be set to the most recent update number. Make sure to manually clear out any existing tables first.'). '</p>';
+  }
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function devel_menu($may_cache) {
+  $items = array();
+
+  if ($may_cache) {
+    $items[] = array('path' => 'devel/cache/clear',
+      'title' => t('empty cache'),
+      'callback' => 'devel_cache_clear',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK,
+    );
+    $items[] = array('path' => 'devel/queries',
+      'title' => t('database queries'),
+      'callback' => 'devel_queries',
+      'access' => user_access('access devel information'));
+    $items[] = array('path' => 'devel/queries/empty',
+      'title' => t('empty database queries'),
+      'callback' => 'devel_queries_empty',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'devel/phpinfo',
+      'title' => t('phpinfo()'),
+      'callback' => 'devel_phpinfo',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK,
+    );
+    $items[] = array('path' => 'devel/reinstall',
+      'title' => t('reinstall modules'),
+      'callback' => 'devel_reinstall',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK,
+    );
+    if (module_exists('menu')) {
+      $items[] = array('path' => 'devel/menu/reset',
+        'title' => t('reset menus'),
+        'callback' => 'drupal_get_form',
+        'callback arguments' => 'devel_menu_reset_form',
+        'access' => user_access('access devel information'),
+        'type' => MENU_CALLBACK,
+      );
+    }
+    $items[] = array('path' => 'devel/variable',
+      'title' => t('variable viewer'),
+      'callback' => 'devel_variable',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK,
+    );
+    $items[] = array('path' => 'devel/session',
+      'title' => t('session viewer'),
+      'callback' => 'devel_session',
+      'access' => user_access('access devel information'),
+      'type' => MENU_CALLBACK,
+    );
+    $items[] = array('path' => 'devel/switch',
+      'title' => t('switch user'),
+      'callback' => 'devel_switch_user',
+      'access' => user_access('switch users'),
+      'type' => MENU_CALLBACK,
+    );
+    $items[] = array(
+      'path' => 'admin/settings/devel',
+      'title' => t('devel'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('devel_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM
+    );
+  }
+  else {
+    if (is_numeric(arg(1))) {
+      if (arg(0) == 'node') {
+        $items[] = array('path' => 'node/'. arg(1) .'/load',
+          'title' => t('devel load'),
+          'callback' => 'devel_load_object',
+          'callback arguments' => array('node', arg(1)),
+          'access' => user_access('access devel information'),
+          'type' => MENU_LOCAL_TASK,
+        );
+        $items[] = array('path' => 'node/'. arg(1) .'/render',
+          'title' => t('devel render'),
+          'callback' => 'devel_render_object',
+          'callback arguments' => array('node', arg(1)),
+          'access' => user_access('access devel information'),
+          'type' => MENU_LOCAL_TASK,
+        );
+      }
+      elseif (arg(0) == 'user') {
+        $items[] = array('path' => 'user/'. arg(1) .'/load',
+          'title' => t('devel load'),
+          'callback' => 'devel_load_object',
+          'callback arguments' => array('user', arg(1)),
+          'access' => user_access('access devel information'),
+          'type' => MENU_LOCAL_TASK,
+        );
+      }
+    }
+    drupal_add_css(drupal_get_path('module', 'devel') .'/devel.css');
+  }
+
+  return $items;
+}
+
+/**
+ * Implementation of hook_init(). Avoids custom error handling for better
+ * behavior when stepping though in a debugger.
+ */
+function devel_init() {
+  if (variable_get('dev_mem', 0) && function_exists('memory_get_usage')) {
+    global $memory_init;
+
+    $memory_init = memory_get_usage();
+  }
+  // update.php relies on the custom error handler
+  if (!strstr($_SERVER['PHP_SELF'], 'update.php')) {
+    restore_error_handler();
+  }
+}
+
+/**
+ * Implementation of hook_perm().
+ */
+function devel_perm() {
+  return array('access devel information', 'execute php code', 'switch users');
+}
+
+/**
+ * Implementation of hook_block().
+ */
+function devel_block($op = 'list', $delta = 0) {
+  if ($op == 'list') {
+    $blocks[0]['info'] = t('Switch user');
+    $blocks[1]['info'] = t('Devel');
+    $blocks[2]['info'] = t('Execute PHP');    
+    
+    // Auto-enable the devel blocks for fresh installations.
+    $blocks[1]['status'] = 1;
+    $blocks[2]['status'] = 1;
+    $blocks[2]['region'] = 'footer';
+
+    return $blocks;
+  }
+  else if ($op == 'view') {
+    switch ($delta) {
+      case 0:
+        $block['subject'] = t('switch user');
+        if (user_access('switch users')) {
+          $users = db_query_range('SELECT uid, name FROM {users} WHERE uid > 0 ORDER BY access', 0, 10);
+          while ($user = db_fetch_object($users)) {
+            $dest = drupal_get_destination();
+            $links[] = l(check_plain($user->name), 'devel/switch/'. $user->uid, array(), $dest);
+          }
+        }
+        if ($links) {
+          $block['content'] = theme('item_list', $links);
+        }
+        break;
+      case 1:
+        $links = array();
+        $block['subject'] = t('devel');
+        if (user_access('access devel information')) {
+          $links[] = l('module settings', 'admin/settings/devel');
+          $links[] = l('devel queries', 'devel/queries');
+          $links[] = l('empty cache', 'devel/cache/clear');
+          $links[] = l('empty page cache', 'devel/cache/clear/page', array('type'));
+          $links[] = l('empty menu cache', 'devel/cache/clear/menu', array('type' => 'menu'));
+          $links[] = l('empty filter cache', 'devel/cache/clear/filter', array('type' => 'filter'));
+          $links[] = l('phpinfo()', 'devel/phpinfo');
+          $links[] = l('reinstall modules', 'devel/reinstall');
+          $links[] = l('reset menus', 'devel/menu/reset');
+          $links[] = l('variable viewer', 'devel/variable');
+          $links[] = l('session viewer', 'devel/session');
+        }
+        if (function_exists('devel_node_access_perm') && user_access(DNA_ACCESS_VIEW)) {
+          // True only if devel_node_access enabled.
+          $links[] = l('node_access summary', 'devel/node_access/summary');
+        }
+        if ($links) {
+          $block['content'] = theme('item_list', $links);
+        }
+        break;
+      case 2:
+        if (user_access('execute php code')) {
+          $block['subject'] = t('execute php');
+          $block['content'] = drupal_get_form('devel_execute_form');
+        }
+        break;
+    }
+
+    return $block;
+  }
+}
+
+/**
+ * Implementation of hook_form_alter().
+ */
+function devel_form_alter($form_id, &$form, $key_in = NULL) {
+  if (user_access('access devel information') && variable_get('devel_form_weights', 0)) {
+    $children = element_children($form);
+    if (empty($children)) {
+      if (isset($form['#type']) && !in_array($form['#type'], array('value', 'hidden'))) {
+        if (!isset($form['#title'])) {
+          $form['#title'] = '';
+        }
+        $form['#title'] .= " (key=$key_in, weight=". (isset($form['#weight']) ? $form['#weight'] : 0) .')';
+      }
+    }
+    else {
+      foreach (element_children($form) as $key) {
+        // We need to add the weight to fieldsets.
+        if (element_children($form[$key])) { // Which are a container of others.
+          if (!isset($form[$key]['#title'])) {
+            $form[$key]['#title'] = '';
+          }
+          $form[$key]['#title'] .= " (key=$key, weight=". (isset($form[$key]['#weight']) ? $form[$key]['#weight'] : 0) .')';
+        }
+        devel_form_alter($form_id, $form[$key], $key);
+      }
+    }
+  }
+}
+
+/**
+ * Implementation of hook_exit(). Displays developer information in the footer.
+ *
+ * Don't use t() here. It isn't available for cached pages.
+ *
+ * We can't move this to hook_footer() since this must run after
+ * drupal_page_footer() in order to work for cached pages.
+ */
+function devel_exit($destination = NULL) {
+  global $queries, $memory_init;
+
+  $is_xml = FALSE;
+  $output = '';
+  if (isset($destination)) {
+    // The page we are leaving is a drupal_goto(). Present a redirection page
+    // so that the developer can see the intermediate query log.
+    if (user_access('access devel information') && variable_get('devel_redirect_page', 0)) {
+      $output = strtr('<p>The user is being redirected to <a href="%destination">%destination</a>.</p>', array('%destination' => $destination));
+      print theme('page', $output);
+
+      // Don't allow the automatic redirect to happen.
+      drupal_page_footer();
+      exit();
+    }
+    else {
+      // Make sure not to print anything before the automatic redirect.
+      return;
+    }
+  }
+
+  if (function_exists('drupal_get_headers') && strstr(drupal_get_headers(), 'xml')) {
+    $is_xml = TRUE;
+  }
+  if (function_exists('user_access') && user_access('access devel information') && !$is_xml) { // Try not to break the xml pages.
+    // Query log off, timer on.
+    if (!variable_get('devel_query_display', 0) && variable_get('dev_timer', 0)) {
+      $output = '<div class="dev-timer">'. devel_timer() .'</div>';
+    }
+
+    // Query log on.
+    $sum = 0;
+    if (variable_get('devel_query_display', 0)) {
+      foreach ($queries as $query) {
+        $text[] = $query[0];
+        $sum += $query[1];
+      }
+      $counts = array_count_values($text);
+
+      $output .= '<div class="dev-query">';
+      $txt = strtr('Executed %queries queries in %time milliseconds.', array('%queries' => count($queries), '%time' => round($sum * 1000, 2)));
+      if (function_exists('theme_table')) {
+        $txt .= strtr(' Queries taking longer than %threshold ms and queries executed more than once, are <span class="marker">highlighted</span>.', array('%threshold' => variable_get('devel_execution', 5)));
+        if (variable_get('dev_timer', 0)) {
+          $txt .= devel_timer();
+        }
+        $output .= $txt. devel_query_table($queries, $counts);
+      }
+      else {
+        $output .= $txt;
+        ob_start();
+        dprint_r($queries);
+        $output .= ob_get_clean();
+      }
+      $output .= '</div>';
+    }
+    // Lots of profile info. not sure how to use it yet.
+    if (extension_loaded('xdebug') && ini_get("xdebug.auto_profile")) {
+      // Commented out because generates too much output. output to log file instead. see xdebug docs
+      // dprint_r(xdebug_get_function_profile());;
+    };
+    if (variable_get('dev_mem', 0) && function_exists('memory_get_usage')) {
+      $memory_exit = memory_get_usage();
+      $list = array();
+      foreach (array('devel_init()' => $memory_init, 'devel_exit()' => $memory_exit) as $type => $value) {
+        $list[] = strtr('Memory used at %type: %value MB', array('%type' => $type, '%value' => round($value / 1024 / 1024, 2)));
+      }
+      $output .= '<div class="dev-memory-usage"><h3>'. 'Memory usage:' .'</h3>'. theme('item_list', $list) .'</div>';
+    }
+    // TODO: gzip this text if we are sending a gzip page. see drupal_page_header().
+    print $output;
+  }
+
+  if (variable_get('devel_store_queries', 0) && rand(1, variable_get('devel_store_random', 1)) == 1) {
+    global $active_db;
+    $qids = array();
+    $values = array();
+    $fields = array();
+    // We need this for the devel_queries insert below.
+    setlocale(LC_NUMERIC, 'C');
+    foreach ($queries as $value) {
+      list($function, $query) = explode("\n", $value[0]);
+      $query = preg_replace(array("/'.*'/s", "/\d.*\.\d.*/", "/\d.*/"), array("S", "F", "D"), $query);
+      $hash = md5($function . $query);
+      if (!isset($qids[$hash])) {
+        $qids[$hash] = db_result(devel_db_query("SELECT qid FROM {devel_queries} WHERE hash = '%s'", $hash));
+        if (!$qids[$hash]) {
+          devel_db_query("INSERT INTO {devel_queries} (query, function, hash) VALUES ('%s', '%s', '%s')", $query, $function, $hash);
+          $qids[$hash] = mysql_insert_id();
+        }
+      }
+      $fields[] = "(%d, '%f')";
+      $values[] = $qids[$hash];
+      $values[] = $value[1];
+    }
+    if (count($fields)) {
+      devel_db_query('INSERT INTO {devel_times} (qid, time) VALUES '. implode(',', $fields), $values);
+    }
+  }
+}
+
+function devel_db_query($query) {
+  global $active_db;
+  $args = func_get_args();
+  array_shift($args);
+  $query = db_prefix_tables($query);
+  if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
+    $args = $args[0];
+  }
+  _db_query_callback($args, TRUE);
+  $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
+  return mysql_query($query, $active_db);
+}
+
+function devel_admin_settings() {
+  $form['queries'] = array('#type' => 'fieldset', '#title' => t('Query log'));
+  $form['queries']['dev_query'] = array('#type' => 'checkbox',
+    '#title' => t('Collect query info'),
+    '#default_value' => variable_get('dev_query', 0),
+    '#description' => t("Collect query info. If disabled, no query log functionality will work."));
+  $form['queries']['devel_query_display'] = array('#type' => 'checkbox',
+    '#title' => t('Display query log'),
+    '#default_value' => variable_get('devel_query_display', 0),
+    '#description' => t('Display a log of the database queries needed to generate the current page, and the execution time for each. Also, queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching.'));
+  $form['queries']['devel_query_sort'] = array('#type' => 'radios',
+    '#title' => t('Sort query log'),
+    '#default_value' =>   variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE),
+    '#options' => array(t('by source'), t('by duration')),
+    '#description' => t('The query table can be sorted in the order that the queries were executed or by descending duration.'),
+  );
+  $form['queries']['devel_execution'] = array('#type' => 'textfield',
+    '#title' => t('Slow query highlighting'),
+    '#default_value' => variable_get('devel_execution', 5),
+    '#size' => 4,
+    '#maxlength' => 4,
+    '#description' => t('Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibly inefficient query, or a candidate for caching.'),
+  );
+  $form['queries']['devel_store_queries'] = array('#type' => 'checkbox', 
+    '#title' => t('Store executed queries'), 
+    '#default_value' => variable_get('devel_store_queries', 0), 
+    '#description' => t('Store statistics about executed queries. See the devel_x tables. This feature is currently only available for the MySQL database backend.'));
+  $form['queries']['devel_store_random'] = array('#type' => 'textfield', 
+    '#title' => t('Sampling interval'), 
+    '#default_value' => variable_get('devel_store_random', 1), 
+    '#size' => 4, 
+    '#description' => t('If storing query statistics, only store every nth page view. 1 means every page view, 2 every second, and so on.'));
+  
+  $form['dev_timer'] = array('#type' => 'checkbox',
+    '#title' => t('Display page timer'),
+    '#default_value' => variable_get('dev_timer', 0),
+    '#description' => t('Display page execution time in the query log box.'),
+  );
+  $form['dev_mem'] = array('#type' => 'checkbox',
+    '#title' => t('Display memory usage'),
+    '#default_value' => variable_get('dev_mem', 0),
+    '#description' => t('Display how much memory is used to generate the current page. This will show memory usage when devel_init() is called and when devel_exit() is called. PHP must have been compiled with the <em>--enable-memory-limit</em> configuration option for this feature to work.'),
+  );
+  $form['devel_redirect_page'] = array('#type' => 'checkbox',
+    '#title' => t('Display redirection page'),
+    '#default_value' => variable_get('devel_redirect_page', 0),
+    '#description' => t('When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page.'),
+  );
+  $form['devel_form_weights'] = array('#type' => 'checkbox',
+    '#title' => t('Display form element keys and weights'),
+    '#default_value' => variable_get('devel_form_weights', 0),
+    '#description' => t('Form element names are needed for performing themeing or altering a form. Their weights determine the position of the element. Enabling this setting will show these keys and weights beside each form item.'),
+  );
+
+  // Save any old SMTP library
+  if (variable_get('smtp_library', '') != '' && variable_get('smtp_library', '') != drupal_get_filename('module', 'devel')) {
+    variable_set('devel_old_smtp_library', variable_get('smtp_library', ''));
+  }
+  $smtp_options = array(
+    '' => t('Default'),
+    drupal_get_filename('module', 'devel') => t('Log only'),
+  );
+  if (variable_get('devel_old_smtp_library', '') != '') {
+    $smtp_options[variable_get('devel_old_smtp_library', '')] = t('Other (%library)', array('%library' => variable_get('devel_old_smtp_library', '')));
+  }
+  $form['smtp_library'] = array(
+    '#type' => 'radios',
+    '#title' => t('SMTP library'),
+    '#options' => $smtp_options,
+    '#default_value' => variable_get('smtp_library', ''),
+  );
+
+  return system_settings_form($form);
+}
+
+/**
+ * Menu callback; clears all caches, then redirects to the previous page.
+ */
+function devel_cache_clear($type = '') {
+  global $base_url;
+  if($type) {
+    db_query('DELETE FROM {cache_' . $type . '}');
+  }
+  else {
+    db_query('DELETE FROM {cache}');
+  }
+  drupal_set_message('cache cleared').
+  $referer = referer_uri();
+  header('Location: '. ($referer ? $referer : $base_url));
+  exit();
+}
+
+/**
+ * Generates the execute block form.
+ */
+function devel_execute_form() {
+  $form['code'] = array('#type' => 'textarea',
+    '#title' => t('PHP code to execute'),
+    '#description' => t('Enter some code. Do not use <code>&lt?php</code> tags.'),
+  );
+  $form['op'] = array('#type' => 'submit', '#value' => t('Execute'));
+  $form['#redirect'] = FALSE;
+  return $form;
+}
+
+/**
+ * Process PHP execute form submissions.
+ */
+function devel_execute_form_submit($form_id, $form) {
+  ob_start();
+  print eval($form['code']);
+  dsm(ob_get_clean());
+}
+
+/**
+ * Menu callback; display phpinfo() output.
+ * As phpinfo() outputs an entire HTML page, this function extracts and displays only the data between
+ * the <body> tag.
+ */
+function devel_phpinfo() {
+  ob_start();
+  phpinfo();
+  preg_match("/<body>(.*)<\/body>/s", ob_get_clean(), $matches);
+  return '<div class="phpinfo">'. $matches[1] .'</div>';
+}
+
+/**
+ * Menu callback; clear the database, resetting the menu to factory defaults.
+ */
+function devel_menu_reset_form() {
+  return confirm_form(array(), 
+    t('Are you sure you want to reset all menu items to their default settings?'), 
+    'admin/build/menu', 
+    t('Any custom additions or changes to the menu will be lost.'), 
+    t('Reset all'),
+    t('Cancel')
+  );
+}
+
+/**
+ * Process menu reset form submission.
+ */
+function devel_menu_reset_form_submit() {
+  db_query('DELETE FROM {menu}');
+  $mid = module_invoke('menu', 'edit_item_save', array('title' => t('Primary links'), 'pid' => 0, 'type' => MENU_CUSTOM_MENU));
+  variable_set('menu_primary_menu', $mid);
+  variable_set('menu_secondary_menu', $mid);
+
+  drupal_set_message(t('The menu items have been reset to their default settings.'));
+
+  return 'admin/build/menu';
+}
+
+/**
+ * Implementation of hook_forms().
+ */
+function devel_forms() {
+  $forms = array();
+  if (user_access('access devel information')) {
+    // registers each devel_reinstall_$module form_id
+    $modules = module_list();
+    foreach ($modules as $module) {
+      $forms['devel_reinstall_'. $module]['callback'] = 'devel_reinstall_form';
+    }
+  }
+  return $forms;
+}
+
+function devel_reinstall_form($module) {
+  $form = array(
+    '#base' => 'devel_reinstall',
+    'submit' => array(
+      '#type' => 'submit',
+      '#value' => t('Reinstall @name module', array('@name' => $module))
+    ),
+  );
+  return $form;
+}
+
+/**
+ * Menu callback; Display a list of installed modules with the option to reinstall them via hook_install.
+ */
+function devel_reinstall() {
+  $output = '';
+  $modules = module_list();
+  sort($modules);
+  foreach ($modules as $module) {
+    $output .= drupal_get_form('devel_reinstall_'. $module, $module);
+  }
+
+  return $output;
+}
+
+/**
+ * Process reinstall menu form submissions.
+ */
+function devel_reinstall_submit($form_id, $form_values) {
+  include_once './includes/install.inc';
+  $module = str_replace('devel_reinstall_', '', $form_id);
+  $versions = drupal_get_schema_versions($module);
+  drupal_set_installed_schema_version($module, $versions ? max($versions) : SCHEMA_INSTALLED);
+  module_load_install($module);
+  module_invoke($module, 'install');
+  drupal_set_message(t('Reinstalled the %name module.', array('%name' => $module)));
+}
+
+/**
+ * Menu callback; display all variables.
+ */
+function devel_variable() {
+  global $conf;
+  return dprint_r($conf, TRUE);
+}
+
+/**
+ * Menu callback: display the session.
+ */
+function devel_session() {
+  return dprint_r($_SESSION, TRUE);
+}
+
+/**
+ * Switch from original user to another user and back.
+ *
+ * Note: taken from mailhandler.module.
+ *
+ * Note: You first need to run devel_switch_user without
+ * argument to store the current user. Call devel_switch_user
+ * without argument to set the user back to the original user.
+ *
+ * @param $uid The user ID to switch to.
+ *
+ */
+function devel_switch_user($uid = NULL) {
+  global $user;
+  static $orig_user = array();
+
+  if (isset($uid)) {
+    $user = user_load(array('uid' => $uid));
+  }
+  // Retrieve the initial user. Can be called multiple times.
+  else if (count($orig_user)) {
+    $user = array_shift($orig_user);
+    array_unshift($orig_user, $user);
+  }
+  // Store the initial user.
+  else {
+    $orig_user[] = $user;
+  }
+  drupal_goto();
+}
+
+/**
+ * Menu callback; prints the loaded structure of the current node/user.
+ */
+function devel_load_object($type, $id) {
+  $output = '';
+
+  switch ($type) {
+    case 'node':
+      $object = node_load($id);
+      drupal_set_title(check_plain($object->title));
+      break;
+
+    case 'user':
+      $object = user_load(array('uid' => $id));
+      drupal_set_title(check_plain($object->name));
+      break;
+  }
+
+  return devel_print_object($object);
+}
+
+/**
+ * Menu callback; prints the renderstructure of the current node.
+ */
+function devel_render_object($type, $id) {
+  $output = '';
+
+  switch ($type) {
+    case 'node':
+      $object = node_build_content(node_load($id), FALSE, FALSE);
+      drupal_set_title(check_plain($object->title));
+      break;
+
+    case 'user':
+      // not yet using fapi render model
+      break;
+  }
+
+  return devel_print_object($object);
+}
+
+function devel_print_object($object) {
+  foreach ($object as $field => $value) {
+    if (is_null($value)) {
+      $printed_value = 'NULL';
+    }
+    else if (is_array($value) || is_object($value)) {
+      ob_start();
+      print_r($value);
+      $printed_value = ob_get_clean();
+      $printed_value = '<pre>'. check_plain($printed_value) .'</pre>';
+    }
+    else {
+      $printed_value = check_plain($value);
+    }
+
+    $output .= theme('box', $field, $printed_value);
+  }
+  return $output;
+}
+
+/**
+ * Adds a table at the bottom of the page cataloguing data on all the database queries that were made to
+ * generate the page.
+ */
+function devel_query_table($queries, $counts) {
+  $header = array ('ms', '#', 'where', 'query');
+  $i = 0;
+  foreach ($queries as $query) {
+    // dprint_r($query);
+    $ar = explode("\n", $query[0]);
+    $function=array_shift($ar);
+    $query[0]=join(' ',$ar);
+
+    $diff = round($query[1] * 1000, 2);
+    $count = isset($counts[$query[0]]) ? $counts[$query[0]] : 0;
+    if ($diff > variable_get('devel_execution', 5)) {
+      $cell[$i][] = array ('data' => $diff, 'class' => 'marker');
+    }
+    else {
+      $cell[$i][] = $diff;
+    }
+    if ($count > 1) {
+      $cell[$i][] = array ('data' => $count, 'class' => 'marker');
+    }
+    else {
+      $cell[$i][] = $count;
+    }
+    $cell[$i][] = l($function, "http://api.drupal.org/api/HEAD/function/$function");
+    $cell[$i][] = check_plain($query[0]);
+    $i++;
+    unset($diff, $count);
+  }
+  if (variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE)) {
+    usort($cell, '_devel_table_sort');
+  }
+  return theme('table', $header, $cell);
+}
+
+function _devel_table_sort($a, $b) {
+	$a = is_array($a[0]) ? $a[0]['data'] : $a[0];
+	$b = is_array($b[0]) ? $b[0]['data'] : $b[0];
+	if ($a < $b) { return 1; }
+	if ($a > $b) { return -1; }
+	return 0;	
+}
+
+/**
+ * Displays page execution time at the bottom of the page.
+ */
+function devel_timer() {
+  $time = timer_read('page');
+  return t(' Page execution time was %time ms.', array('%time' => $time));
+}
+
+/**
+ * Prints the arguments for passed into the current function
+ */
+function dargs($always = TRUE) {
+  static $printed;
+  if ($always || !$printed) {
+    $bt = debug_backtrace();
+    dsm($bt[1]['args']);
+    $printed = TRUE;
+  }
+}
+
+/**
+ * Print a variable to the 'message' area of the page. Uses drupal_set_message()
+ */
+ function dsm($input, $name = NULL) {
+  if (user_access('access devel information')) {
+    $export = dprint_r($input, TRUE, $name);
+    drupal_set_message($export);
+  }
+}
+
+/**
+ * An alias for dprint_r(). Saves carpal tunnel syndrome.
+ */
+function dpr($str, $return = FALSE, $name = NULL) {
+  return dprint_r($str, $return, $name);
+}
+
+/**
+ * Pretty-print a variable to the browser.
+ * Displays only for users with proper permissions. If
+ * you want a string returned instead of a print, use the 2nd param.
+ */
+function dprint_r($input, $return = FALSE, $name = NULL) {
+  if (user_access('access devel information')) {
+  	if ($name) $name .= ' => ';
+  	ob_start();
+  	print_r($input);
+  	$printed_value = '<pre>' . $name . check_plain(ob_get_clean()) . '</pre>';
+    if ($return) {
+      return $printed_value;
+    } else {
+      print $printed_value;
+    }
+  }
+}
+
+/**
+ * Print the function call stack. This works even without xdebug installed.
+ */
+function ddebug_backtrace() {
+  if (user_access('access devel information')) {
+    if (function_exists('debug_print_backtrace')) {
+      debug_print_backtrace();
+    }
+    else {
+      dprint_r(debug_backtrace());
+    }
+  }
+}
+
+// Only define our mail wrapper if the devel module is the current mail
+// wrapper.
+if (variable_get('smtp_library', '') == drupal_get_filename('module', 'devel')) {
+  /**
+   * Log the mails sent out instead of mailing.
+   */
+  function drupal_mail_wrapper($mailkey, $to, $subject, $body, $from, $headers) {
+    $mimeheaders = array();
+    foreach ($headers as $name => $value) {
+      // the check_plain nicely encodes <> chars for web presentation
+      $mimeheaders[] = check_plain($name .': '. mime_header_encode($value));
+    }
+    watchdog('devel', t('Mail sent:<br />Key: %mailkey<br />To: %to<br />From: %from<br />Subject: %subject<br />Body: %body<br /><br />Additional headers: !header', array(
+      '%mailkey' => $mailkey,
+      '%to' => $to,
+      '%from' => $from,
+      '%subject' => $subject,
+      '%body' => $body,
+      '!header' => implode("<br />", $mimeheaders),
+    )));
+    return TRUE;
+  }
+}
+
+function devel_queries() {
+  $header = array(
+                  array('data' => t('Total time (ms)'), 'field' => 'total_time', 'sort' => 'desc'),
+                  array('data' => t('Average (ms)'), 'field' => 'average', 'sort' => 'desc'),
+                  array('data' => t('Standard deviation (ms)')),
+                  array('data' => t('Count'), 'field' => 'count'),
+                  array('data' => t('Function'), 'field' => 'q.function'),
+                  array('data' => t('Query'), 'field' => 'q.query'),
+                  );
+
+  $result = pager_query('SELECT q.qid, q.query, q.function, t.*, COUNT(t.qid) AS count, SUM(t.time) AS total_time, AVG(t.time) AS average, STDDEV(t.time) AS stddev FROM {devel_queries} q INNER JOIN {devel_times} t ON q.qid = t.qid GROUP BY t.qid '. tablesort_sql($header), 30, 0, 'SELECT COUNT(qid) FROM {devel_queries}');
+  while ($log = db_fetch_object($result)) {
+    $rows[] = array(
+                    round($log->total_time * 1000, 3),
+                    round($log->average * 1000, 3),
+                    round($log->stddev * 1000, 3),
+                    $log->count,
+                    $log->function,
+                    check_plain($log->query)
+                    );
+  }
+
+  drupal_set_title(check_plain($node->title));
+  $output = theme('table', $header, $rows);
+  $output .= theme('pager', NULL, 30, 0);
+  $output .= l(t('Delete collected query statistics'), 'devel/queries/empty');
+
+  return $output;
+}
+
+function devel_queries_empty() {
+  db_query('DELETE FROM {devel_queries}');
+  db_query('DELETE FROM {devel_times}');
+  drupal_set_message(t('Stored query statistics deleted.'));
+  drupal_goto('devel/queries');
+}
+
Index: modules/devel/generate/import-taxonomy-terms.php
===================================================================
RCS file: modules/devel/generate/import-taxonomy-terms.php
diff -N modules/devel/generate/import-taxonomy-terms.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/import-taxonomy-terms.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,44 @@
+<?php
+
+// written by Moshe Weitzman - weitzman at tejasa.com - July 2003
+
+// BEWARE! this script adds data to your database
+
+// -------------------------
+// CONFIGURATION
+
+    // Change the value below to TRUE when you want to run the script After running, immediately
+    // change back to FALSE in order to prevent accidentally executing this script twice.
+    $active = FALSE;
+    
+    // Enter the vocabulary ID into which you want to insert terms
+    $vid = 88;
+    
+    // create an array of term names. order doesn't
+    // matter since Drupal will present them alphabetically
+    $terms = array (
+      "Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Washington D.C."
+    );
+// -------------------------
+// CODE
+
+    include_once "includes/bootstrap.inc";
+    include_once("includes/common.inc");
+    
+    if ($active) {
+      if (user_access("administer taxonomy")) {
+        foreach ($terms as $term) {
+          $edit = array ("vid" => $vid, "name" => $term );
+          $msg = taxonomy_save_term($edit);
+          print $msg;
+        }
+      }
+      else {
+        print "You have insufficent permission to  administer taxonomy";
+      }  
+    }
+    else {
+      print "You have not activated term_loader. See $active variable at top of the source code";
+    }
+
+?>
Index: modules/devel/generate/import-users.php
===================================================================
RCS file: modules/devel/generate/import-users.php
diff -N modules/devel/generate/import-users.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/import-users.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,14 @@
+<?php
+// Reads a csv formatted file and creates users.
+// $Id: import-users.php,v 1.1 2005/09/06 14:06:39 weitzman Exp $
+include "includes/bootstrap.inc";
+include "includes/common.inc";
+
+$handle = fopen("daten.csv", "r");
+while ($data = fgetcsv ($handle, 1000, ";")) {
+  $array = array("name" => $data[0], "pass" => $data[1], "mail" => $data[2], "status" => 1, "rid" => _user_authenticated_id());
+  user_save($account, $array);
+}
+fclose ($handle);
+
+?>
Index: modules/devel/generate/README.txt
===================================================================
RCS file: modules/devel/generate/README.txt
diff -N modules/devel/generate/README.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/README.txt	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,45 @@
+GENERAL
+===========================
+To use these scripts, copy them to the root of your Drupal site.
+When you are done, delete them since they are not access controlled.
+
+import-taxonomy-terms.php
+===========================
+
+This simple script creates terms out of an array of names which you provide. unlike
+the other scripts in this directory, this one is meant for live sites which need to bulk
+import data into the term table. See the source code comments for config instructions
+
+generate-taxonomy.php
+=====================
+
+With this script you can generate several taxonomy vocabularies and
+terms assigned to them.
+Put it in the root directory of your Drupal installation, log into your
+Drupal as user #1 and then access the script. It will remove the
+existing vocabularies and terms and generates 15 vocabularies and 50 terms.
+These values can be changed at the bottom of the file.
+
+
+generate-content.php
+====================
+
+The script generate-content.php can be used to generate content to
+test a Drupal site.
+Put it in the root directory of your Drupal installation, log into your
+Drupal as user #1 and then access the script. It will remove the 
+existing content and generate 50 nodes and 500 comments. These values can 
+be changed at the bottom of the file. If vocabularies and terms exist
+terms will get assigned to the new nodes. Therefore you should run 
+generate-taxonomy.php before this script.
+
+
+update-teaser.php
+=================
+
+Use this script to regenerate the teasers in the node table.
+
+import-users.php
+==================
+
+A small script that reads users from a csv formatted file and puts them into your database.
Index: modules/devel/generate/update-teaser.php
===================================================================
RCS file: modules/devel/generate/update-teaser.php
diff -N modules/devel/generate/update-teaser.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/update-teaser.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,13 @@
+<?php
+// $Id: update-teaser.php,v 1.2 2004/03/04 22:58:04 killes Exp $
+include "includes/bootstrap.inc";
+include "includes/common.inc";
+
+$result = db_query("SELECT nid,body,teaser FROM node");
+
+while ($node = db_fetch_object($result)) {
+  $teaser = node_teaser($node->body);
+  db_query("UPDATE node SET teaser = '%s' WHERE nid = %d", $teaser, $node->nid);
+}
+
+?>
Index: modules/devel/README.txt
===================================================================
RCS file: modules/devel/README.txt
diff -N modules/devel/README.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/README.txt	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+README.txt
+==========
+
+A module containing helper functions for Drupal developers and
+inquisitive admins. Initially, this module prints out a summary of
+all database queries for each page request at the bottom of each page. The
+summary includes how many times each query was executed on a page
+(shouldn't run same query multiple times), and how long each query
+ took (short is good - use cache for complex queries).
+
+Also a dprint_r($array) function is provided, which pretty prints arrays. Useful during
+development.
+
+Also prints stack trace and profileing info when the xdebug extension is active.
+See http://www.xdebug.org/index.php
+
+-moshe weitzman
+weitzman at tejasa.com
+
+NOTE
+====
+
+The subdirectory generate/ includes some scripts that can be used to help testing
+on a Drupal site. See generate/README.txt for details.
Index: modules/devel/devel_node_access.install
===================================================================
RCS file: modules/devel/devel_node_access.install
diff -N modules/devel/devel_node_access.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel_node_access.install	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,6 @@
+<?php
+
+function devel_node_access_install() {
+  // force drupal to auto-enable the block
+  _block_rehash();
+}
Index: modules/devel/po/fr.po
===================================================================
RCS file: modules/devel/po/fr.po
diff -N modules/devel/po/fr.po
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/po/fr.po	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,83 @@
+# LANGUAGE translation of PROJECT
+# Copyright YEAR NAME <EMAIL@ADDRESS>
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: V 1.00\n"
+"POT-Creation-Date: 2005-07-25 17:54+0200\n"
+"PO-Revision-Date: 2006-03-24 23:44+0100\n"
+"Last-Translator: Marand <fgm@osinet.fr>\n"
+"Language-Team: MATTEO <m.ferrari@tiscali.it>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:30
+msgid "empty cache"
+msgstr "vidange du cache"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:33
+msgid "variable viewer"
+msgstr "variables"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:48
+msgid " Page execution time was %time ms."
+msgstr "Durée d'exécution de la page: %time ms."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:64
+msgid "<p>The user is being redirected to %destination.</p>"
+msgstr "<p>L'utilisateur est renvoyé à %destination.</p>"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:191
+msgid "Development helper functions"
+msgstr "Fonctions d'aide aux développeurs"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page timer"
+msgstr "Afficher le chronomètre de page"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Disabled"
+msgstr "Désactivé"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Enabled"
+msgstr "Activé"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page execution time in the query log box."
+msgstr "Afficher la durée d'exécution de la page dans la boîte listant les requêtes."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display query log"
+msgstr "Afficher la liste des requêtes."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display a log of the database queries needed to generate the current page, the and the execution time for each. Also, a queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching."
+msgstr "Affiche un journal des requêtes nécessaires pour la production de la page courante, et leur durée d'exécution. En outre, les requêtes qui viennent à être répétées lors de l'affiche d'une page sont totalisées dans la colonne #, et affichées en rouge, pour attirer l'attention sur le fait qu'il peut être judicieux de les mettres en mémoire."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Query execution threshhold"
+msgstr "Seuil d'alerte pour l'exécution des requêtes"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibliy inefficient query, or a candidate for caching."
+msgstr "Saisir une valeur entière en millisecondes. Toute requête plus longue que cette durée sera mise en évidence dans la liste des requêtes. Ceci indique que la requête est peut-être inefficace ou est susceptible de bénéficier du mécanisme d'antémémoire."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "Display redirection page"
+msgstr "Afficher la page de renvoi."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page."
+msgstr "Lorsqu'un module invoque <code>drupal_goto()</code> pour causer un renvoi vers une autre page, la liste des requêtes et les autres informations utiles au développeur sont perdues. Activer ce paramètre a pour effet de présenter lors des renvois une page intermédiaire permettant au développeur d'examiner les données avant de continuer sur la page de renvoi."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:210
+msgid "access devel information"
+msgstr "accéder aux informations pour développeurs"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:0
+msgid "devel"
+msgstr "devel"
+
Index: modules/devel/devel.css
===================================================================
RCS file: modules/devel/devel.css
diff -N modules/devel/devel.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel.css	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,35 @@
+.dev-query, .dev-timer, .dev-memory-usage {
+  padding-top: 2em;
+}
+
+/* phpinfo() styling */
+.phpinfo .center {
+  text-align: center;
+}
+.phpinfo table {
+  margin-left: auto;
+  margin-right: auto;
+  text-align: left;
+}
+.phpinfo td, .phpinfo th {
+  border: 1px solid #000;
+  vertical-align: baseline;
+}
+.phpinfo .e {
+  background-color: #CCCCFF;
+  font-weight: bold;
+  color: #000;
+}
+.phpinfo .h {
+  background-color: #9999CC;
+  font-weight: bold;
+  color: #000;
+}
+.phpinfo .v {
+  background-color: #CCC;
+  color: #000;
+}
+.phpinfo img {
+  float: right;
+  border: 0px;
+}
Index: modules/devel/generate/generate-og-users.php
===================================================================
RCS file: modules/devel/generate/generate-og-users.php
diff -N modules/devel/generate/generate-og-users.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/generate/generate-og-users.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,51 @@
+<?php
+
+// $Id: generate-og-users.php,v 1.3 2006/06/11 00:43:25 killes Exp $:
+
+/**
+ * This script assigns existing users to existing groups.
+ * Requires Drupal 4.7 and OG module.
+ *
+ * Takes all groups, and assines a decreasing number of random users
+ * as members.
+ *
+ * If n is the total number of registered users, the first group gets
+ * all of them, the next gets half of them, etc. Admins are excluded.
+ *
+ * Sponsored by CivicSpace Labs
+ */
+require_once './includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+function gou_get_groups() {
+  $result = db_query("SELECT nid, uid FROM {og_uid} WHERE is_admin >= 1");
+  $groups = array();
+  while ($group = db_fetch_array($result)) {
+    $groups[$group['nid']][] = $group['uid'];
+  }
+
+  return $groups;
+}
+
+function gou_count_users() {
+  return db_result(db_query('SELECT COUNT(*) FROM {users} WHERE uid > 0'));
+}
+
+function gou_assign_users($nid, $admins, $limit = NULL) {
+  $sql = 'INSERT INTO og_uid (nid, uid, is_active, mail_type) SELECT %d, uid, 1, 1 FROM users u WHERE u.uid NOT IN ('. str_pad('', count($admins) * 3 - 1, '%d,') .') ORDER BY RAND()';
+  if ($limit) {
+    $sql .= " LIMIT $limit";
+  }
+  db_query($sql, $nid, implode(',', $admins));
+}
+
+
+$users = gou_count_users();
+$groups = gou_get_groups();
+
+foreach ($groups as $nid => $group) {
+  $node = node_load($nid);
+  drupal_set_message(t('Assigned %n users to group %t.', array('%n' => $users, '%t' => theme('placeholder', $node->title))));
+  gou_assign_users($nid, $group, $users);
+  $users = floor($users / 2 + count($group));
+}
Index: modules/devel/po/da.po
===================================================================
RCS file: modules/devel/po/da.po
diff -N modules/devel/po/da.po
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/po/da.po	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,83 @@
+# Danish translation of Drupal (devel.module)
+# Copyright 2006 Morten Wulff <wulff@psyke.org>
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Danish translation of Drupal (devel.module) $Id: da.po,v 1.1 2006/02/12 11:37:52 wulff Exp $\n"
+"POT-Creation-Date: 2005-07-25 17:54+0200\n"
+"PO-Revision-Date: 2006-02-12 12:38+0100\n"
+"Last-Translator: Morten Wulff <wulff@psyke.org>\n"
+"Language-Team: Danish <danish@psyke.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:30
+msgid "empty cache"
+msgstr "tøm mellemlager"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:33
+msgid "variable viewer"
+msgstr "gennemse variable"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:48
+msgid " Page execution time was %time ms."
+msgstr "Side afviklet på %time ms."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:64
+msgid "<p>The user is being redirected to %destination.</p>"
+msgstr "<p>Brugeren omdirigeres til %destination.</p>"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:191
+msgid "Development helper functions"
+msgstr "Hjælpefunktioner til udvikling"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page timer"
+msgstr "Vis tidsforbrug"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Disabled"
+msgstr "Deaktiveret"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199;200;202
+msgid "Enabled"
+msgstr "Aktiveret"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:199
+msgid "Display page execution time in the query log box."
+msgstr "Hvis sidens afviklingstid i kassen med forespørgselsloggen."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display query log"
+msgstr "Vis forespørgselslog"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:200
+msgid "Display a log of the database queries needed to generate the current page, the and the execution time for each. Also, a queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching."
+msgstr "Vis en log over de databaseforespørgsler der blev foretaget for at bygge den aktuelle side samt deres afviklingstider. Desuden bliver alle gentagne forespørgsler markeret i '#'-kolonnen, da de er kandidater til mellemlagring."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Query execution threshhold"
+msgstr "Tidsrænse for forespørgsel"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:201
+msgid "Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibliy inefficient query, or a candidate for caching."
+msgstr "Indtast et antal millisekunder. Enhver forespørgsel der tager længere end det angivne antal millisekunder bliver fremhævet i forespørgselsloggen. Det indikerer en muligvis ineffektiv forespørgsel eller en kandidat til mellemlagring."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "Display redirection page"
+msgstr "Vis omdirigeringsside"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:202
+msgid "When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page."
+msgstr "Når et modul kalder drupal_goto() mistes forespørgselsloggen og anden udviklingsinformation. Aktiver denne indstilling for at se en mellemliggende side, der viser loggen før der fortsættes til næste side."
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:210
+msgid "access devel information"
+msgstr "tilgå udviklingsinformation"
+
+#: d:\Drupal-contributions-CVS\modules\devel\devel.module:0
+msgid "devel"
+msgstr "udvikling"
+
Index: modules/devel/devel_node_access.module
===================================================================
RCS file: modules/devel/devel_node_access.module
diff -N modules/devel/devel_node_access.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel_node_access.module	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,302 @@
+<?php
+// $Id: devel_node_access.module,v 1.7 2006/08/17 12:33:29 dww Exp $
+/**
+ * @file
+ *
+ * This module gives developers feedback as to what there
+ * node_access table contains, and which nodes are protected or
+ * visible to the public.
+ *
+ */
+
+define('DNA_ACCESS_VIEW', 'view devel_node_access information');
+
+function devel_node_access_perm() {
+  return array(DNA_ACCESS_VIEW);
+}
+
+/**
+ * Implementation of hook_help().
+ */
+function devel_node_access_help($section) {
+  switch ($section) {
+  case 'admin/settings/modules#description':
+	return t('Development helper for node_access table');
+	break;
+  case 'admin/help#devel_node_access':
+	$output .= '<p>'.t('This module helps in site development.  Specifically, when an access control module is used to limit access to some or all nodes, this module provides some feedback showing the node_access table in the database.') ."</p>\n";
+	$output .= '<p>'.t('The node_access table is one method Drupal provides to hide content from some users while displaying it to others.  By default, Drupal shows all nodes to all users.  There are a number of optional modules which may be installed to hide content from some users.')."</p>\n";
+	$output .= '<p>'.t('If you have not installed one of these modules, you really have no need for the devel_node_access module.  This module is intended for use during development, so that developers and admins can confirm that node_access table is working as expected.  You probably do not want this module enabled on a production site.')."</p>\n";
+	$output .= '<p>'.t('This module provides a %summary_page which shows show general information about your node_access table.  If you have installed the Views module, you may %browse_link.  This module also provides a block showing the rows of the node_access table relevant to whatever node(s) are shown on a given page.  Because the table shown is wide, it is recommended to enable the block in the page footer rather than a sidebar.',
+					   array('%summary_page' => l(t('summary page'), 'devel/node_access/summary'),
+							 '%browse_link' => l(t('browse node_access by realm'), 'devel/node_access/view'))
+					   )."</p>\n";
+	$output .= '<p>'.t('')."</p>\n";
+	return $output;
+  }
+}
+
+
+function devel_node_access_menu($may_cache) {
+  $items = array();
+  if ($may_cache) {
+	$items[] = array('path' => 'devel/node_access/summary',
+					 'title' => t('node_access summary'),
+					 'callback' => 'dna_summary',
+					 'access' => user_access(DNA_ACCESS_VIEW),
+					 'type' => MENU_CALLBACK,
+					 );
+  }
+  return $items;
+}
+
+function dna_summary() {
+  // Warn user if they have any entries that could grant access to all nodes
+  $result = db_query('SELECT DISTINCT realm FROM {node_access} WHERE nid=0 AND gid=0');
+  if (db_num_rows($result)) {
+	$output .= '<h3>'.t('Access Granted to All Nodes (All Users)')."</h3>\n";
+	$output .= '<p>'.t('Your node_access table contains entries that may be granting all users access to all nodes.  Depending on which access control module(s) you use, you may want to delete these entries.  If you are not using an access control module, you should probably leave these entries as is.')."</p>\n";
+	$headers = array(t('realm'));
+	$rows = array();
+	while ($row = db_fetch_object($result)) {
+	  $rows[] = array($row->realm);
+	}
+	$output .= theme_table($headers, $rows);
+  }
+
+  // how many nodes are not represented in the node_access table
+  $result = db_fetch_object(db_query('SELECT COUNT(n.nid) as num_nodes FROM {node} n LEFT JOIN {node_access} na ON n.nid = na.nid WHERE na.nid IS NULL'));
+  if ($num = $result->num_nodes) {
+	$output .= '<h3>'.t('Legacy Nodes')."</h3>\n";
+	$output .= '<p>'.
+	  t('You have %num nodes in your node table which are not represented in your node_access table.  If you have an access control module installed, these nodes may be hidden from all users.  This could be caused by publishing nodes before enabling the access control module.  If this is the case, manually updating each node should add it to the node_access table and fix the problem.', array('%num' => l($num, 'devel/node_access/view/NULL'))).
+	  "</p>\n";
+  }
+  else {
+	$output .= '<h3>'.t('All Nodes Represented')."</h3>\n";
+	$output .= '<p>'.
+	  t('All nodes are represented in the node_access table.').
+	  "</p>\n";
+  }
+
+
+  // a similar warning to the one above, but slightly more specific
+  $result = db_query('SELECT DISTINCT realm FROM {node_access} WHERE nid=0 AND gid!=0');
+  if (db_num_rows($result)) {
+	$output .= '<h3>'.t('Access Granted to All Nodes (Some Users)')."</h3>\n";
+	$output .= '<p>'.t('Your node_access table contains entries that may be granting some users access to all nodes.  This may be perfectly normal, depending on which access control module(s) you use.')."</p>\n";
+	$headers = array(t('realm'));
+	$rows = array();
+	while ($row = db_fetch_object($result)) {
+	  $rows[] = array($row->realm);
+	}
+	$output .= theme_table($headers, $rows);
+  }
+
+
+  // find specific nodes which may be visible to all users
+  $result = db_query('SELECT DISTINCT realm, COUNT(DISTINCT nid) as node_count FROM {node_access} WHERE gid=0 AND nid > 0 GROUP BY realm');
+  if (db_num_rows($result)) {
+	$output .= '<h3>'.t('Access Granted to Some Nodes')."</h3>\n";
+	$output .= '<p>'.
+	  t('The following realms appear to grant all users access to some specific nodes.  This may be perfectly normal, if some of your content is available to the public.').
+	  "</p>\n";
+	$headers = array(t('realm'), t('public nodes'));
+	$rows = array();
+	while ($row = db_fetch_object($result)) {
+	  $rows[] = array($row->realm,
+					  array('data' => $row->node_count,
+							'align' => 'center'));
+	}
+	$output .= theme_table($headers, $rows, array(), t('Public Nodes'));
+  }
+
+
+  // find specific nodes protected by node_access table
+  $result = db_query('SELECT DISTINCT realm, COUNT(DISTINCT nid) as node_count FROM {node_access} WHERE gid != 0 AND nid > 0 GROUP BY realm');
+  if (db_num_rows($result)) {
+	$output .= '<h3>'.t('Summary by Realm')."</h3>\n";
+	$output .= '<p>'.
+	  t('The following realms grant limited access to some specific nodes.').
+	  "</p>\n";
+	$headers = array(t('realm'), t('private nodes'));
+	$rows = array();
+	while ($row = db_fetch_object($result)) {
+	  $rows[] = array(l($row->realm, "devel/node_access/view/$row->realm"),
+					  array('data' => $row->node_count,
+							'align' => 'center'));
+	}
+	$output .= theme_table($headers, $rows, array(), t('Protected Nodes'));
+  }
+
+
+
+  return $output;
+}
+
+function dna_visible_nodes($nid = null) {
+  static $nids = array();
+  if ($nid) {
+	$nids[$nid] = $nid;
+  }
+  return $nids;
+}
+
+function devel_node_access_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
+  if ($op == 'view') {
+	// remember this node, for display in our block
+	dna_visible_nodes($node->nid);
+  }
+}
+
+function devel_node_access_block($op = 'list', $delta = 0) {
+  switch ($op) {
+  case 'list':
+	  $blocks[0]['info'] = t('Devel Node Access');
+	  $blocks[0]['status'] = 1;
+	  $blocks[0]['region'] = 'footer';
+	return $blocks;
+	break;
+  case 'view':
+	if (!user_access(DNA_ACCESS_VIEW))
+	  return;
+	if (!count(dna_visible_nodes()))
+	  return;
+	
+	// include rows where nid == 0
+	$nids = array_merge(array(0 => 0), dna_visible_nodes());
+	$result = db_query('SELECT na.*, n.title FROM {node_access} na LEFT JOIN {node} n ON n.nid = na.nid WHERE na.nid IN (%s) ORDER BY na.nid',
+					   implode(',', $nids));
+	$headers = array(t('node'), t('realm'), t('gid'), t('view'), t('update'), t('delete'));
+	$rows = array();
+	while ($row = db_fetch_object($result)) {
+	  $rows[] = array($row->title ? $row->title : $row->nid,
+					  $row->realm,
+					  $row->gid,
+					  $row->grant_view,
+					  $row->grant_update,
+					  $row->grant_delete);
+	}
+	$output = theme_table($headers, $rows);
+	$subject = t('node_access entries for nodes shown on this page');
+	return array('subject' => $subject, 'content' => $output);
+	break;
+	
+  }
+}
+
+
+function devel_node_access_views_tables() {
+  $tables['node_access'] =
+	array('name' => 'node_access',
+		  'join' => array('left' => array('table' => 'node',
+										  'field' => 'nid'),
+						  'right' => array('field' => 'nid')),
+		  'fields' => array('realm' =>
+							array('name' => t('Node Access: realm'),
+								  'sortable' => true,
+								  ),
+							),
+		  'filters' =>
+		  array('realm' =>
+				array('name' => t('Node Access Realm'),
+					  'operator' => 'views_handler_operator_eqneq',
+					  ),
+				),
+		
+		  );
+  return $tables;
+}
+
+function devel_node_access_views_arguments() {
+  $arguments =
+	array('realm' =>
+		  array('name' => t('Node Access: Realm'),
+				'handler' => 'dna_handler_arg_realm',
+				),
+		  );
+  return $arguments;
+}
+
+function dna_handler_arg_realm($op, &$query, $argtype, $arg = '') {
+  switch ($op) {
+  case 'summary':
+	$query->ensure_table('node_access', true);
+	$query->add_field('realm', 'node_access');
+	$fieldinfo['field'] = 'realm';
+	$query->add_orderby('node_access', 'realm', 'ASC');
+	return $fieldinfo;
+	break;
+  case 'filter':
+	$query->ensure_table('node_access');
+	if ($arg == 'NULL')
+	  $query->add_where("node_access.realm IS NULL");
+	else
+	  $query->add_where("node_access.realm = '$arg'");
+	break;
+  case 'link':
+	if ($query->realm)
+	  return l($query->realm, "$arg/$query->realm");
+	else
+	  return l('NULL', "$arg/NULL");
+	break;
+  case 'title':
+	return $query;
+	break;
+  }
+}
+
+function devel_node_access_views_default_views() {
+  $view = new stdClass();
+  $view->name = 'devel_node_access';
+  $view->description = 'View nodes in node_access table';
+  $view->access = array (
+);
+  $view->page = TRUE;
+  $view->page_title = 'Nodes in node_access table where realm is %1';
+  $view->page_header = '';
+  $view->page_header_format = '1';
+  $view->page_type = 'table';
+  $view->url = 'devel/node_access/view';
+  $view->use_pager = TRUE;
+  $view->nodes_per_page = '10';
+  $view->sort = array (
+  );
+  $view->argument = array (
+    array (
+      'type' => 'realm',
+      'argdefault' => '3',
+      'title' => 'node_access realms',
+      'options' => '',
+    ),
+  );
+  $view->field = array (
+    array (
+      'tablename' => 'node',
+      'field' => 'title',
+      'label' => 'Title',
+      'handler' => 'views_handler_field_nodelink',
+      'sortable' => '1',
+      'defaultsort' => 'ASC',
+    ),
+    array (
+      'tablename' => 'node',
+      'field' => 'type',
+      'label' => 'Type',
+      'sortable' => '1',
+    ),
+    array (
+      'tablename' => 'node',
+      'field' => 'changed',
+      'label' => 'Updated',
+      'handler' => 'views_handler_field_date_small',
+      'sortable' => '1',
+    ),
+  );
+  $view->filter = array (
+  );
+  $view->requires = array(node);
+  $views[$view->name] = $view;
+
+  return $views;
+}
Index: modules/devel/devel_node_access.info
===================================================================
RCS file: modules/devel/devel_node_access.info
diff -N modules/devel/devel_node_access.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/devel/devel_node_access.info	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+; $Id: devel_node_access.info,v 1.1 2006/09/22 08:37:44 weitzman Exp $
+name = Devel Node Access
+description = Developer block and page illustrating relevant node_access records.
